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

Unified Diff: src/gpu/GrContext.cpp

Issue 12475007: Reduce the minimum scratch size to 16, don't look for next pow2 larger sizes. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 9 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/GrContext.cpp
===================================================================
--- src/gpu/GrContext.cpp (revision 8005)
+++ src/gpu/GrContext.cpp (working copy)
@@ -428,7 +428,7 @@
if (kApprox_ScratchTexMatch == match) {
// bin by pow2 with a reasonable min
- static const int MIN_SIZE = 256;
+ static const int MIN_SIZE = 16;
desc.fWidth = GrMax(MIN_SIZE, GrNextPow2(desc.fWidth));
desc.fHeight = GrMax(MIN_SIZE, GrNextPow2(desc.fHeight));
}
@@ -455,23 +455,13 @@
if (kExact_ScratchTexMatch == match) {
break;
}
- // We had a cache miss and we are in approx mode, relax the fit of the flags... then try
- // doubling width... then the height.
+ // We had a cache miss and we are in approx mode, relax the fit of the flags.
// We no longer try to reuse textures that were previously used as render targets in
// situations where no RT is needed; doing otherwise can confuse the video driver and
// cause significant performance problems in some cases.
if (desc.fFlags & kNoStencil_GrTextureFlagBit) {
desc.fFlags = desc.fFlags & ~kNoStencil_GrTextureFlagBit;
- } else if (!doubledW) {
- desc.fFlags = inDesc.fFlags;
- desc.fWidth *= 2;
- doubledW = true;
- } else if (!doubledH) {
- desc.fFlags = inDesc.fFlags;
- desc.fWidth = origWidth;
- desc.fHeight *= 2;
- doubledH = true;
} else {
break;
}
« 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