diff options
author | 2015-01-23 13:19:00 -0800 | |
---|---|---|
committer | 2015-01-23 13:19:00 -0800 | |
commit | db558dde227ee3c45fd654af6cd3071c1fa6aeb6 (patch) | |
tree | f177eb76bbe1131a522cbd744493bc5d0458e815 | |
parent | 63c992f6c05ea728b5386de61d279f10eb7e08d9 (diff) |
Zap the scratch key on non-RT textures when scratch textures are disabled.
Review URL: https://codereview.chromium.org/870103002
-rw-r--r-- | src/gpu/GrGpu.cpp | 7 |
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; } |