diff options
author | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-04-16 16:24:35 +0000 |
---|---|---|
committer | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-04-16 16:24:35 +0000 |
commit | 0dd84a399ae8903784eac1c361c08449f822307f (patch) | |
tree | 18ce74bcc7e823ffacbc23c6601d18d2f745920a /src/gpu/gl/debug/GrBufferObj.cpp | |
parent | 6853e808a464ca75ff1328338d1eb55ff27c4337 (diff) |
Minor code cleanup of Debug GL Interface
http://codereview.appspot.com/6032043/
git-svn-id: http://skia.googlecode.com/svn/trunk@3690 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/gl/debug/GrBufferObj.cpp')
-rw-r--r-- | src/gpu/gl/debug/GrBufferObj.cpp | 22 |
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(); +} |