Index: src/gpu/GrContext.cpp |
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp |
index 6879b109cd76c0c6b64b130346a5204d3c72888c..13b0bfaec5cb537a83524ecc87bc0341a883dbe1 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; |
} |