| 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 #ifndef GrGLIndexBuffer_DEFINED | 8 #ifndef GrGLIndexBuffer_DEFINED |
| 9 #define GrGLIndexBuffer_DEFINED | 9 #define GrGLIndexBuffer_DEFINED |
| 10 | 10 |
| 11 #include "GrIndexBuffer.h" | 11 #include "GrIndexBuffer.h" |
| 12 #include "GrGLBufferImpl.h" | 12 #include "GrGLBufferImpl.h" |
| 13 #include "gl/GrGLInterface.h" | 13 #include "gl/GrGLInterface.h" |
| 14 | 14 |
| 15 class GrGpuGL; | 15 class GrGpuGL; |
| 16 | 16 |
| 17 class GrGLIndexBuffer : public GrIndexBuffer { | 17 class GrGLIndexBuffer : public GrIndexBuffer { |
| 18 | 18 |
| 19 public: | 19 public: |
| 20 typedef GrGLBufferImpl::Desc Desc; | 20 typedef GrGLBufferImpl::Desc Desc; |
| 21 | 21 |
| 22 GrGLIndexBuffer(GrGpuGL* gpu, const Desc& desc); | 22 GrGLIndexBuffer(GrGpuGL* gpu, const Desc& desc); |
| 23 virtual ~GrGLIndexBuffer() { this->release(); } | |
| 24 | 23 |
| 25 GrGLuint bufferID() const { return fImpl.bufferID(); } | 24 GrGLuint bufferID() const { return fImpl.bufferID(); } |
| 26 size_t baseOffset() const { return fImpl.baseOffset(); } | 25 size_t baseOffset() const { return fImpl.baseOffset(); } |
| 27 | 26 |
| 28 void bind() const { | 27 void bind() const { |
| 29 if (!this->wasDestroyed()) { | 28 if (!this->wasDestroyed()) { |
| 30 fImpl.bind(this->getGpuGL()); | 29 fImpl.bind(this->getGpuGL()); |
| 31 } | 30 } |
| 32 } | 31 } |
| 33 | 32 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 44 SkASSERT(!this->wasDestroyed()); | 43 SkASSERT(!this->wasDestroyed()); |
| 45 return (GrGpuGL*)(this->getGpu()); | 44 return (GrGpuGL*)(this->getGpu()); |
| 46 } | 45 } |
| 47 | 46 |
| 48 GrGLBufferImpl fImpl; | 47 GrGLBufferImpl fImpl; |
| 49 | 48 |
| 50 typedef GrIndexBuffer INHERITED; | 49 typedef GrIndexBuffer INHERITED; |
| 51 }; | 50 }; |
| 52 | 51 |
| 53 #endif | 52 #endif |
| OLD | NEW |