Chromium Code Reviews| Index: cc/layers/picture_layer_impl.cc |
| diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc |
| index 0849c516bab58e63b183c957eb877e748f85187a..c2bb3e9f37895177bf55f3b2b38dcc4a3e4a7927 100644 |
| --- a/cc/layers/picture_layer_impl.cc |
| +++ b/cc/layers/picture_layer_impl.cc |
| @@ -767,6 +767,13 @@ gfx::Size PictureLayerImpl::CalculateTileSize( |
| tile_height = std::min(tile_height, default_tile_height); |
| } |
| + // Ensure that tiles are an even multiple of 4 in size. |
|
reveman
2015/12/01 17:27:24
Unconditionally use MathUtil::UncheckedRoundUp(til
christiank
2015/12/02 16:18:14
Done.
|
| + if (tile_width % 4 != 0 || tile_height % 4 != 0) { |
| + // Round the size up to the nearest multiple of four. |
| + tile_width = 4 * std::ceil(static_cast<float>(tile_width) / 4); |
| + tile_height = 4 * std::ceil(static_cast<float>(tile_height) / 4); |
| + } |
| + |
| // Under no circumstance should we be larger than the max texture size. |
| tile_width = std::min(tile_width, max_texture_size); |
| tile_height = std::min(tile_height, max_texture_size); |