OLD | NEW |
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 "GrGLGpu.h" | 9 #include "GrGLGpu.h" |
10 #include "SkTraceMemoryDump.h" | 10 #include "SkTraceMemoryDump.h" |
11 | 11 |
12 GrGLVertexBuffer::GrGLVertexBuffer(GrGLGpu* gpu, const Desc& desc) | 12 GrGLVertexBuffer::GrGLVertexBuffer(GrGLGpu* gpu, const Desc& desc) |
13 : INHERITED(gpu, desc.fSizeInBytes, GrGLBufferImpl::kDynamicDraw_Usage == de
sc.fUsage, | 13 : INHERITED(gpu, desc.fSizeInBytes, desc.fDynamic, 0 == desc.fID) |
14 0 == desc.fID) | |
15 , fImpl(gpu, desc, GR_GL_ARRAY_BUFFER) { | 14 , fImpl(gpu, desc, GR_GL_ARRAY_BUFFER) { |
16 this->registerWithCache(); | 15 this->registerWithCache(); |
17 } | 16 } |
18 | 17 |
19 void GrGLVertexBuffer::onRelease() { | 18 void GrGLVertexBuffer::onRelease() { |
20 if (!this->wasDestroyed()) { | 19 if (!this->wasDestroyed()) { |
21 fImpl.release(this->getGpuGL()); | 20 fImpl.release(this->getGpuGL()); |
22 } | 21 } |
23 | 22 |
24 INHERITED::onRelease(); | 23 INHERITED::onRelease(); |
(...skipping 26 matching lines...) Expand all Loading... |
51 } | 50 } |
52 } | 51 } |
53 | 52 |
54 void GrGLVertexBuffer::setMemoryBacking(SkTraceMemoryDump* traceMemoryDump, | 53 void GrGLVertexBuffer::setMemoryBacking(SkTraceMemoryDump* traceMemoryDump, |
55 const SkString& dumpName) const { | 54 const SkString& dumpName) const { |
56 SkString buffer_id; | 55 SkString buffer_id; |
57 buffer_id.appendU32(this->bufferID()); | 56 buffer_id.appendU32(this->bufferID()); |
58 traceMemoryDump->setMemoryBacking(dumpName.c_str(), "gl_buffer", | 57 traceMemoryDump->setMemoryBacking(dumpName.c_str(), "gl_buffer", |
59 buffer_id.c_str()); | 58 buffer_id.c_str()); |
60 } | 59 } |
OLD | NEW |