aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrIndexBuffer.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/GrIndexBuffer.h')
-rw-r--r--src/gpu/GrIndexBuffer.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gpu/GrIndexBuffer.h b/src/gpu/GrIndexBuffer.h
index bf64ff87d2..2e3b437adf 100644
--- a/src/gpu/GrIndexBuffer.h
+++ b/src/gpu/GrIndexBuffer.h
@@ -36,9 +36,12 @@ public:
protected:
GrIndexBuffer(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: