Don't pre-allocate GrTextBlobCache space
Let the pool handle the initial allocation on first use.
Change-Id: I77e0a84f19ccefa0c3bf298483929345787c0d7e
Reviewed-on: https://skia-review.googlesource.com/22078
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Eric Karl <ericrk@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
diff --git a/src/gpu/text/GrTextBlobCache.h b/src/gpu/text/GrTextBlobCache.h
index 87a3751..b294534 100644
--- a/src/gpu/text/GrTextBlobCache.h
+++ b/src/gpu/text/GrTextBlobCache.h
@@ -24,7 +24,7 @@
typedef void (*PFOverBudgetCB)(void* data);
GrTextBlobCache(PFOverBudgetCB cb, void* data)
- : fPool(kPreAllocSize, kMinGrowthSize)
+ : fPool(0u, kMinGrowthSize)
, fCallback(cb)
, fData(data)
, fBudget(kDefaultBudget) {
@@ -216,10 +216,7 @@
}
}
- // Budget was chosen to be ~4 megabytes. The min alloc and pre alloc sizes in the pool are
- // based off of the largest cached textblob I have seen in the skps(a couple of kilobytes).
- static const int kPreAllocSize = 1 << 17;
- static const int kMinGrowthSize = 1 << 17;
+ static const int kMinGrowthSize = 1 << 16;
static const int kDefaultBudget = 1 << 22;
GrMemoryPool fPool;
BitmapBlobList fBlobList;