Don't update vertex/index buffer twice!
Review URL: http://codereview.appspot.com/5483053/
git-svn-id: http://skia.googlecode.com/svn/trunk@2855 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrBufferAllocPool.cpp b/src/gpu/GrBufferAllocPool.cpp
index c01192d..b06c3ad 100644
--- a/src/gpu/GrBufferAllocPool.cpp
+++ b/src/gpu/GrBufferAllocPool.cpp
@@ -320,14 +320,13 @@
GrAssert(fCpuData.get() == fBufferPtr);
GrAssert(flushSize <= buffer->sizeInBytes());
- bool updated = false;
if (fGpu->getCaps().fBufferLockSupport &&
flushSize > GR_GEOM_BUFFER_LOCK_THRESHOLD) {
void* data = buffer->lock();
if (NULL != data) {
memcpy(data, fBufferPtr, flushSize);
buffer->unlock();
- updated = true;
+ return;
}
}
buffer->updateData(fBufferPtr, flushSize);