aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrContext.cpp
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2015-01-27 09:56:04 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-01-27 09:56:04 -0800
commite167f9660cca8327afe48ae8c526a44e14c60f0e (patch)
tree0c592af17ba00f35022c3c536771da220011b22c /src/gpu/GrContext.cpp
parentf379ad3429b61eb1d86e916767258340df372538 (diff)
Fix GPU resource cache related assertions.
Diffstat (limited to 'src/gpu/GrContext.cpp')
-rwxr-xr-xsrc/gpu/GrContext.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 6879b109cd..13b0bfaec5 100755
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -502,9 +502,11 @@ GrTexture* GrContext::refScratchTexture(const GrSurfaceDesc& inDesc, ScratchTexM
GrTexture* texture = fGpu->createTexture(*desc, true, NULL, 0);
#ifdef SK_DEBUG
- GrScratchKey key;
- GrTexturePriv::ComputeScratchKey(*desc, &key);
- SkASSERT(NULL == texture || texture->cacheAccess().getScratchKey() == key);
+ if (fGpu->caps()->reuseScratchTextures() || (desc->fFlags & kRenderTarget_GrSurfaceFlag)) {
+ GrScratchKey key;
+ GrTexturePriv::ComputeScratchKey(*desc, &key);
+ SkASSERT(NULL == texture || texture->cacheAccess().getScratchKey() == key);
+ }
#endif
return texture;
}