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

Unified Diff: src/gpu/GrContext.cpp

Issue 815833004: Add a simpler key type for scratch resource keys. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: final fix Created 6 years 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
« no previous file with comments | « include/gpu/GrResourceKey.h ('k') | src/gpu/GrGpu.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrContext.cpp
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 2818aa92dd325090b2e97d0da5e0f2ab45174c82..5ba27cf26fc3e5352998836b8d16069f64e00768 100755
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -411,7 +411,8 @@ GrTexture* GrContext::refScratchTexture(const GrSurfaceDesc& inDesc, ScratchTexM
}
do {
- GrResourceKey key = GrTexturePriv::ComputeScratchKey(*desc);
+ GrScratchKey key;
+ GrTexturePriv::ComputeScratchKey(*desc, &key);
uint32_t scratchFlags = 0;
if (calledDuringFlush) {
scratchFlags = GrResourceCache2::kRequireNoPendingIO_ScratchFlag;
@@ -445,8 +446,11 @@ GrTexture* GrContext::refScratchTexture(const GrSurfaceDesc& inDesc, ScratchTexM
}
GrTexture* texture = fGpu->createTexture(*desc, NULL, 0);
- SkASSERT(NULL == texture ||
- texture->cacheAccess().getScratchKey() == GrTexturePriv::ComputeScratchKey(*desc));
+#ifdef SK_DEBUG
+ GrScratchKey key;
+ GrTexturePriv::ComputeScratchKey(*desc, &key);
+ SkASSERT(NULL == texture || texture->cacheAccess().getScratchKey() == key);
+#endif
return texture;
}
« no previous file with comments | « include/gpu/GrResourceKey.h ('k') | src/gpu/GrGpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698