gfx/skia/trunk/include/effects/SkLayerRasterizer.h

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

michael@0 1
michael@0 2 /*
michael@0 3 * Copyright 2006 The Android Open Source Project
michael@0 4 *
michael@0 5 * Use of this source code is governed by a BSD-style license that can be
michael@0 6 * found in the LICENSE file.
michael@0 7 */
michael@0 8
michael@0 9
michael@0 10 #ifndef SkLayerRasterizer_DEFINED
michael@0 11 #define SkLayerRasterizer_DEFINED
michael@0 12
michael@0 13 #include "SkRasterizer.h"
michael@0 14 #include "SkDeque.h"
michael@0 15 #include "SkScalar.h"
michael@0 16
michael@0 17 class SkPaint;
michael@0 18
michael@0 19 class SK_API SkLayerRasterizer : public SkRasterizer {
michael@0 20 public:
michael@0 21 virtual ~SkLayerRasterizer();
michael@0 22
michael@0 23 class SK_API Builder {
michael@0 24 public:
michael@0 25 Builder();
michael@0 26 ~Builder();
michael@0 27
michael@0 28 void addLayer(const SkPaint& paint) {
michael@0 29 this->addLayer(paint, 0, 0);
michael@0 30 }
michael@0 31
michael@0 32 /**
michael@0 33 * Add a new layer (above any previous layers) to the rasterizer.
michael@0 34 * The layer will extract those fields that affect the mask from
michael@0 35 * the specified paint, but will not retain a reference to the paint
michael@0 36 * object itself, so it may be reused without danger of side-effects.
michael@0 37 */
michael@0 38 void addLayer(const SkPaint& paint, SkScalar dx, SkScalar dy);
michael@0 39
michael@0 40 /**
michael@0 41 * Pass queue of layers on to newly created layer rasterizer and return it. The builder
michael@0 42 * cannot be used any more after calling this function.
michael@0 43 */
michael@0 44 SkLayerRasterizer* detachRasterizer();
michael@0 45
michael@0 46 private:
michael@0 47 SkDeque* fLayers;
michael@0 48 };
michael@0 49
michael@0 50 #ifdef SK_SUPPORT_LEGACY_LAYERRASTERIZER_API
michael@0 51 void addLayer(const SkPaint& paint) {
michael@0 52 this->addLayer(paint, 0, 0);
michael@0 53 }
michael@0 54
michael@0 55 /** Add a new layer (above any previous layers) to the rasterizer.
michael@0 56 The layer will extract those fields that affect the mask from
michael@0 57 the specified paint, but will not retain a reference to the paint
michael@0 58 object itself, so it may be reused without danger of side-effects.
michael@0 59 */
michael@0 60 void addLayer(const SkPaint& paint, SkScalar dx, SkScalar dy);
michael@0 61 #endif
michael@0 62
michael@0 63 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkLayerRasterizer)
michael@0 64
michael@0 65 protected:
michael@0 66 SkLayerRasterizer(SkDeque* layers);
michael@0 67 SkLayerRasterizer(SkReadBuffer&);
michael@0 68 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
michael@0 69
michael@0 70 // override from SkRasterizer
michael@0 71 virtual bool onRasterize(const SkPath& path, const SkMatrix& matrix,
michael@0 72 const SkIRect* clipBounds,
michael@0 73 SkMask* mask, SkMask::CreateMode mode) const;
michael@0 74
michael@0 75 #ifdef SK_SUPPORT_LEGACY_LAYERRASTERIZER_API
michael@0 76 public:
michael@0 77 #endif
michael@0 78 SkLayerRasterizer();
michael@0 79
michael@0 80 private:
michael@0 81 #ifdef SK_SUPPORT_LEGACY_LAYERRASTERIZER_API
michael@0 82 SkDeque* fLayers;
michael@0 83 #else
michael@0 84 const SkDeque* const fLayers;
michael@0 85 #endif
michael@0 86
michael@0 87 static SkDeque* ReadLayers(SkReadBuffer& buffer);
michael@0 88
michael@0 89 typedef SkRasterizer INHERITED;
michael@0 90 };
michael@0 91
michael@0 92 #endif

mercurial