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 b2b8def1ad4ca91430fab762063e48576df5c398..0605c7e17326a159acc4ccee7acf0240824c7616 100644 |
| --- a/cc/layers/picture_layer_impl.cc |
| +++ b/cc/layers/picture_layer_impl.cc |
| @@ -69,6 +69,7 @@ PictureLayerImpl::PictureLayerImpl(LayerTreeImpl* tree_impl, |
| ideal_device_scale_(0.f), |
| ideal_source_scale_(0.f), |
| ideal_contents_scale_(0.f), |
| + last_ideal_source_scale_(0.f), |
| raster_page_scale_(0.f), |
| raster_device_scale_(0.f), |
| raster_source_scale_(0.f), |
| @@ -433,6 +434,21 @@ bool PictureLayerImpl::UpdateTiles() { |
| AddTilingsForRasterScale(); |
| } |
| + // Inform layer tree impl if we will have blurry content because of fixed |
| + // raster scale (note that this check should happen after we |
| + // ReclaculateRasterScales, since that's the function that will determine |
| + // whether our raster scale is fixed. |
| + if (raster_source_scale_is_fixed_ && !has_will_change_transform_hint()) { |
| + if (std::abs(raster_source_scale_ - ideal_source_scale_) >= |
| + std::numeric_limits<float>::epsilon()) { |
|
danakj
2016/05/13 20:41:47
Why?
vmpstr
2016/05/13 21:17:10
Acknowledged.
|
| + layer_tree_impl()->SetFixedRasterScaleHasBlurryContent(); |
| + } |
| + if (std::abs(ideal_source_scale_ - last_ideal_source_scale_) >= |
| + std::numeric_limits<float>::epsilon()) { |
| + layer_tree_impl()->SetFixedRasterScaleAttemptedToChangeScale(); |
| + } |
| + } |
| + |
| if (layer_tree_impl()->IsActiveTree()) |
| AddLowResolutionTilingIfNeeded(); |
| @@ -1206,6 +1222,7 @@ void PictureLayerImpl::UpdateIdealScales() { |
| : 1.f; |
| ideal_device_scale_ = layer_tree_impl()->device_scale_factor(); |
| ideal_contents_scale_ = std::max(GetIdealContentsScale(), min_contents_scale); |
| + last_ideal_source_scale_ = ideal_source_scale_; |
| ideal_source_scale_ = |
| ideal_contents_scale_ / ideal_page_scale_ / ideal_device_scale_; |
| } |