diff options
Diffstat (limited to 'gpu/include/GrGLIndexBuffer.h')
-rw-r--r-- | gpu/include/GrGLIndexBuffer.h | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/gpu/include/GrGLIndexBuffer.h b/gpu/include/GrGLIndexBuffer.h index 5755c07..3565059 100644 --- a/gpu/include/GrGLIndexBuffer.h +++ b/gpu/include/GrGLIndexBuffer.h @@ -1,5 +1,5 @@ /* - Copyright 2010 Google Inc. + Copyright 2011 Google Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -19,38 +19,43 @@ #define GrGLIndexBuffer_DEFINED #include "GrIndexBuffer.h" -#include "GrGLConfig.h" +#include "GrGLInterface.h" class GrGpuGL; class GrGLIndexBuffer : public GrIndexBuffer { -protected: - GrGLIndexBuffer(GLuint id, - GrGpuGL* gl, - size_t sizeInBytes, - bool dynamic); + public: - virtual ~GrGLIndexBuffer(); - GLuint bufferID() const; + virtual ~GrGLIndexBuffer() { this->release(); } + + GrGLuint bufferID() const; // overrides of GrIndexBuffer - virtual void abandon(); virtual void* lock(); virtual void* lockPtr() const; virtual void unlock(); virtual bool isLocked() const; virtual bool updateData(const void* src, size_t srcSizeInBytes); - virtual bool updateSubData(const void* src, - size_t srcSizeInBytes, + virtual bool updateSubData(const void* src, + size_t srcSizeInBytes, size_t offset); +protected: + GrGLIndexBuffer(GrGpuGL* gpu, + GrGLuint id, + size_t sizeInBytes, + bool dynamic); + + // overrides of GrResource + virtual void onAbandon(); + virtual void onRelease(); + private: void bind() const; - - GrGpuGL* fGL; - GLuint fBufferID; + + GrGLuint fBufferID; void* fLockPtr; - + friend class GrGpuGL; typedef GrIndexBuffer INHERITED; |