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

Unified Diff: cc/layers/layer.h

Issue 1808373002: cc : Make tree synchronization independent of layer tree hierarchy (2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « no previous file | cc/layers/layer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer.h
diff --git a/cc/layers/layer.h b/cc/layers/layer.h
index 64540492fc8c5c561f5b61c1e3a0eb185b8189fe..300540108f625801f73a1d7cd7f2684b4e62b217 100644
--- a/cc/layers/layer.h
+++ b/cc/layers/layer.h
@@ -384,14 +384,10 @@ class CC_EXPORT Layer : public base::RefCounted<Layer> {
const LayerIdMap& layer_map);
// This method is similar to PushPropertiesTo, but instead of pushing to
- // a LayerImpl, it pushes the properties to proto::LayerProperties. It adds
- // this layer to the proto::LayerUpdate if it or any of its descendants
- // have changed properties. If this layer contains changed properties, the
- // properties themselves will also be pushed the proto::LayerProperties.
- // Similarly to PushPropertiesTo, this method also resets
- // |needs_push_properties_| and |num_dependents_need_push_properties_|.
- // Returns whether any of the descendants have changed properties.
- bool ToLayerPropertiesProto(proto::LayerUpdate* layer_update);
+ // a LayerImpl, it pushes the properties to proto::LayerProperties. It is
+ // called only on layers that have changed properties. The properties
+ // themselves are pushed to proto::LayerProperties.
+ void ToLayerPropertiesProto(proto::LayerUpdate* layer_update);
// Read all property values from the given LayerProperties object and update
// the current layer. The values for |needs_push_properties_| and
@@ -419,13 +415,7 @@ class CC_EXPORT Layer : public base::RefCounted<Layer> {
}
void SetNeedsPushProperties();
- bool needs_push_properties() const { return needs_push_properties_; }
- bool descendant_needs_push_properties() const {
- return num_dependents_need_push_properties_ > 0;
- }
- void reset_needs_push_properties_for_testing() {
- needs_push_properties_ = false;
- }
+ void ResetNeedsPushPropertiesForTesting();
virtual void RunMicroBenchmark(MicroBenchmark* benchmark);
@@ -562,39 +552,20 @@ class CC_EXPORT Layer : public base::RefCounted<Layer> {
void AddDependentNeedsPushProperties();
void RemoveDependentNeedsPushProperties();
- bool parent_should_know_need_push_properties() const {
- return needs_push_properties() || descendant_needs_push_properties();
- }
bool IsPropertyChangeAllowed() const;
// Serialize all the necessary properties to be able to reconstruct this Layer
- // into proto::LayerProperties. This function must not set values for
- // |needs_push_properties_| or |num_dependents_need_push_properties_| as they
- // are dealt with at a higher level. This is only called if
- // |needs_push_properties_| is set. For descendants of Layer, implementations
- // must first call their parent class. This method is not marked as const
+ // into proto::LayerProperties. This method is not marked as const
// as some implementations need reset member fields, similarly to
// PushPropertiesTo().
virtual void LayerSpecificPropertiesToProto(proto::LayerProperties* proto);
// Deserialize all the necessary properties from proto::LayerProperties into
- // this Layer. This function must not set values for |needs_push_properties_|
- // or |num_dependents_need_push_properties_| as they are dealt with at a
- // higher level. This is only called if |needs_push_properties_| is set. For
- // descendants of Layer, implementations must first call their parent class.
+ // this Layer.
virtual void FromLayerSpecificPropertiesProto(
const proto::LayerProperties& proto);
- // This flag is set when the layer needs to push properties to the impl
- // side.
- bool needs_push_properties_;
-
- // The number of direct children or dependent layers that need to be recursed
- // to in order for them or a descendent of them to push properties to the impl
- // side.
- int num_dependents_need_push_properties_;
-
// The update rect is the region of the compositor resource that was
// actually updated by the compositor. For layers that may do updating
// outside the compositor's control (i.e. plugin layers), this information
« no previous file with comments | « no previous file | cc/layers/layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698