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

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: review+fixup 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 ab348dac2b8ca383b6a9b9670083f900c815d105..8b46baed533f8199b667cbccf2870fee51387796 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),
@@ -1209,6 +1210,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();
@@ -1411,6 +1414,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(
@@ -1503,6 +1508,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) {
@@ -1697,6 +1704,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') | cc/layers/picture_layer_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698