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.

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

mercurial