aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2015-01-23 13:19:00 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-01-23 13:19:00 -0800
commitdb558dde227ee3c45fd654af6cd3071c1fa6aeb6 (patch)
treef177eb76bbe1131a522cbd744493bc5d0458e815
parent63c992f6c05ea728b5386de61d279f10eb7e08d9 (diff)
Zap the scratch key on non-RT textures when scratch textures are disabled.
-rw-r--r--src/gpu/GrGpu.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index f5236324ee..b7a064ceee 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;
}