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

Unified Diff: src/gpu/GrContext.cpp

Issue 53133002: Make not-reusing-scratch-textures only apply to texture uploads (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: clean up Created 7 years, 2 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 | « src/gpu/GrClipMaskManager.cpp ('k') | src/gpu/GrDrawTargetCaps.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrContext.cpp
===================================================================
--- src/gpu/GrContext.cpp (revision 12025)
+++ src/gpu/GrContext.cpp (working copy)
@@ -447,9 +447,9 @@
!(inDesc.fFlags & kRenderTarget_GrTextureFlagBit) ||
(inDesc.fConfig != kAlpha_8_GrPixelConfig));
- if (!fGpu->caps()->reuseScratchTextures()) {
- // If we're never recycling scratch textures we can
- // always make them the right size
+ if (!fGpu->caps()->reuseScratchTextures() &&
+ !(inDesc.fFlags & kRenderTarget_GrTextureFlagBit)) {
+ // If we're never recycling this texture we can always make it the right size
return create_scratch_texture(fGpu, fTextureCache, inDesc);
}
@@ -514,7 +514,7 @@
// for the creation ref. Assert refcnt == 1.
SkASSERT(texture->unique());
- if (fGpu->caps()->reuseScratchTextures()) {
+ if (fGpu->caps()->reuseScratchTextures() || NULL != texture->asRenderTarget()) {
// Since this texture came from an AutoScratchTexture it should
// still be in the exclusive pile. Recycle it.
fTextureCache->makeNonExclusive(texture->getCacheEntry());
@@ -542,7 +542,7 @@
// while it was locked (to avoid two callers simultaneously getting
// the same texture).
if (texture->getCacheEntry()->key().isScratch()) {
- if (fGpu->caps()->reuseScratchTextures()) {
+ if (fGpu->caps()->reuseScratchTextures() || NULL != texture->asRenderTarget()) {
fTextureCache->makeNonExclusive(texture->getCacheEntry());
this->purgeCache();
} else if (texture->unique() && texture->getDeferredRefCount() <= 0) {
« no previous file with comments | « src/gpu/GrClipMaskManager.cpp ('k') | src/gpu/GrDrawTargetCaps.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698