aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrVertexBuffer.h
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2015-07-31 13:59:30 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-07-31 13:59:31 -0700
commiteae6200acbec2255ac00ab363ffbe16758ec9076 (patch)
treea37be1fb02820c40d0ad99366b557997d6b78831 /src/gpu/GrVertexBuffer.h
parent77d89f7dd243a17452d3a5f16a98622993e6bdd9 (diff)
Some cleanup in GrTextureProvider and GrResourceProvider.
Diffstat (limited to 'src/gpu/GrVertexBuffer.h')
-rw-r--r--src/gpu/GrVertexBuffer.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gpu/GrVertexBuffer.h b/src/gpu/GrVertexBuffer.h
index 3c12cd76d2..3c62cd61ca 100644
--- a/src/gpu/GrVertexBuffer.h
+++ b/src/gpu/GrVertexBuffer.h
@@ -27,9 +27,12 @@ public:
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: