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

Side by Side Diff: src/gpu/gl/GrGLVertexBuffer.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/GrGLVertexBuffer.h ('k') | src/gpu/gl/GrGpuGL.cpp » ('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 #include "GrGLVertexBuffer.h" 8 #include "GrGLVertexBuffer.h"
9 #include "GrGpuGL.h" 9 #include "GrGpuGL.h"
10 10
11 GrGLVertexBuffer::GrGLVertexBuffer(GrGpuGL* gpu, const Desc& desc) 11 GrGLVertexBuffer::GrGLVertexBuffer(GrGpuGL* gpu, const Desc& desc)
12 : INHERITED(gpu, desc.fIsWrapped, desc.fSizeInBytes, desc.fDynamic, 0 == des c.fID) 12 : INHERITED(gpu, desc.fIsWrapped, desc.fSizeInBytes, desc.fDynamic, 0 == des c.fID)
13 , fImpl(gpu, desc, GR_GL_ARRAY_BUFFER) { 13 , fImpl(gpu, desc, GR_GL_ARRAY_BUFFER) {
14 } 14 }
15 15
16 void GrGLVertexBuffer::onRelease() { 16 void GrGLVertexBuffer::onRelease() {
17 if (this->isValid()) { 17 if (!this->wasDestroyed()) {
18 fImpl.release(this->getGpuGL()); 18 fImpl.release(this->getGpuGL());
19 } 19 }
20 20
21 INHERITED::onRelease(); 21 INHERITED::onRelease();
22 } 22 }
23 23
24 24
25 void GrGLVertexBuffer::onAbandon() { 25 void GrGLVertexBuffer::onAbandon() {
26 fImpl.abandon(); 26 fImpl.abandon();
27 INHERITED::onAbandon(); 27 INHERITED::onAbandon();
28 } 28 }
29 29
30 void* GrGLVertexBuffer::lock() { 30 void* GrGLVertexBuffer::lock() {
31 if (this->isValid()) { 31 if (!this->wasDestroyed()) {
32 return fImpl.lock(this->getGpuGL()); 32 return fImpl.lock(this->getGpuGL());
33 } else { 33 } else {
34 return NULL; 34 return NULL;
35 } 35 }
36 } 36 }
37 37
38 void* GrGLVertexBuffer::lockPtr() const { 38 void* GrGLVertexBuffer::lockPtr() const {
39 return fImpl.lockPtr(); 39 return fImpl.lockPtr();
40 } 40 }
41 41
42 void GrGLVertexBuffer::unlock() { 42 void GrGLVertexBuffer::unlock() {
43 if (this->isValid()) { 43 if (!this->wasDestroyed()) {
44 fImpl.unlock(this->getGpuGL()); 44 fImpl.unlock(this->getGpuGL());
45 } 45 }
46 } 46 }
47 47
48 bool GrGLVertexBuffer::isLocked() const { 48 bool GrGLVertexBuffer::isLocked() const {
49 return fImpl.isLocked(); 49 return fImpl.isLocked();
50 } 50 }
51 51
52 bool GrGLVertexBuffer::updateData(const void* src, size_t srcSizeInBytes) { 52 bool GrGLVertexBuffer::updateData(const void* src, size_t srcSizeInBytes) {
53 if (this->isValid()) { 53 if (!this->wasDestroyed()) {
54 return fImpl.updateData(this->getGpuGL(), src, srcSizeInBytes); 54 return fImpl.updateData(this->getGpuGL(), src, srcSizeInBytes);
55 } else { 55 } else {
56 return false; 56 return false;
57 } 57 }
58 } 58 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLVertexBuffer.h ('k') | src/gpu/gl/GrGpuGL.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698