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

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: rebase+fix 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
« no previous file with comments | « cc/layers/layer.h ('k') | cc/layers/layer_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer.cc
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
index e2f03d5483e29f7f48b26a764ee8b89b20521a69..4def9b73e0ed725e2559251dfaffaea8cd150a8c 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -79,6 +79,7 @@ Layer::Layer()
should_check_backface_visibility_(false),
force_render_surface_for_testing_(false),
subtree_property_changed_(false),
+ has_will_change_transform_hint_(false),
background_color_(0),
safe_opaque_background_color_(0),
opacity_(1.f),
@@ -1221,6 +1222,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();
@@ -1422,6 +1425,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(
@@ -1513,6 +1518,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) {
@@ -1703,6 +1710,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;
}
« no previous file with comments | « cc/layers/layer.h ('k') | cc/layers/layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698