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

Unified Diff: cc/picture_layer_impl.cc

Issue 12217102: cc: Avoid power of two textures. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Lower-case vendor. Created 7 years, 10 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 | « cc/layer_tree_impl.cc ('k') | gpu/command_buffer/service/feature_info.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/picture_layer_impl.cc
diff --git a/cc/picture_layer_impl.cc b/cc/picture_layer_impl.cc
index bb608e84e00d27661ac0bb86599db4f79981bbca..76924d5bd031f3760936063c7a2e7b364c605df7 100644
--- a/cc/picture_layer_impl.cc
+++ b/cc/picture_layer_impl.cc
@@ -360,12 +360,14 @@ gfx::Size PictureLayerImpl::CalculateTileSize(
std::min(max_untiled_content_size.width(), content_bounds.width());
int height =
std::min(max_untiled_content_size.height(), content_bounds.height());
- // Round width and height up to the closest multiple of 64. This is to
- // help IMG drivers where facter of 8 texture sizes are faster, and also
- // to prevent creating textures of too many different size for better
- // recycling.
- width = RoundUp(width, 64);
- height = RoundUp(height, 64);
+ // Round width and height up to the closest multiple of 64, or 56 if
+ // we should avoid power-of-two textures. This helps reduce the number
+ // of different textures sizes to help recycling, and also keeps all
+ // textures multiple-of-eight, which is preferred on some drivers (IMG).
+ bool avoidPow2 = layerTreeImpl()->rendererCapabilities().avoidPow2Textures;
+ int roundUpTo = avoidPow2 ? 56 : 64;
+ width = RoundUp(width, roundUpTo);
+ height = RoundUp(height, roundUpTo);
return gfx::Size(width, height);
}
« no previous file with comments | « cc/layer_tree_impl.cc ('k') | gpu/command_buffer/service/feature_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698