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

Unified Diff: cc/layers/picture_layer_impl.cc

Issue 626113004: CC: Have GPU-raster tiles exactly match the viewport. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@CC_cleanup_tile_grid_size
Patch Set: Fix tests for min-size. Created 6 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 | « no previous file | cc/layers/picture_layer_impl_unittest.cc » ('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 353c57676adbb5bf890bac1889cc90c2fb1d0693..854c3bd3e1d9fef38535123ebc2c2a13c9109e1b 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -45,9 +45,9 @@ const float kCpuSkewportTargetTimeInFrames = 60.0f;
const float kGpuSkewportTargetTimeInFrames = 0.0f;
// Even for really wide viewports, at some point GPU raster should use
-// less than 4 tiles to fill the viewport. This is set to 128 as a
-// sane minimum for now, but we might want to increase with tuning.
-const int kMinHeightForGpuRasteredTile = 128;
+// less than 4 tiles to fill the viewport. This is set to 256 as a
+// sane minimum for now, but we might want to tune this for low-end.
+const int kMinHeightForGpuRasteredTile = 256;
// When making odd-sized tiles, round them up to increase the chances
// of using the same tile size.
@@ -692,14 +692,17 @@ gfx::Size PictureLayerImpl::CalculateTileSize(
int viewport_width = layer_tree_impl()->device_viewport_size().width();
int viewport_height = layer_tree_impl()->device_viewport_size().height();
default_tile_width = viewport_width;
- default_tile_height = viewport_height / 4;
+ // Also, increase the height proportionally as the width decreases, and
+ // pad by our border texels to make the tiles exactly match the viewport.
+ int divisor = 4;
+ if (content_bounds.width() <= viewport_width / 2)
+ divisor = 2;
+ if (content_bounds.width() <= viewport_width / 4)
+ divisor = 1;
+ default_tile_height = RoundUp(viewport_height, divisor) / divisor;
+ default_tile_height += 2 * PictureLayerTiling::kBorderTexels;
default_tile_height =
std::max(default_tile_height, kMinHeightForGpuRasteredTile);
-
- // Increase the tile-height proportionally when the content width
- // drops below half the viewport width.
- if (content_bounds.width() <= viewport_width / 2)
- default_tile_height *= 2;
} else {
// For CPU rasterization we use tile-size settings.
const LayerTreeSettings& settings = layer_tree_impl()->settings();
« no previous file with comments | « no previous file | cc/layers/picture_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698