gfx/skia/trunk/src/gpu/gl/GrGLStencilBuffer.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 2011 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  */
     9 #ifndef GrGLStencilBuffer_DEFINED
    10 #define GrGLStencilBuffer_DEFINED
    12 #include "gl/GrGLInterface.h"
    13 #include "GrStencilBuffer.h"
    15 class GrGLStencilBuffer : public GrStencilBuffer {
    16 public:
    17     static const GrGLenum kUnknownInternalFormat = ~0U;
    18     static const GrGLuint kUnknownBitCount = ~0U;
    19     struct Format {
    20         GrGLenum  fInternalFormat;
    21         GrGLuint  fStencilBits;
    22         GrGLuint  fTotalBits;
    23         bool      fPacked;
    24     };
    26     GrGLStencilBuffer(GrGpu* gpu,
    27                       bool isWrapped,
    28                       GrGLint rbid,
    29                       int width, int height,
    30                       int sampleCnt,
    31                       const Format& format)
    32         : GrStencilBuffer(gpu, isWrapped, width, height, format.fStencilBits, sampleCnt)
    33         , fFormat(format)
    34         , fRenderbufferID(rbid) {
    35     }
    37     virtual ~GrGLStencilBuffer();
    39     virtual size_t sizeInBytes() const SK_OVERRIDE;
    41     GrGLuint renderbufferID() const {
    42         return fRenderbufferID;
    43     }
    45     const Format& format() const { return fFormat; }
    47 protected:
    48     // overrides of GrResource
    49     virtual void onRelease() SK_OVERRIDE;
    50     virtual void onAbandon() SK_OVERRIDE;
    52 private:
    53     Format fFormat;
    54     // may be zero for external SBs associated with external RTs
    55     // (we don't require the client to give us the id, just tell
    56     // us how many bits of stencil there are).
    57     GrGLuint fRenderbufferID;
    59     typedef GrStencilBuffer INHERITED;
    60 };
    62 #endif

mercurial