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 2012 Google Inc. |
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 | #ifndef SkOpEdgeBuilder_DEFINED |
michael@0 | 8 | #define SkOpEdgeBuilder_DEFINED |
michael@0 | 9 | |
michael@0 | 10 | #include "SkOpContour.h" |
michael@0 | 11 | #include "SkPathWriter.h" |
michael@0 | 12 | #include "SkTArray.h" |
michael@0 | 13 | |
michael@0 | 14 | class SkOpEdgeBuilder { |
michael@0 | 15 | public: |
michael@0 | 16 | SkOpEdgeBuilder(const SkPathWriter& path, SkTArray<SkOpContour>& contours) |
michael@0 | 17 | : fPath(path.nativePath()) |
michael@0 | 18 | , fContours(contours) |
michael@0 | 19 | , fAllowOpenContours(true) { |
michael@0 | 20 | init(); |
michael@0 | 21 | } |
michael@0 | 22 | |
michael@0 | 23 | SkOpEdgeBuilder(const SkPath& path, SkTArray<SkOpContour>& contours) |
michael@0 | 24 | : fPath(&path) |
michael@0 | 25 | , fContours(contours) |
michael@0 | 26 | , fAllowOpenContours(false) { |
michael@0 | 27 | init(); |
michael@0 | 28 | } |
michael@0 | 29 | |
michael@0 | 30 | void complete() { |
michael@0 | 31 | if (fCurrentContour && fCurrentContour->segments().count()) { |
michael@0 | 32 | fCurrentContour->complete(); |
michael@0 | 33 | fCurrentContour = NULL; |
michael@0 | 34 | } |
michael@0 | 35 | } |
michael@0 | 36 | |
michael@0 | 37 | SkPathOpsMask xorMask() const { |
michael@0 | 38 | return fXorMask[fOperand]; |
michael@0 | 39 | } |
michael@0 | 40 | |
michael@0 | 41 | void addOperand(const SkPath& path); |
michael@0 | 42 | bool finish(); |
michael@0 | 43 | void init(); |
michael@0 | 44 | |
michael@0 | 45 | private: |
michael@0 | 46 | void closeContour(const SkPoint& curveEnd, const SkPoint& curveStart); |
michael@0 | 47 | bool close(); |
michael@0 | 48 | int preFetch(); |
michael@0 | 49 | bool walk(); |
michael@0 | 50 | |
michael@0 | 51 | const SkPath* fPath; |
michael@0 | 52 | SkTArray<SkPoint, true> fPathPts; |
michael@0 | 53 | SkTArray<uint8_t, true> fPathVerbs; |
michael@0 | 54 | SkOpContour* fCurrentContour; |
michael@0 | 55 | SkTArray<SkOpContour>& fContours; |
michael@0 | 56 | SkPathOpsMask fXorMask[2]; |
michael@0 | 57 | int fSecondHalf; |
michael@0 | 58 | bool fOperand; |
michael@0 | 59 | bool fAllowOpenContours; |
michael@0 | 60 | bool fUnparseable; |
michael@0 | 61 | }; |
michael@0 | 62 | |
michael@0 | 63 | #endif |