| OLD | NEW |
| (Empty) |
| 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 */ | |
| 7 | |
| 8 | |
| 9 #include "GrGLStencilBuffer.h" | |
| 10 #include "GrGLGpu.h" | |
| 11 | |
| 12 size_t GrGLStencilBuffer::onGpuMemorySize() const { | |
| 13 uint64_t size = this->width(); | |
| 14 size *= this->height(); | |
| 15 size *= fFormat.fTotalBits; | |
| 16 size *= SkTMax(1,this->numSamples()); | |
| 17 return static_cast<size_t>(size / 8); | |
| 18 } | |
| 19 | |
| 20 void GrGLStencilBuffer::onRelease() { | |
| 21 if (0 != fRenderbufferID && !this->isWrapped()) { | |
| 22 GrGLGpu* gpuGL = (GrGLGpu*) this->getGpu(); | |
| 23 const GrGLInterface* gl = gpuGL->glInterface(); | |
| 24 GR_GL_CALL(gl, DeleteRenderbuffers(1, &fRenderbufferID)); | |
| 25 fRenderbufferID = 0; | |
| 26 } | |
| 27 | |
| 28 INHERITED::onRelease(); | |
| 29 } | |
| 30 | |
| 31 void GrGLStencilBuffer::onAbandon() { | |
| 32 fRenderbufferID = 0; | |
| 33 | |
| 34 INHERITED::onAbandon(); | |
| 35 } | |
| OLD | NEW |