Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Unified Diff: src/gpu/GrVertexBuffer.h

Issue 1261643004: Some cleanup in GrTextureProvider and GrResourceProvider (Closed) Base URL: https://skia.googlesource.com/skia.git@pathargs
Patch Set: fix Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/gpu/GrVertexBuffer.h
diff --git a/src/gpu/GrVertexBuffer.h b/src/gpu/GrVertexBuffer.h
index 3c12cd76d2a6b496ec9e40410ded571534571207..3c62cd61ca7f3c7e7dff63149cecb97d52dd890d 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:

Powered by Google App Engine
This is Rietveld 408576698