| 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 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 GrGLuint bufferID() const { return fImpl.bufferID(); } | 25 GrGLuint bufferID() const { return fImpl.bufferID(); } |
| 26 size_t baseOffset() const { return fImpl.baseOffset(); } | 26 size_t baseOffset() const { return fImpl.baseOffset(); } |
| 27 | 27 |
| 28 void bind() const { | 28 void bind() const { |
| 29 if (!this->wasDestroyed()) { | 29 if (!this->wasDestroyed()) { |
| 30 fImpl.bind(this->getGpuGL()); | 30 fImpl.bind(this->getGpuGL()); |
| 31 } | 31 } |
| 32 } | 32 } |
| 33 | 33 |
| 34 // overrides of GrIndexBuffer | |
| 35 virtual void* map() SK_OVERRIDE; | |
| 36 virtual void* mapPtr() const SK_OVERRIDE; | |
| 37 virtual void unmap() SK_OVERRIDE; | |
| 38 virtual bool isMapped() const SK_OVERRIDE; | |
| 39 virtual bool updateData(const void* src, size_t srcSizeInBytes); | |
| 40 | |
| 41 protected: | 34 protected: |
| 42 // overrides of GrResource | |
| 43 virtual void onAbandon() SK_OVERRIDE; | 35 virtual void onAbandon() SK_OVERRIDE; |
| 44 virtual void onRelease() SK_OVERRIDE; | 36 virtual void onRelease() SK_OVERRIDE; |
| 45 | 37 |
| 46 private: | 38 private: |
| 39 virtual void* onMap() SK_OVERRIDE; |
| 40 virtual void onUnmap() SK_OVERRIDE; |
| 41 virtual bool onUpdateData(const void* src, size_t srcSizeInBytes) SK_OVERRID
E; |
| 42 |
| 47 GrGpuGL* getGpuGL() const { | 43 GrGpuGL* getGpuGL() const { |
| 48 SkASSERT(!this->wasDestroyed()); | 44 SkASSERT(!this->wasDestroyed()); |
| 49 return (GrGpuGL*)(this->getGpu()); | 45 return (GrGpuGL*)(this->getGpu()); |
| 50 } | 46 } |
| 51 | 47 |
| 52 GrGLBufferImpl fImpl; | 48 GrGLBufferImpl fImpl; |
| 53 | 49 |
| 54 typedef GrIndexBuffer INHERITED; | 50 typedef GrIndexBuffer INHERITED; |
| 55 }; | 51 }; |
| 56 | 52 |
| 57 #endif | 53 #endif |
| OLD | NEW |