Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1021)

Unified Diff: src/gpu/GrGpu.cpp

Issue 870103002: Zap the scratch key on non-RT textures when scratch textures are disabled. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add SkToBool Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698