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 { |