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