Refactor how Gr handles vertex and index data. GrGpu and GrInOrderDrawBuffer both GrBufferAllocPool to manage reserved and set-to-array vertex and index data.
rietveld issue 4188049
git-svn-id: http://skia.googlecode.com/svn/trunk@786 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/include/GrGLIndexBuffer.h b/gpu/include/GrGLIndexBuffer.h
index 5177b4b..5755c07 100644
--- a/gpu/include/GrGLIndexBuffer.h
+++ b/gpu/include/GrGLIndexBuffer.h
@@ -27,7 +27,7 @@
protected:
GrGLIndexBuffer(GLuint id,
GrGpuGL* gl,
- uint32_t sizeInBytes,
+ size_t sizeInBytes,
bool dynamic);
public:
virtual ~GrGLIndexBuffer();
@@ -37,10 +37,16 @@
// 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, uint32_t srcSizeInBytes);
+ virtual bool updateData(const void* src, size_t srcSizeInBytes);
+ virtual bool updateSubData(const void* src,
+ size_t srcSizeInBytes,
+ size_t offset);
private:
+ void bind() const;
+
GrGpuGL* fGL;
GLuint fBufferID;
void* fLockPtr;