Index: cc/layers/layer.cc |
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc |
index c4f3fa2ef755dca7054edbc369236a0caaf415ef..0937eb44298681464f2d1cb2cfa390c0a61f3a3a 100644 |
--- a/cc/layers/layer.cc |
+++ b/cc/layers/layer.cc |
@@ -81,6 +81,7 @@ Layer::Layer() |
transform_is_invertible_(true), |
has_render_surface_(false), |
subtree_property_changed_(false), |
+ layer_property_changed_(false), |
background_color_(0), |
safe_opaque_background_color_(0), |
opacity_(1.f), |
@@ -907,6 +908,7 @@ void Layer::SetForceRenderSurface(bool force) { |
if (force_render_surface_ == force) |
return; |
force_render_surface_ = force; |
+ SetLayerPropertyChanged(); |
SetNeedsCommit(); |
} |
@@ -1137,15 +1139,13 @@ void Layer::PushPropertiesTo(LayerImpl* layer) { |
layer->SetClipTreeIndex(clip_tree_index()); |
layer->SetScrollTreeIndex(scroll_tree_index()); |
layer->set_offset_to_transform_parent(offset_to_transform_parent_); |
- layer->SetDoubleSided(double_sided_); |
layer->SetDrawsContent(DrawsContent()); |
layer->SetHideLayerAndSubtree(hide_layer_and_subtree_); |
layer->SetHasRenderSurface(has_render_surface_); |
// subtree_property_changed_ is propagated to all descendants while building |
// property trees. So, it is enough to check it only for the current layer. |
- if (subtree_property_changed_) |
+ if (subtree_property_changed_ || layer_property_changed_) |
layer->NoteLayerPropertyChanged(); |
- layer->SetForceRenderSurface(force_render_surface_); |
if (!layer->FilterIsAnimatingOnImplOnly() && !FilterIsAnimating()) |
layer->SetFilters(filters_); |
DCHECK(!(FilterIsAnimating() && layer->FilterIsAnimatingOnImplOnly())); |
@@ -1270,6 +1270,7 @@ void Layer::PushPropertiesTo(LayerImpl* layer) { |
// Reset any state that should be cleared for the next update. |
subtree_property_changed_ = false; |
+ layer_property_changed_ = false; |
update_rect_ = gfx::Rect(); |
layer_tree_host()->RemoveLayerShouldPushProperties(this); |
@@ -1411,6 +1412,7 @@ void Layer::LayerSpecificPropertiesToProto(proto::LayerProperties* proto) { |
base->set_hide_layer_and_subtree(hide_layer_and_subtree_); |
base->set_has_render_surface(has_render_surface_); |
base->set_subtree_property_changed(subtree_property_changed_); |
+ base->set_layer_property_changed(layer_property_changed_); |
// TODO(nyquist): Add support for serializing FilterOperations for |
// |filters_| and |background_filters_|. See crbug.com/541321. |
@@ -1494,7 +1496,7 @@ void Layer::FromLayerSpecificPropertiesProto( |
draws_content_ = base.draws_content(); |
hide_layer_and_subtree_ = base.hide_layer_and_subtree(); |
has_render_surface_ = base.has_render_surface(); |
- subtree_property_changed_ = base.subtree_property_changed(); |
+ layer_property_changed_ = base.layer_property_changed(); |
masks_to_bounds_ = base.masks_to_bounds(); |
main_thread_scrolling_reasons_ = base.main_thread_scrolling_reasons(); |
non_fast_scrollable_region_ = |
@@ -1641,6 +1643,13 @@ void Layer::SetSubtreePropertyChanged() { |
SetNeedsPushProperties(); |
} |
+void Layer::SetLayerPropertyChanged() { |
+ if (layer_property_changed_) |
+ return; |
+ layer_property_changed_ = true; |
+ SetNeedsPushProperties(); |
+} |
+ |
gfx::ScrollOffset Layer::ScrollOffsetForAnimation() const { |
return CurrentScrollOffset(); |
} |