Sat, 03 Jan 2015 20:18:00 +0100
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 | * Copyright 2006 The Android Open Source Project |
michael@0 | 3 | * |
michael@0 | 4 | * Use of this source code is governed by a BSD-style license that can be |
michael@0 | 5 | * found in the LICENSE file. |
michael@0 | 6 | */ |
michael@0 | 7 | |
michael@0 | 8 | #ifndef Sk2DPathEffect_DEFINED |
michael@0 | 9 | #define Sk2DPathEffect_DEFINED |
michael@0 | 10 | |
michael@0 | 11 | #include "SkPath.h" |
michael@0 | 12 | #include "SkPathEffect.h" |
michael@0 | 13 | #include "SkMatrix.h" |
michael@0 | 14 | |
michael@0 | 15 | class SK_API Sk2DPathEffect : public SkPathEffect { |
michael@0 | 16 | public: |
michael@0 | 17 | static Sk2DPathEffect* Create(const SkMatrix& mat) { |
michael@0 | 18 | return SkNEW_ARGS(Sk2DPathEffect, (mat)); |
michael@0 | 19 | } |
michael@0 | 20 | |
michael@0 | 21 | virtual bool filterPath(SkPath*, const SkPath&, |
michael@0 | 22 | SkStrokeRec*, const SkRect*) const SK_OVERRIDE; |
michael@0 | 23 | |
michael@0 | 24 | SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(Sk2DPathEffect) |
michael@0 | 25 | |
michael@0 | 26 | protected: |
michael@0 | 27 | /** New virtual, to be overridden by subclasses. |
michael@0 | 28 | This is called once from filterPath, and provides the |
michael@0 | 29 | uv parameter bounds for the path. Subsequent calls to |
michael@0 | 30 | next() will receive u and v values within these bounds, |
michael@0 | 31 | and then a call to end() will signal the end of processing. |
michael@0 | 32 | */ |
michael@0 | 33 | virtual void begin(const SkIRect& uvBounds, SkPath* dst) const; |
michael@0 | 34 | virtual void next(const SkPoint& loc, int u, int v, SkPath* dst) const; |
michael@0 | 35 | virtual void end(SkPath* dst) const; |
michael@0 | 36 | |
michael@0 | 37 | /** Low-level virtual called per span of locations in the u-direction. |
michael@0 | 38 | The default implementation calls next() repeatedly with each |
michael@0 | 39 | location. |
michael@0 | 40 | */ |
michael@0 | 41 | virtual void nextSpan(int u, int v, int ucount, SkPath* dst) const; |
michael@0 | 42 | |
michael@0 | 43 | const SkMatrix& getMatrix() const { return fMatrix; } |
michael@0 | 44 | |
michael@0 | 45 | // protected so that subclasses can call this during unflattening |
michael@0 | 46 | Sk2DPathEffect(SkReadBuffer&); |
michael@0 | 47 | virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; |
michael@0 | 48 | |
michael@0 | 49 | #ifdef SK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS |
michael@0 | 50 | public: |
michael@0 | 51 | #endif |
michael@0 | 52 | Sk2DPathEffect(const SkMatrix& mat); |
michael@0 | 53 | |
michael@0 | 54 | private: |
michael@0 | 55 | SkMatrix fMatrix, fInverse; |
michael@0 | 56 | bool fMatrixIsInvertible; |
michael@0 | 57 | |
michael@0 | 58 | // illegal |
michael@0 | 59 | Sk2DPathEffect(const Sk2DPathEffect&); |
michael@0 | 60 | Sk2DPathEffect& operator=(const Sk2DPathEffect&); |
michael@0 | 61 | |
michael@0 | 62 | friend class Sk2DPathEffectBlitter; |
michael@0 | 63 | typedef SkPathEffect INHERITED; |
michael@0 | 64 | }; |
michael@0 | 65 | |
michael@0 | 66 | class SK_API SkLine2DPathEffect : public Sk2DPathEffect { |
michael@0 | 67 | public: |
michael@0 | 68 | static SkLine2DPathEffect* Create(SkScalar width, const SkMatrix& matrix) { |
michael@0 | 69 | return SkNEW_ARGS(SkLine2DPathEffect, (width, matrix)); |
michael@0 | 70 | } |
michael@0 | 71 | |
michael@0 | 72 | virtual bool filterPath(SkPath* dst, const SkPath& src, |
michael@0 | 73 | SkStrokeRec*, const SkRect*) const SK_OVERRIDE; |
michael@0 | 74 | |
michael@0 | 75 | SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkLine2DPathEffect) |
michael@0 | 76 | |
michael@0 | 77 | protected: |
michael@0 | 78 | virtual void nextSpan(int u, int v, int ucount, SkPath*) const SK_OVERRIDE; |
michael@0 | 79 | |
michael@0 | 80 | SkLine2DPathEffect(SkReadBuffer&); |
michael@0 | 81 | |
michael@0 | 82 | virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; |
michael@0 | 83 | |
michael@0 | 84 | #ifdef SK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS |
michael@0 | 85 | public: |
michael@0 | 86 | #endif |
michael@0 | 87 | SkLine2DPathEffect(SkScalar width, const SkMatrix& matrix) |
michael@0 | 88 | : Sk2DPathEffect(matrix), fWidth(width) {} |
michael@0 | 89 | |
michael@0 | 90 | private: |
michael@0 | 91 | SkScalar fWidth; |
michael@0 | 92 | |
michael@0 | 93 | typedef Sk2DPathEffect INHERITED; |
michael@0 | 94 | }; |
michael@0 | 95 | |
michael@0 | 96 | class SK_API SkPath2DPathEffect : public Sk2DPathEffect { |
michael@0 | 97 | public: |
michael@0 | 98 | /** |
michael@0 | 99 | * Stamp the specified path to fill the shape, using the matrix to define |
michael@0 | 100 | * the latice. |
michael@0 | 101 | */ |
michael@0 | 102 | static SkPath2DPathEffect* Create(const SkMatrix& matrix, const SkPath& path) { |
michael@0 | 103 | return SkNEW_ARGS(SkPath2DPathEffect, (matrix, path)); |
michael@0 | 104 | } |
michael@0 | 105 | |
michael@0 | 106 | SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPath2DPathEffect) |
michael@0 | 107 | |
michael@0 | 108 | protected: |
michael@0 | 109 | SkPath2DPathEffect(SkReadBuffer& buffer); |
michael@0 | 110 | virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; |
michael@0 | 111 | |
michael@0 | 112 | virtual void next(const SkPoint&, int u, int v, SkPath*) const SK_OVERRIDE; |
michael@0 | 113 | |
michael@0 | 114 | #ifdef SK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS |
michael@0 | 115 | public: |
michael@0 | 116 | #endif |
michael@0 | 117 | SkPath2DPathEffect(const SkMatrix&, const SkPath&); |
michael@0 | 118 | |
michael@0 | 119 | private: |
michael@0 | 120 | SkPath fPath; |
michael@0 | 121 | |
michael@0 | 122 | typedef Sk2DPathEffect INHERITED; |
michael@0 | 123 | }; |
michael@0 | 124 | |
michael@0 | 125 | #endif |