Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2697)

Unified Diff: cc/layers/picture_layer_impl.cc

Issue 1946403003: Add fixed raster scale use counter histograms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: +will-change Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: cc/layers/picture_layer_impl.cc
diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc
index a96a90d46cd714e8af6f176003b454bbbb1e97e3..b0ae606c58c111ee57d3eb0c029c228ad65f6220 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,17 @@ 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 (raster_source_scale_ != ideal_source_scale_)
+ layer_tree_impl()->SetFixedRasterScaleHasBlurryContent();
+ if (ideal_source_scale_ != last_ideal_source_scale_)
+ layer_tree_impl()->SetFixedRasterScaleAttemptedToChangeScale();
+ }
+
if (layer_tree_impl()->IsActiveTree())
AddLowResolutionTilingIfNeeded();
@@ -1206,6 +1218,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_;
}

Powered by Google App Engine
This is Rietveld 408576698