Index: src/gpu/GrGpu.cpp |
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp |
index f5236324eefd68329b670fa7fff0c8ec976ebdbb..b7a064ceee613c6e0b3c48b13fe4aa90c636051d 100644 |
--- a/src/gpu/GrGpu.cpp |
+++ b/src/gpu/GrGpu.cpp |
@@ -40,8 +40,8 @@ GrTexture* GrGpu::createTexture(const GrSurfaceDesc& desc, bool budgeted, |
return NULL; |
} |
- if ((desc.fFlags & kRenderTarget_GrSurfaceFlag) && |
- !this->caps()->isConfigRenderable(desc.fConfig, desc.fSampleCnt > 0)) { |
+ bool isRT = SkToBool(desc.fFlags & kRenderTarget_GrSurfaceFlag); |
+ if (isRT && !this->caps()->isConfigRenderable(desc.fConfig, desc.fSampleCnt > 0)) { |
return NULL; |
} |
@@ -71,6 +71,9 @@ GrTexture* GrGpu::createTexture(const GrSurfaceDesc& desc, bool budgeted, |
} |
} |
} |
+ if (!this->caps()->reuseScratchTextures() && !isRT) { |
+ tex->cacheAccess().removeScratchKey(); |
+ } |
return tex; |
} |