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

Unified Diff: cc/layers/layer.cc

Issue 1405993008: compositor-worker: plumb element id and mutable properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed layout test (and logged bug) Created 5 years, 1 month 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 5ebe0d8c41a422e8a8e786c5ec7dde89c7cc4bbb..964982edbb6fdff28fe3093aed41cfcd8c4ebad6 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -17,6 +17,7 @@
#include "cc/animation/animation_registrar.h"
#include "cc/animation/keyframed_animation_curve.h"
#include "cc/animation/layer_animation_controller.h"
+#include "cc/animation/mutable_properties.h"
#include "cc/base/simple_enclosed_region.h"
#include "cc/debug/frame_viewer_instrumentation.h"
#include "cc/layers/layer_client.h"
@@ -58,6 +59,8 @@ Layer::Layer(const LayerSettings& settings)
clip_tree_index_(-1),
property_tree_sequence_number_(-1),
num_layer_or_descendants_with_copy_request_(0),
+ element_id_(0),
+ mutable_properties_(kMutablePropertyNone),
should_flatten_transform_from_property_tree_(false),
should_scroll_on_main_thread_(false),
have_wheel_event_handlers_(false),
@@ -1238,6 +1241,8 @@ void Layer::PushPropertiesTo(LayerImpl* layer) {
layer->SetScrollClipLayer(scroll_clip_layer_id_);
layer->set_user_scrollable_horizontal(user_scrollable_horizontal_);
layer->set_user_scrollable_vertical(user_scrollable_vertical_);
+ layer->SetElementId(element_id_);
+ layer->SetMutableProperties(mutable_properties_);
LayerImpl* scroll_parent = nullptr;
if (scroll_parent_) {
@@ -1727,6 +1732,26 @@ void Layer::SetFrameTimingRequests(
SetNeedsCommit();
}
+void Layer::SetElementId(uint64_t id) {
+ DCHECK(IsPropertyChangeAllowed());
+ if (element_id_ == id)
+ return;
+ TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("compositor-worker"),
+ "Layer::SetElementId", "id", id);
+ element_id_ = id;
+ SetNeedsCommit();
+}
+
+void Layer::SetMutableProperties(uint32_t properties) {
+ DCHECK(IsPropertyChangeAllowed());
+ if (mutable_properties_ == properties)
+ return;
+ TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("compositor-worker"),
+ "Layer::SetMutableProperties", "properties", properties);
+ mutable_properties_ = properties;
+ SetNeedsCommit();
+}
+
void Layer::DidBeginTracing() {
// We'll be dumping layer trees as part of trace, so make sure
// PushPropertiesTo() propagates layer debug info to the impl

Powered by Google App Engine
This is Rietveld 408576698