diff options
author | bsalomon <bsalomon@google.com> | 2015-01-27 09:56:04 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-01-27 09:56:04 -0800 |
commit | e167f9660cca8327afe48ae8c526a44e14c60f0e (patch) | |
tree | 0c592af17ba00f35022c3c536771da220011b22c /src/gpu/GrContext.cpp | |
parent | f379ad3429b61eb1d86e916767258340df372538 (diff) |
Fix GPU resource cache related assertions.
Review URL: https://codereview.chromium.org/879963003
Diffstat (limited to 'src/gpu/GrContext.cpp')
-rwxr-xr-x | src/gpu/GrContext.cpp | 8 |
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; } |