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

Unified Diff: cc/layers/layer_impl.cc

Issue 1405993008: compositor-worker: plumb element id and mutable properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years 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_impl.cc
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index f0e85b130018485a7cbcb43f6a1bea39104bb0ea..b20cb3ddb105dbb1a36f437525f2d582e53e07e3 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -10,6 +10,7 @@
#include "base/trace_event/trace_event.h"
#include "base/trace_event/trace_event_argument.h"
#include "cc/animation/animation_registrar.h"
+#include "cc/animation/mutable_properties.h"
#include "cc/base/math_util.h"
#include "cc/base/simple_enclosed_region.h"
#include "cc/debug/debug_colors.h"
@@ -85,6 +86,8 @@ LayerImpl::LayerImpl(LayerTreeImpl* tree_impl,
num_dependents_need_push_properties_(0),
sorting_context_id_(0),
current_draw_mode_(DRAW_MODE_NONE),
+ element_id_(0),
+ mutable_properties_(kMutablePropertyNone),
num_layer_or_descendants_with_copy_request_(0),
frame_timing_requests_dirty_(false),
visited_(false),
@@ -596,6 +599,8 @@ void LayerImpl::PushPropertiesTo(LayerImpl* layer) {
layer->SetTransformAndInvertibility(transform_, transform_is_invertible_);
layer->SetScrollClipLayer(scroll_clip_layer_id_);
+ layer->SetElementId(element_id_);
+ layer->SetMutableProperties(mutable_properties_);
layer->set_user_scrollable_horizontal(user_scrollable_horizontal_);
layer->set_user_scrollable_vertical(user_scrollable_vertical_);
@@ -1216,6 +1221,28 @@ bool LayerImpl::OpacityIsAnimatingOnImplOnly() const {
return opacity_animation && opacity_animation->is_impl_only();
}
+void LayerImpl::SetElementId(uint64_t element_id) {
+ if (element_id == element_id_)
+ return;
+
+ TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("compositor-worker"),
+ "LayerImpl::SetElementId", "id", element_id);
+
+ element_id_ = element_id;
+ SetNeedsPushProperties();
+}
+
+void LayerImpl::SetMutableProperties(uint32_t properties) {
+ if (mutable_properties_ == properties)
+ return;
+
+ TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("compositor-worker"),
+ "LayerImpl::SetMutableProperties", "properties", properties);
+
+ mutable_properties_ = properties;
+ SetNeedsPushProperties();
+}
+
void LayerImpl::SetBlendMode(SkXfermode::Mode blend_mode) {
if (blend_mode_ == blend_mode)
return;
@@ -1630,6 +1657,11 @@ void LayerImpl::AsValueInto(base::trace_event::TracedValue* state) const {
state->SetInteger("gpu_memory_usage",
base::saturated_cast<int>(GPUMemoryUsageInBytes()));
+ if (mutable_properties_ != kMutablePropertyNone) {
+ state->SetInteger("element_id", base::saturated_cast<int>(element_id_));
+ state->SetInteger("mutable_properties", mutable_properties_);
+ }
+
MathUtil::AddToTracedValue(
"scroll_offset", scroll_offset_ ? scroll_offset_->Current(IsActive())
: gfx::ScrollOffset(),

Powered by Google App Engine
This is Rietveld 408576698