gfx/skia/trunk/src/gpu/gl/GrGLVertexBuffer.cpp

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 #include "GrGLVertexBuffer.h"
     9 #include "GrGpuGL.h"
    11 GrGLVertexBuffer::GrGLVertexBuffer(GrGpuGL* gpu, const Desc& desc)
    12     : INHERITED(gpu, desc.fIsWrapped, desc.fSizeInBytes, desc.fDynamic, 0 == desc.fID)
    13     , fImpl(gpu, desc, GR_GL_ARRAY_BUFFER) {
    14 }
    16 void GrGLVertexBuffer::onRelease() {
    17     if (this->isValid()) {
    18         fImpl.release(this->getGpuGL());
    19     }
    21     INHERITED::onRelease();
    22 }
    25 void GrGLVertexBuffer::onAbandon() {
    26     fImpl.abandon();
    27     INHERITED::onAbandon();
    28 }
    30 void* GrGLVertexBuffer::lock() {
    31     if (this->isValid()) {
    32         return fImpl.lock(this->getGpuGL());
    33     } else {
    34         return NULL;
    35     }
    36 }
    38 void* GrGLVertexBuffer::lockPtr() const {
    39     return fImpl.lockPtr();
    40 }
    42 void GrGLVertexBuffer::unlock() {
    43     if (this->isValid()) {
    44         fImpl.unlock(this->getGpuGL());
    45     }
    46 }
    48 bool GrGLVertexBuffer::isLocked() const {
    49     return fImpl.isLocked();
    50 }
    52 bool GrGLVertexBuffer::updateData(const void* src, size_t srcSizeInBytes) {
    53     if (this->isValid()) {
    54         return fImpl.updateData(this->getGpuGL(), src, srcSizeInBytes);
    55     } else {
    56         return false;
    57     }
    58 }

mercurial