gfx/skia/trunk/include/gpu/GrClipData.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 2010 Google Inc.
     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 GrClip_DEFINED
     9 #define GrClip_DEFINED
    11 #include "SkClipStack.h"
    13 class GrSurface;
    14 struct SkIRect;
    16 /**
    17  * GrClipData encapsulates the information required to construct the clip
    18  * masks. 'fOrigin' is only non-zero when saveLayer has been called
    19  * with an offset bounding box. The clips in 'fClipStack' are in
    20  * device coordinates (i.e., they have been translated by -fOrigin w.r.t.
    21  * the canvas' device coordinates).
    22  */
    23 class GrClipData : public SkNoncopyable {
    24 public:
    25     const SkClipStack*  fClipStack;
    26     SkIPoint            fOrigin;
    28     GrClipData()
    29         : fClipStack(NULL) {
    30         fOrigin.setZero();
    31     }
    33     bool operator==(const GrClipData& other) const {
    34         if (fOrigin != other.fOrigin) {
    35             return false;
    36         }
    38         if (NULL != fClipStack && NULL != other.fClipStack) {
    39             return *fClipStack == *other.fClipStack;
    40         }
    42         return fClipStack == other.fClipStack;
    43     }
    45     bool operator!=(const GrClipData& other) const {
    46         return !(*this == other);
    47     }
    49     void getConservativeBounds(const GrSurface* surface,
    50                                SkIRect* devResult,
    51                                bool* isIntersectionOfRects = NULL) const;
    52 };
    54 #endif

mercurial