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

Unified Diff: cc/layers/layer.cc

Issue 1946403003: Add fixed raster scale use counter histograms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/layer.cc
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
index 88f2036fc8038144880d9942efe97e02a48f7b59..6dcaf98b0115457cd826d1da7e2ab3a90902feee 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -80,6 +80,7 @@ Layer::Layer()
force_render_surface_for_testing_(false),
has_render_surface_(false),
subtree_property_changed_(false),
+ has_will_change_transform_hint_(false),
background_color_(0),
safe_opaque_background_color_(0),
opacity_(1.f),
@@ -1210,6 +1211,8 @@ void Layer::PushPropertiesTo(LayerImpl* layer) {
update_rect_.Union(layer->update_rect());
layer->SetUpdateRect(update_rect_);
+ layer->SetHasWillChangeTransformHint(has_will_change_transform_hint());
+
// Reset any state that should be cleared for the next update.
subtree_property_changed_ = false;
update_rect_ = gfx::Rect();
@@ -1412,6 +1415,8 @@ void Layer::LayerSpecificPropertiesToProto(proto::LayerProperties* proto) {
// See crbug.com/570376.
update_rect_ = gfx::Rect();
+
+ base->set_has_will_change_transform_hint(has_will_change_transform_hint_);
}
void Layer::FromLayerSpecificPropertiesProto(
@@ -1504,6 +1509,8 @@ void Layer::FromLayerSpecificPropertiesProto(
scroll_offset_ = ProtoToScrollOffset(base.scroll_offset());
update_rect_.Union(ProtoToRect(base.update_rect()));
+
+ has_will_change_transform_hint_ = base.has_will_change_transform_hint();
}
std::unique_ptr<LayerImpl> Layer::CreateLayerImpl(LayerTreeImpl* tree_impl) {
@@ -1673,6 +1680,13 @@ bool Layer::HasActiveAnimationForTesting() const {
: false;
}
+void Layer::SetHasWillChangeTransformHint(bool has_will_change) {
+ if (has_will_change_transform_hint_ == has_will_change)
+ return;
+ has_will_change_transform_hint_ = has_will_change;
+ SetNeedsCommit();
+}
+
ScrollbarLayerInterface* Layer::ToScrollbarLayer() {
return nullptr;
}

Powered by Google App Engine
This is Rietveld 408576698