Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Side by Side Diff: src/gpu/gl/GrGLStencilBuffer.cpp

Issue 251013002: Split GrResource into GrCacheable/GrGpuObject (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/gpu/gl/GrGLStencilBuffer.h ('k') | src/gpu/gl/GrGLVertexArray.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 8
9 #include "GrGLStencilBuffer.h" 9 #include "GrGLStencilBuffer.h"
10 #include "GrGpuGL.h" 10 #include "GrGpuGL.h"
11 11
12 GrGLStencilBuffer::~GrGLStencilBuffer() { 12 GrGLStencilBuffer::~GrGLStencilBuffer() {
13 this->release(); 13 this->release();
14 } 14 }
15 15
16 size_t GrGLStencilBuffer::sizeInBytes() const { 16 size_t GrGLStencilBuffer::gpuMemorySize() const {
17 uint64_t size = this->width(); 17 uint64_t size = this->width();
18 size *= this->height(); 18 size *= this->height();
19 size *= fFormat.fTotalBits; 19 size *= fFormat.fTotalBits;
20 size *= SkTMax(1,this->numSamples()); 20 size *= SkTMax(1,this->numSamples());
21 return static_cast<size_t>(size / 8); 21 return static_cast<size_t>(size / 8);
22 } 22 }
23 23
24 void GrGLStencilBuffer::onRelease() { 24 void GrGLStencilBuffer::onRelease() {
25 if (0 != fRenderbufferID && !this->isWrapped()) { 25 if (0 != fRenderbufferID && !this->isWrapped()) {
26 GrGpuGL* gpuGL = (GrGpuGL*) this->getGpu(); 26 GrGpuGL* gpuGL = (GrGpuGL*) this->getGpu();
27 const GrGLInterface* gl = gpuGL->glInterface(); 27 const GrGLInterface* gl = gpuGL->glInterface();
28 GR_GL_CALL(gl, DeleteRenderbuffers(1, &fRenderbufferID)); 28 GR_GL_CALL(gl, DeleteRenderbuffers(1, &fRenderbufferID));
29 fRenderbufferID = 0; 29 fRenderbufferID = 0;
30 } 30 }
31 31
32 INHERITED::onRelease(); 32 INHERITED::onRelease();
33 } 33 }
34 34
35 void GrGLStencilBuffer::onAbandon() { 35 void GrGLStencilBuffer::onAbandon() {
36 fRenderbufferID = 0; 36 fRenderbufferID = 0;
37 37
38 INHERITED::onAbandon(); 38 INHERITED::onAbandon();
39 } 39 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLStencilBuffer.h ('k') | src/gpu/gl/GrGLVertexArray.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698