aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/debug/GrBufferObj.cpp
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-04-16 16:24:35 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-04-16 16:24:35 +0000
commit0dd84a399ae8903784eac1c361c08449f822307f (patch)
tree18ce74bcc7e823ffacbc23c6601d18d2f745920a /src/gpu/gl/debug/GrBufferObj.cpp
parent6853e808a464ca75ff1328338d1eb55ff27c4337 (diff)
Minor code cleanup of Debug GL Interface
Diffstat (limited to 'src/gpu/gl/debug/GrBufferObj.cpp')
-rw-r--r--src/gpu/gl/debug/GrBufferObj.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/gpu/gl/debug/GrBufferObj.cpp b/src/gpu/gl/debug/GrBufferObj.cpp
index 0cd4fc8068..7d605ebef1 100644
--- a/src/gpu/gl/debug/GrBufferObj.cpp
+++ b/src/gpu/gl/debug/GrBufferObj.cpp
@@ -7,3 +7,25 @@
*/
#include "GrBufferObj.h"
+
+void GrBufferObj::allocate(GrGLint size, const GrGLchar *dataPtr) {
+ GrAlwaysAssert(size >= 0);
+
+ // delete pre-existing data
+ delete[] fDataPtr;
+
+ fSize = size;
+ fDataPtr = new GrGLchar[size];
+ if (dataPtr) {
+ memcpy(fDataPtr, dataPtr, fSize);
+ }
+ // TODO: w/ no dataPtr the data is unitialized - this could be tracked
+}
+
+void GrBufferObj::deleteAction() {
+
+ // buffers are automatically unmapped when deleted
+ this->resetMapped();
+
+ this->INHERITED::deleteAction();
+}