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 ede7da0ac3a5853216a7103b38852af889669b7e..98da42dac3a1c1adfcba5c27ff6c44cac73d88d9 100644 |
| --- a/cc/layers/picture_layer_impl.cc |
| +++ b/cc/layers/picture_layer_impl.cc |
| @@ -1023,6 +1023,11 @@ bool PictureLayerImpl::ShouldAdjustRasterScale() const { |
| draw_properties().screen_space_transform_is_animating) |
| return true; |
| + if (draw_properties().screen_space_transform_is_animating && |
| + raster_contents_scale_ != ideal_contents_scale_ && |
| + ShouldAdjustRasterScaleDuringScaleAnimations()) |
| + return true; |
| + |
| bool is_pinching = layer_tree_impl()->PinchGestureActive(); |
| if (is_pinching && raster_page_scale_) { |
| // We change our raster scale when it is: |
| @@ -1117,11 +1122,12 @@ void PictureLayerImpl::RecalculateRasterScales() { |
| raster_contents_scale_ = |
| std::max(raster_contents_scale_, MinimumContentsScale()); |
| - // Since we're not re-rasterizing during animation, rasterize at the maximum |
| + // If we're not re-rasterizing during animation, rasterize at the maximum |
| // scale that will occur during the animation, if the maximum scale is |
| // known. However, to avoid excessive memory use, don't rasterize at a scale |
| // at which this layer would become larger than the viewport. |
| - if (draw_properties().screen_space_transform_is_animating) { |
| + 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( |
| @@ -1299,6 +1305,15 @@ void PictureLayerImpl::SanityCheckTilingState() const { |
| #endif |
| } |
| +bool PictureLayerImpl::ShouldAdjustRasterScaleDuringScaleAnimations() const { |
| + if (!layer_tree_impl()->use_gpu_rasterization()) |
| + return false; |
| + if (pile_->has_text()) |
|
enne (OOO)
2014/08/20 18:15:49
Can you add some comments about why this is needed
ajuma
2014/08/20 18:51:29
Done.
|
| + return false; |
| + |
| + return true; |
| +} |
| + |
| float PictureLayerImpl::MaximumTilingContentsScale() const { |
| float max_contents_scale = MinimumContentsScale(); |
| for (size_t i = 0; i < tilings_->num_tilings(); ++i) { |