gfx/skia/trunk/src/gpu/gl/GrGLIndexBuffer.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  */
     8 #ifndef GrGLIndexBuffer_DEFINED
     9 #define GrGLIndexBuffer_DEFINED
    11 #include "GrIndexBuffer.h"
    12 #include "GrGLBufferImpl.h"
    13 #include "gl/GrGLInterface.h"
    15 class GrGpuGL;
    17 class GrGLIndexBuffer : public GrIndexBuffer {
    19 public:
    20     typedef GrGLBufferImpl::Desc Desc;
    22     GrGLIndexBuffer(GrGpuGL* gpu, const Desc& desc);
    23     virtual ~GrGLIndexBuffer() { this->release(); }
    25     GrGLuint bufferID() const { return fImpl.bufferID(); }
    26     size_t baseOffset() const { return fImpl.baseOffset(); }
    28     void bind() const {
    29         if (this->isValid()) {
    30             fImpl.bind(this->getGpuGL());
    31         }
    32     }
    34     // overrides of GrIndexBuffer
    35     virtual void* lock();
    36     virtual void* lockPtr() const;
    37     virtual void unlock();
    38     virtual bool isLocked() const;
    39     virtual bool updateData(const void* src, size_t srcSizeInBytes);
    41 protected:
    42     // overrides of GrResource
    43     virtual void onAbandon() SK_OVERRIDE;
    44     virtual void onRelease() SK_OVERRIDE;
    46 private:
    47     GrGpuGL* getGpuGL() const {
    48         SkASSERT(this->isValid());
    49         return (GrGpuGL*)(this->getGpu());
    50     }
    52     GrGLBufferImpl fImpl;
    54     typedef GrIndexBuffer INHERITED;
    55 };
    57 #endif

mercurial