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.
1 /*
2 * Copyright 2012 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
8 #ifndef SkTextToPathIter_DEFINED
9 #define SkTextToPathIter_DEFINED
11 #include "SkAutoKern.h"
12 #include "SkPaint.h"
14 class SkGlyphCache;
16 class SkTextToPathIter {
17 public:
18 SkTextToPathIter(const char text[], size_t length, const SkPaint& paint,
19 bool applyStrokeAndPathEffects);
20 ~SkTextToPathIter();
22 const SkPaint& getPaint() const { return fPaint; }
23 SkScalar getPathScale() const { return fScale; }
25 struct Rec {
26 const SkPath* fPath; // may be null for "whitespace" glyphs
27 SkScalar fXPos;
28 };
30 /**
31 * Returns false when all of the text has been consumed
32 */
33 bool next(const SkPath** path, SkScalar* xpos);
35 private:
36 SkGlyphCache* fCache;
37 SkPaint fPaint;
38 SkScalar fScale;
39 SkFixed fPrevAdvance;
40 const char* fText;
41 const char* fStop;
42 SkMeasureCacheProc fGlyphCacheProc;
44 SkScalar fXPos; // accumulated xpos, returned in next
45 SkAutoKern fAutoKern;
46 int fXYIndex; // cache for horizontal -vs- vertical text
47 };
49 #endif