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

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: Rebase. 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') | cc/layers/picture_layer_impl_unittest.cc » ('J')
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..7c9a4165eed9b4c478dfb681102c96e171577891 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -692,14 +692,13 @@ 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, double the height when the content width falls below 50%, and
+ // pad by our border texels to make the tiles exactly match viewport.
+ int divisor = (content_bounds.width() <= viewport_width / 2) ? 2 : 4;
+ 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') | cc/layers/picture_layer_impl_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698