aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrContext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/GrContext.cpp')
-rwxr-xr-xsrc/gpu/GrContext.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 3c23032416..e6fd3589ac 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;
}