Some cleanup in GrTextureProvider and GrResourceProvider.
Review URL: https://codereview.chromium.org/1261643004
diff --git a/src/gpu/GrVertexBuffer.h b/src/gpu/GrVertexBuffer.h
index 3c12cd7..3c62cd6 100644
--- a/src/gpu/GrVertexBuffer.h
+++ b/src/gpu/GrVertexBuffer.h
@@ -27,9 +27,12 @@
protected:
GrVertexBuffer(GrGpu* gpu, size_t gpuMemorySize, bool dynamic, bool cpuBacked)
: INHERITED(gpu, gpuMemorySize, dynamic, cpuBacked) {
- GrScratchKey key;
- ComputeScratchKey(gpuMemorySize, dynamic, &key);
- this->setScratchKey(key);
+ // We currently only make buffers scratch if they're both pow2 sized and not cpuBacked.
+ if (!cpuBacked && SkIsPow2(gpuMemorySize)) {
+ GrScratchKey key;
+ ComputeScratchKey(gpuMemorySize, dynamic, &key);
+ this->setScratchKey(key);
+ }
}
private: