| Index: cc/layers/picture_layer_impl.cc
|
| diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc
|
| index c8b45b730238455f8749fd0d844a377b592d4356..43ea41176a73e8becafcb1d0d8c86c9180db9800 100644
|
| --- a/cc/layers/picture_layer_impl.cc
|
| +++ b/cc/layers/picture_layer_impl.cc
|
| @@ -56,6 +56,13 @@ const int kTileRoundUp = 64;
|
| // width and height should be an even multiple of 4 in size.
|
| const int kTileMinimalAlignment = 4;
|
|
|
| +// Large contents scale can cause overflow issues. Cap the ideal contents scale
|
| +// by this constant, since scales larger than this are usually not correct or
|
| +// their scale doesn't matter as long as it's large. See
|
| +// Renderer4.IdealContentsScale UMA for distribution of existing contents
|
| +// scales.
|
| +const float kMaxIdealContentsScale = 10000.f;
|
| +
|
| // Intersect rects which may have right() and bottom() that overflow integer
|
| // boundaries. This code is similar to gfx::Rect::Intersect with the exception
|
| // that the types are promoted to int64_t when there is a chance of overflow.
|
| @@ -1247,7 +1254,9 @@ void PictureLayerImpl::UpdateIdealScales() {
|
| ? layer_tree_impl()->current_page_scale_factor()
|
| : 1.f;
|
| ideal_device_scale_ = layer_tree_impl()->device_scale_factor();
|
| - ideal_contents_scale_ = std::max(GetIdealContentsScale(), min_contents_scale);
|
| + ideal_contents_scale_ =
|
| + std::min(kMaxIdealContentsScale,
|
| + std::max(GetIdealContentsScale(), min_contents_scale));
|
| ideal_source_scale_ =
|
| ideal_contents_scale_ / ideal_page_scale_ / ideal_device_scale_;
|
| UMA_HISTOGRAM_CUSTOM_COUNTS("Renderer4.IdealContentsScale",
|
|
|