gfx/skia/trunk/src/core/SkEdgeBuilder.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.

     2 /*
     3  * Copyright 2011 Google Inc.
     4  *
     5  * Use of this source code is governed by a BSD-style license that can be
     6  * found in the LICENSE file.
     7  */
     8 #ifndef SkEdgeBuilder_DEFINED
     9 #define SkEdgeBuilder_DEFINED
    11 #include "SkChunkAlloc.h"
    12 #include "SkRect.h"
    13 #include "SkTDArray.h"
    15 struct SkEdge;
    16 class SkEdgeClipper;
    17 class SkPath;
    19 class SkEdgeBuilder {
    20 public:
    21     SkEdgeBuilder();
    23     // returns the number of built edges. The array of those edge pointers
    24     // is returned from edgeList().
    25     int build(const SkPath& path, const SkIRect* clip, int shiftUp);
    27     SkEdge** edgeList() { return fEdgeList; }
    29 private:
    30     SkChunkAlloc        fAlloc;
    31     SkTDArray<SkEdge*>  fList;
    33     /*
    34      *  If we're in general mode, we allcoate the pointers in fList, and this
    35      *  will point at fList.begin(). If we're in polygon mode, fList will be
    36      *  empty, as we will have preallocated room for the pointers in fAlloc's
    37      *  block, and fEdgeList will point into that.
    38      */
    39     SkEdge**            fEdgeList;
    41     int                 fShiftUp;
    43 public:
    44     void addLine(const SkPoint pts[]);
    45     void addQuad(const SkPoint pts[]);
    46     void addCubic(const SkPoint pts[]);
    47     void addClipper(SkEdgeClipper*);
    49     int buildPoly(const SkPath& path, const SkIRect* clip, int shiftUp);
    50 };
    52 #endif

mercurial