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 2010 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 GrTextContext_DEFINED
9 #define GrTextContext_DEFINED
11 #include "GrPoint.h"
12 #include "GrGlyph.h"
13 #include "GrPaint.h"
14 #include "SkDeviceProperties.h"
16 #include "SkPostConfig.h"
18 class GrContext;
19 class GrDrawTarget;
20 class GrFontScaler;
22 /*
23 * This class wraps the state for a single text render
24 */
25 class GrTextContext {
26 public:
27 virtual ~GrTextContext() {}
28 virtual void drawText(const GrPaint&, const SkPaint&, const char text[], size_t byteLength,
29 SkScalar x, SkScalar y) = 0;
30 virtual void drawPosText(const GrPaint&, const SkPaint&,
31 const char text[], size_t byteLength,
32 const SkScalar pos[], SkScalar constY,
33 int scalarsPerPosition) = 0;
35 virtual bool canDraw(const SkPaint& paint) = 0;
37 protected:
38 GrTextContext(GrContext*, const SkDeviceProperties&);
40 static GrFontScaler* GetGrFontScaler(SkGlyphCache* cache);
41 static void MeasureText(SkGlyphCache* cache, SkDrawCacheProc glyphCacheProc,
42 const char text[], size_t byteLength, SkVector* stopVector);
44 void init(const GrPaint&, const SkPaint&);
45 void finish() { fDrawTarget = NULL; }
47 GrContext* fContext;
48 SkDeviceProperties fDeviceProperties;
50 GrDrawTarget* fDrawTarget;
51 SkIRect fClipRect;
52 GrPaint fPaint;
53 SkPaint fSkPaint;
54 };
56 #endif