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

Side by Side Diff: cc/layers/layer.h

Issue 2375363002: cc/blimp: Set up the framework for state serialization. (Closed)
Patch Set: Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2010 The Chromium Authors. All rights reserved. 1 // Copyright 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CC_LAYERS_LAYER_H_ 5 #ifndef CC_LAYERS_LAYER_H_
6 #define CC_LAYERS_LAYER_H_ 6 #define CC_LAYERS_LAYER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 // for previously existing Layers, since they should be re-used between each 382 // for previously existing Layers, since they should be re-used between each
383 // hierarchy update. 383 // hierarchy update.
384 void FromLayerNodeProto(const proto::LayerNode& proto, 384 void FromLayerNodeProto(const proto::LayerNode& proto,
385 const LayerIdMap& layer_map, 385 const LayerIdMap& layer_map,
386 LayerTreeHost* layer_tree_host); 386 LayerTreeHost* layer_tree_host);
387 387
388 // This method is similar to PushPropertiesTo, but instead of pushing to 388 // This method is similar to PushPropertiesTo, but instead of pushing to
389 // a LayerImpl, it pushes the properties to proto::LayerProperties. It is 389 // a LayerImpl, it pushes the properties to proto::LayerProperties. It is
390 // called only on layers that have changed properties. The properties 390 // called only on layers that have changed properties. The properties
391 // themselves are pushed to proto::LayerProperties. 391 // themselves are pushed to proto::LayerProperties.
392 void ToLayerPropertiesProto(proto::LayerUpdate* layer_update); 392 void ToLayerPropertiesProto(proto::LayerUpdate* layer_update,
393 bool inputs_only);
393 394
394 // Read all property values from the given LayerProperties object and update 395 // Read all property values from the given LayerProperties object and update
395 // the current layer. The values for |needs_push_properties_| and 396 // the current layer. The values for |needs_push_properties_| and
396 // |num_dependents_need_push_properties_| are always updated, but the rest 397 // |num_dependents_need_push_properties_| are always updated, but the rest
397 // of |proto| is only read if |needs_push_properties_| is set. 398 // of |proto| is only read if |needs_push_properties_| is set.
398 void FromLayerPropertiesProto(const proto::LayerProperties& proto); 399 void FromLayerPropertiesProto(const proto::LayerProperties& proto);
399 400
400 LayerTreeHost* GetLayerTreeHostForTesting() const { return layer_tree_host_; } 401 LayerTreeHost* GetLayerTreeHostForTesting() const { return layer_tree_host_; }
401 LayerTree* GetLayerTree() const; 402 LayerTree* GetLayerTree() const;
402 403
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 539
539 // Called when the layer's number of drawable descendants changes. 540 // Called when the layer's number of drawable descendants changes.
540 void AddDrawableDescendants(int num); 541 void AddDrawableDescendants(int num);
541 542
542 bool IsPropertyChangeAllowed() const; 543 bool IsPropertyChangeAllowed() const;
543 544
544 // Serialize all the necessary properties to be able to reconstruct this Layer 545 // Serialize all the necessary properties to be able to reconstruct this Layer
545 // into proto::LayerProperties. This method is not marked as const 546 // into proto::LayerProperties. This method is not marked as const
546 // as some implementations need reset member fields, similarly to 547 // as some implementations need reset member fields, similarly to
547 // PushPropertiesTo(). 548 // PushPropertiesTo().
548 virtual void LayerSpecificPropertiesToProto(proto::LayerProperties* proto); 549 virtual void LayerSpecificPropertiesToProto(proto::LayerProperties* proto,
550 bool inputs_only);
549 551
550 // Deserialize all the necessary properties from proto::LayerProperties into 552 // Deserialize all the necessary properties from proto::LayerProperties into
551 // this Layer. 553 // this Layer.
552 virtual void FromLayerSpecificPropertiesProto( 554 virtual void FromLayerSpecificPropertiesProto(
553 const proto::LayerProperties& proto); 555 const proto::LayerProperties& proto);
554 556
555 gfx::Rect& update_rect() { return inputs_.update_rect; } 557 gfx::Rect& update_rect() { return inputs_.update_rect; }
556 558
557 // When true, the layer is about to perform an update. Any commit requests 559 // When true, the layer is about to perform an update. Any commit requests
558 // will be handled implicitly after the update completes. 560 // will be handled implicitly after the update completes.
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
738 // These all act like draw properties, so don't need push properties. 740 // These all act like draw properties, so don't need push properties.
739 gfx::Rect visible_layer_rect_; 741 gfx::Rect visible_layer_rect_;
740 size_t num_unclipped_descendants_; 742 size_t num_unclipped_descendants_;
741 743
742 DISALLOW_COPY_AND_ASSIGN(Layer); 744 DISALLOW_COPY_AND_ASSIGN(Layer);
743 }; 745 };
744 746
745 } // namespace cc 747 } // namespace cc
746 748
747 #endif // CC_LAYERS_LAYER_H_ 749 #endif // CC_LAYERS_LAYER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698