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 c294a330635797c82f7186c4768a87962738ba23..c77f610dad4d6efe631cc2b33d5a310b7858ce85 100644 |
| --- a/cc/layers/picture_layer_impl.cc |
| +++ b/cc/layers/picture_layer_impl.cc |
| @@ -1170,22 +1170,25 @@ void PictureLayerImpl::RecalculateRasterScales() { |
| if (draw_properties().screen_space_transform_is_animating && |
| !ShouldAdjustRasterScaleDuringScaleAnimations()) { |
| bool can_raster_at_maximum_scale = false; |
| - if (draw_properties().maximum_animation_contents_scale > 0.f) { |
| - gfx::Size bounds_at_maximum_scale = gfx::ToCeiledSize(gfx::ScaleSize( |
| - bounds(), draw_properties().maximum_animation_contents_scale)); |
| - if (bounds_at_maximum_scale.GetArea() <= |
| - layer_tree_impl()->device_viewport_size().GetArea()) |
| + float maximum_scale = draw_properties().maximum_animation_contents_scale; |
| + if (maximum_scale) { |
| + if (maximum_scale < raster_contents_scale_) { |
|
vmpstr
2014/10/10 00:50:49
Does the comment need updating above? Also, can yo
danakj
2014/10/10 01:00:19
Yar.
|
| can_raster_at_maximum_scale = true; |
| + } else { |
| + gfx::Size bounds_at_maximum_scale = |
| + gfx::ToCeiledSize(gfx::ScaleSize(bounds(), maximum_scale)); |
| + if (bounds_at_maximum_scale.GetArea() <= |
| + layer_tree_impl()->device_viewport_size().GetArea()) |
| + can_raster_at_maximum_scale = true; |
| + } |
| } |
| - if (can_raster_at_maximum_scale) { |
| - raster_contents_scale_ = |
| - std::max(raster_contents_scale_, |
| - draw_properties().maximum_animation_contents_scale); |
| - } else { |
| - raster_contents_scale_ = |
| - std::max(raster_contents_scale_, |
| - 1.f * ideal_page_scale_ * ideal_device_scale_); |
| - } |
| + // Use the computed scales for the raster scale directly, do not try to use |
| + // the ideal scale here. The current ideal scale may be way too large in the |
| + // case of an animation with scale, and will be constantly changing. |
| + if (can_raster_at_maximum_scale) |
| + raster_contents_scale_ = maximum_scale; |
| + else |
| + raster_contents_scale_ = 1.f * ideal_page_scale_ * ideal_device_scale_; |
| } |
| // If this layer would create zero or one tiles at this content scale, |