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

Unified Diff: cc/layers/picture_layer_impl.cc

Issue 247973005: cc: use viewport-wide tiles for GPU rasterization. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 | cc/trees/layer_tree_host_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/picture_layer_impl.cc
diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc
index 85249812d5fbc9d5ea119537e014ae5e80eb80b2..94c3d201639d0dd90a29545ba18ca067f43edd8a 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -573,6 +573,13 @@ gfx::Size PictureLayerImpl::CalculateTileSize(
layer_tree_impl()->resource_provider()->max_texture_size();
gfx::Size default_tile_size = layer_tree_impl()->settings().default_tile_size;
+ if (ShouldUseGpuRasterization()) {
+ // TODO(ernstm) crbug.com/365877: We need a unified way to override the
+ // default-tile-size.
+ default_tile_size =
+ gfx::Size(layer_tree_impl()->device_viewport_size().width(),
+ layer_tree_impl()->device_viewport_size().height() / 4);
+ }
default_tile_size.SetToMin(gfx::Size(max_texture_size, max_texture_size));
gfx::Size max_untiled_content_size =
@@ -593,10 +600,12 @@ gfx::Size PictureLayerImpl::CalculateTileSize(
// 500x500 max untiled size would get 500x12 tiles. Also do this
// if the layer is small.
if (any_dimension_one_tile || !any_dimension_too_large) {
- int width =
- std::min(max_untiled_content_size.width(), content_bounds.width());
- int height =
- std::min(max_untiled_content_size.height(), content_bounds.height());
+ int width = std::min(
+ std::max(max_untiled_content_size.width(), default_tile_size.width()),
+ content_bounds.width());
+ int height = std::min(
+ std::max(max_untiled_content_size.height(), default_tile_size.height()),
+ content_bounds.height());
// 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
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698