| Index: cc/layers/picture_layer_impl.cc
|
| diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc
|
| index 7278504a16bfc85df0482aa2533584e9a593ad1f..5f2c1dd403bd4208e7dbe0c2dd4cd276d18779aa 100644
|
| --- a/cc/layers/picture_layer_impl.cc
|
| +++ b/cc/layers/picture_layer_impl.cc
|
| @@ -74,6 +74,7 @@ PictureLayerImpl::PictureLayerImpl(LayerTreeImpl* tree_impl,
|
| raster_source_scale_(0.f),
|
| raster_contents_scale_(0.f),
|
| low_res_raster_contents_scale_(0.f),
|
| + raster_source_scale_is_fixed_(false),
|
| was_screen_space_transform_animating_(false),
|
| only_used_low_res_last_append_quads_(false),
|
| is_mask_(is_mask),
|
| @@ -902,8 +903,10 @@ bool PictureLayerImpl::ShouldAdjustRasterScale() const {
|
| if (raster_device_scale_ != ideal_device_scale_)
|
| return true;
|
|
|
| - // When the source scale changes we want to match it, but not when animating.
|
| + // When the source scale changes we want to match it, but not when animating
|
| + // or when we've fixed the scale in place.
|
| if (!draw_properties().screen_space_transform_is_animating &&
|
| + !raster_source_scale_is_fixed_ &&
|
| raster_source_scale_ != ideal_source_scale_)
|
| return true;
|
|
|
| @@ -944,14 +947,33 @@ void PictureLayerImpl::AddLowResolutionTilingIfNeeded() {
|
| }
|
|
|
| void PictureLayerImpl::RecalculateRasterScales() {
|
| - const float old_raster_contents_scale = raster_contents_scale_;
|
| - const float old_raster_page_scale = raster_page_scale_;
|
| + float old_raster_contents_scale = raster_contents_scale_;
|
| + float old_raster_page_scale = raster_page_scale_;
|
| + float old_raster_source_scale = raster_source_scale_;
|
|
|
| raster_device_scale_ = ideal_device_scale_;
|
| raster_page_scale_ = ideal_page_scale_;
|
| raster_source_scale_ = ideal_source_scale_;
|
| raster_contents_scale_ = ideal_contents_scale_;
|
|
|
| + // If we're not animating, or leaving an animation, and the
|
| + // ideal_source_scale_ changes, then things are unpredictable, and we fix
|
| + // the raster_source_scale_ in place.
|
| + if (old_raster_source_scale &&
|
| + !draw_properties().screen_space_transform_is_animating &&
|
| + !was_screen_space_transform_animating_ &&
|
| + old_raster_source_scale != ideal_source_scale_)
|
| + raster_source_scale_is_fixed_ = true;
|
| +
|
| + // TODO(danakj): Adjust raster source scale closer to ideal source scale at
|
| + // a throttled rate. Possibly make use of invalidation_.IsEmpty() on pending
|
| + // tree. This will allow CSS scale changes to get re-rastered at an
|
| + // appropriate rate. (crbug.com/413636)
|
| + if (raster_source_scale_is_fixed_) {
|
| + raster_contents_scale_ /= raster_source_scale_;
|
| + raster_source_scale_ = 1.f;
|
| + }
|
| +
|
| // During pinch we completely ignore the current ideal scale, and just use
|
| // a multiple of the previous scale.
|
| bool is_pinching = layer_tree_impl()->PinchGestureActive();
|
| @@ -1122,6 +1144,7 @@ void PictureLayerImpl::ResetRasterScale() {
|
| raster_source_scale_ = 0.f;
|
| raster_contents_scale_ = 0.f;
|
| low_res_raster_contents_scale_ = 0.f;
|
| + raster_source_scale_is_fixed_ = false;
|
| }
|
|
|
| bool PictureLayerImpl::CanHaveTilings() const {
|
| @@ -1205,7 +1228,6 @@ void PictureLayerImpl::AsValueInto(
|
| base::trace_event::TracedValue* state) const {
|
| LayerImpl::AsValueInto(state);
|
| state->SetDouble("ideal_contents_scale", ideal_contents_scale_);
|
| - state->SetDouble("raster_contents_scale", raster_contents_scale_);
|
| state->SetDouble("geometry_contents_scale", MaximumTilingContentsScale());
|
| state->BeginArray("tilings");
|
| tilings_->AsValueInto(state);
|
|
|