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

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: fix rebase error. 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
« no previous file with comments | « cc/layers/layer_impl.h ('k') | cc/layers/layer_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer_impl.cc
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index c6bb3807250abe5e742915adad8b4ff26974b311..983e741eb608c9e31366f44bf983061b6e468a03 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),
force_render_surface_(false),
num_layer_or_descendants_with_copy_request_(0),
frame_timing_requests_dirty_(false),
@@ -597,6 +600,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_);
@@ -1217,6 +1222,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;
@@ -1637,6 +1664,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(),
« no previous file with comments | « cc/layers/layer_impl.h ('k') | cc/layers/layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698