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 2013 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 | |
michael@0 | 8 | #ifndef GrBitmapTextContext_DEFINED |
michael@0 | 9 | #define GrBitmapTextContext_DEFINED |
michael@0 | 10 | |
michael@0 | 11 | #include "GrTextContext.h" |
michael@0 | 12 | |
michael@0 | 13 | class GrTextStrike; |
michael@0 | 14 | |
michael@0 | 15 | /* |
michael@0 | 16 | * This class implements GrTextContext using standard bitmap fonts |
michael@0 | 17 | */ |
michael@0 | 18 | class GrBitmapTextContext : public GrTextContext { |
michael@0 | 19 | public: |
michael@0 | 20 | GrBitmapTextContext(GrContext*, const SkDeviceProperties&); |
michael@0 | 21 | virtual ~GrBitmapTextContext(); |
michael@0 | 22 | |
michael@0 | 23 | virtual void drawText(const GrPaint&, const SkPaint&, const char text[], size_t byteLength, |
michael@0 | 24 | SkScalar x, SkScalar y) SK_OVERRIDE; |
michael@0 | 25 | virtual void drawPosText(const GrPaint&, const SkPaint&, |
michael@0 | 26 | const char text[], size_t byteLength, |
michael@0 | 27 | const SkScalar pos[], SkScalar constY, |
michael@0 | 28 | int scalarsPerPosition) SK_OVERRIDE; |
michael@0 | 29 | |
michael@0 | 30 | virtual bool canDraw(const SkPaint& paint) SK_OVERRIDE; |
michael@0 | 31 | |
michael@0 | 32 | private: |
michael@0 | 33 | GrTextStrike* fStrike; |
michael@0 | 34 | |
michael@0 | 35 | void init(const GrPaint&, const SkPaint&); |
michael@0 | 36 | void drawPackedGlyph(GrGlyph::PackedID, GrFixed left, GrFixed top, GrFontScaler*); |
michael@0 | 37 | void flushGlyphs(); // automatically called by destructor |
michael@0 | 38 | void finish(); |
michael@0 | 39 | |
michael@0 | 40 | enum { |
michael@0 | 41 | kMinRequestedGlyphs = 1, |
michael@0 | 42 | kDefaultRequestedGlyphs = 64, |
michael@0 | 43 | kMinRequestedVerts = kMinRequestedGlyphs * 4, |
michael@0 | 44 | kDefaultRequestedVerts = kDefaultRequestedGlyphs * 4, |
michael@0 | 45 | }; |
michael@0 | 46 | |
michael@0 | 47 | SkPoint* fVertices; |
michael@0 | 48 | int32_t fMaxVertices; |
michael@0 | 49 | GrTexture* fCurrTexture; |
michael@0 | 50 | int fCurrVertex; |
michael@0 | 51 | SkRect fVertexBounds; |
michael@0 | 52 | }; |
michael@0 | 53 | |
michael@0 | 54 | #endif |