| Index: cc/layers/picture_layer_impl.cc
|
| diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc
|
| index 85249812d5fbc9d5ea119537e014ae5e80eb80b2..94c3d201639d0dd90a29545ba18ca067f43edd8a 100644
|
| --- a/cc/layers/picture_layer_impl.cc
|
| +++ b/cc/layers/picture_layer_impl.cc
|
| @@ -573,6 +573,13 @@ gfx::Size PictureLayerImpl::CalculateTileSize(
|
| layer_tree_impl()->resource_provider()->max_texture_size();
|
|
|
| gfx::Size default_tile_size = layer_tree_impl()->settings().default_tile_size;
|
| + if (ShouldUseGpuRasterization()) {
|
| + // TODO(ernstm) crbug.com/365877: We need a unified way to override the
|
| + // default-tile-size.
|
| + default_tile_size =
|
| + gfx::Size(layer_tree_impl()->device_viewport_size().width(),
|
| + layer_tree_impl()->device_viewport_size().height() / 4);
|
| + }
|
| default_tile_size.SetToMin(gfx::Size(max_texture_size, max_texture_size));
|
|
|
| gfx::Size max_untiled_content_size =
|
| @@ -593,10 +600,12 @@ gfx::Size PictureLayerImpl::CalculateTileSize(
|
| // 500x500 max untiled size would get 500x12 tiles. Also do this
|
| // if the layer is small.
|
| if (any_dimension_one_tile || !any_dimension_too_large) {
|
| - int width =
|
| - std::min(max_untiled_content_size.width(), content_bounds.width());
|
| - int height =
|
| - std::min(max_untiled_content_size.height(), content_bounds.height());
|
| + int width = std::min(
|
| + std::max(max_untiled_content_size.width(), default_tile_size.width()),
|
| + content_bounds.width());
|
| + int height = std::min(
|
| + std::max(max_untiled_content_size.height(), default_tile_size.height()),
|
| + content_bounds.height());
|
| // Round width and height up to the closest multiple of 64, or 56 if
|
| // we should avoid power-of-two textures. This helps reduce the number
|
| // of different textures sizes to help recycling, and also keeps all
|
|
|