aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrGLVertexBuffer.h
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-10-12 19:53:16 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-10-12 19:53:16 +0000
commitd38f137e9b813f8193675ebd3dfbfe8bc42639e9 (patch)
tree1e670c378d7b31a4538fde3c2b3e4e29b72c05b5 /src/gpu/GrGLVertexBuffer.h
parent4d5cb45f3e3e62633304b4911d131cdd02dfd541 (diff)
Move gpu/include/* to include/gpu and gpu/src/* to src/gpu
Review URL: http://codereview.appspot.com/5250070/ git-svn-id: http://skia.googlecode.com/svn/trunk@2471 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/GrGLVertexBuffer.h')
-rw-r--r--src/gpu/GrGLVertexBuffer.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/gpu/GrGLVertexBuffer.h b/src/gpu/GrGLVertexBuffer.h
new file mode 100644
index 0000000000..15fc54a983
--- /dev/null
+++ b/src/gpu/GrGLVertexBuffer.h
@@ -0,0 +1,52 @@
+
+/*
+ * Copyright 2011 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+
+
+#ifndef GrGLVertexBuffer_DEFINED
+#define GrGLVertexBuffer_DEFINED
+
+#include "GrVertexBuffer.h"
+#include "GrGLInterface.h"
+
+class GrGpuGL;
+
+class GrGLVertexBuffer : public GrVertexBuffer {
+
+public:
+ virtual ~GrGLVertexBuffer() { this->release(); }
+ // overrides of GrVertexBuffer
+ virtual void* lock();
+ virtual void* lockPtr() const;
+ virtual void unlock();
+ virtual bool isLocked() const;
+ virtual bool updateData(const void* src, size_t srcSizeInBytes);
+ GrGLuint bufferID() const;
+
+protected:
+ GrGLVertexBuffer(GrGpuGL* gpu,
+ GrGLuint id,
+ size_t sizeInBytes,
+ bool dynamic);
+
+ // overrides of GrResource
+ virtual void onAbandon();
+ virtual void onRelease();
+
+private:
+ void bind() const;
+
+ GrGLuint fBufferID;
+ void* fLockPtr;
+
+ friend class GrGpuGL;
+
+ typedef GrVertexBuffer INHERITED;
+};
+
+#endif