gfx/skia/trunk/src/gpu/GrTextContext.h

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

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

mercurial