Delay creation of cpu-side buffer memory until actually needed
authorrobertphillips <robertphillips@google.com>
Thu, 18 Aug 2016 21:01:14 +0000 (14:01 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 18 Aug 2016 21:01:14 +0000 (14:01 -0700)
IIUC what is going on, this won't really do anything bad but will defer allocation of the cpu-side buffer until it is actually needed.

BUG=635015
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2248283007

Review-Url: https://codereview.chromium.org/2248283007

src/gpu/GrBufferAllocPool.cpp

index bb73a10..e3f30b0 100644 (file)
@@ -78,10 +78,7 @@ void GrBufferAllocPool::reset() {
     VALIDATE();
     fBytesInUse = 0;
     this->deleteBlocks();
-
-    // we may have created a large cpu mirror of a large VB. Reset the size to match our minimum.
-    this->resetCpuData(fMinBlockSize);
-
+    this->resetCpuData(0);      // delete all the cpu-side memory
     VALIDATE();
 }