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

mercurial