gfx/skia/trunk/src/core/SkTextToPathIter.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 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
michael@0 8 #ifndef SkTextToPathIter_DEFINED
michael@0 9 #define SkTextToPathIter_DEFINED
michael@0 10
michael@0 11 #include "SkAutoKern.h"
michael@0 12 #include "SkPaint.h"
michael@0 13
michael@0 14 class SkGlyphCache;
michael@0 15
michael@0 16 class SkTextToPathIter {
michael@0 17 public:
michael@0 18 SkTextToPathIter(const char text[], size_t length, const SkPaint& paint,
michael@0 19 bool applyStrokeAndPathEffects);
michael@0 20 ~SkTextToPathIter();
michael@0 21
michael@0 22 const SkPaint& getPaint() const { return fPaint; }
michael@0 23 SkScalar getPathScale() const { return fScale; }
michael@0 24
michael@0 25 struct Rec {
michael@0 26 const SkPath* fPath; // may be null for "whitespace" glyphs
michael@0 27 SkScalar fXPos;
michael@0 28 };
michael@0 29
michael@0 30 /**
michael@0 31 * Returns false when all of the text has been consumed
michael@0 32 */
michael@0 33 bool next(const SkPath** path, SkScalar* xpos);
michael@0 34
michael@0 35 private:
michael@0 36 SkGlyphCache* fCache;
michael@0 37 SkPaint fPaint;
michael@0 38 SkScalar fScale;
michael@0 39 SkFixed fPrevAdvance;
michael@0 40 const char* fText;
michael@0 41 const char* fStop;
michael@0 42 SkMeasureCacheProc fGlyphCacheProc;
michael@0 43
michael@0 44 SkScalar fXPos; // accumulated xpos, returned in next
michael@0 45 SkAutoKern fAutoKern;
michael@0 46 int fXYIndex; // cache for horizontal -vs- vertical text
michael@0 47 };
michael@0 48
michael@0 49 #endif

mercurial