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.

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

mercurial