gfx/skia/trunk/src/core/SkStroke.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 2006 The Android Open Source Project
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 SkStroke_DEFINED
michael@0 9 #define SkStroke_DEFINED
michael@0 10
michael@0 11 #include "SkPath.h"
michael@0 12 #include "SkPoint.h"
michael@0 13 #include "SkPaint.h"
michael@0 14
michael@0 15 /** \class SkStroke
michael@0 16 SkStroke is the utility class that constructs paths by stroking
michael@0 17 geometries (lines, rects, ovals, roundrects, paths). This is
michael@0 18 invoked when a geometry or text is drawn in a canvas with the
michael@0 19 kStroke_Mask bit set in the paint.
michael@0 20 */
michael@0 21 class SkStroke {
michael@0 22 public:
michael@0 23 SkStroke();
michael@0 24 SkStroke(const SkPaint&);
michael@0 25 SkStroke(const SkPaint&, SkScalar width); // width overrides paint.getStrokeWidth()
michael@0 26
michael@0 27 SkPaint::Cap getCap() const { return (SkPaint::Cap)fCap; }
michael@0 28 void setCap(SkPaint::Cap);
michael@0 29
michael@0 30 SkPaint::Join getJoin() const { return (SkPaint::Join)fJoin; }
michael@0 31 void setJoin(SkPaint::Join);
michael@0 32
michael@0 33 void setMiterLimit(SkScalar);
michael@0 34 void setWidth(SkScalar);
michael@0 35
michael@0 36 bool getDoFill() const { return SkToBool(fDoFill); }
michael@0 37 void setDoFill(bool doFill) { fDoFill = SkToU8(doFill); }
michael@0 38
michael@0 39 /**
michael@0 40 * Stroke the specified rect, winding it in the specified direction..
michael@0 41 */
michael@0 42 void strokeRect(const SkRect& rect, SkPath* result,
michael@0 43 SkPath::Direction = SkPath::kCW_Direction) const;
michael@0 44 void strokePath(const SkPath& path, SkPath*) const;
michael@0 45
michael@0 46 ////////////////////////////////////////////////////////////////
michael@0 47
michael@0 48 private:
michael@0 49 SkScalar fWidth, fMiterLimit;
michael@0 50 uint8_t fCap, fJoin;
michael@0 51 SkBool8 fDoFill;
michael@0 52
michael@0 53 friend class SkPaint;
michael@0 54 };
michael@0 55
michael@0 56 #endif

mercurial