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

Unified Diff: cc/layers/picture_layer_impl.cc

Issue 2268643002: Change GPU Tile rounding to 32 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Created 4 years, 4 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 12fe4e679d06f0b50e5137284e2b2273f5e59f9c..37c9624f54fd02c6f5f99cf6dbc2d7c8d4aaf17d 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -51,6 +51,10 @@ const int kMinHeightForGpuRasteredTile = 256;
// of using the same tile size.
const int kTileRoundUp = 64;
+// Round GPU default tile sizes to a multiple of 32. This helps prevent
+// rounding errors during compositing.
+const int kGpuDefaultTileRoundUp = 32;
+
// For performance reasons and to support compressed tile textures, tile
// width and height should be an even multiple of 4 in size.
const int kTileMinimalAlignment = 4;
@@ -739,6 +743,13 @@ gfx::Size PictureLayerImpl::CalculateTileSize(
default_tile_width += 2 * PictureLayerTiling::kBorderTexels;
default_tile_height += 2 * PictureLayerTiling::kBorderTexels;
+ // Round GPU default tile sizes to a multiple of kGpuDefaultTileAlignment.
+ // This helps prevent rounding errors in our CA path. crbug.com/632274
+ default_tile_width =
+ MathUtil::UncheckedRoundUp(default_tile_width, kGpuDefaultTileRoundUp);
+ default_tile_height =
+ MathUtil::UncheckedRoundUp(default_tile_height, kGpuDefaultTileRoundUp);
+
default_tile_height =
std::max(default_tile_height, kMinHeightForGpuRasteredTile);
} else {
« 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