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

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

Issue 2375363002: cc/blimp: Set up the framework for state serialization. (Closed)
Patch Set: test update 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
« no previous file with comments | « cc/blimp/layer_tree_host_remote.cc ('k') | cc/layers/layer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 // for previously existing Layers, since they should be re-used between each 372 // for previously existing Layers, since they should be re-used between each
373 // hierarchy update. 373 // hierarchy update.
374 void FromLayerNodeProto(const proto::LayerNode& proto, 374 void FromLayerNodeProto(const proto::LayerNode& proto,
375 const LayerIdMap& layer_map, 375 const LayerIdMap& layer_map,
376 LayerTreeHost* layer_tree_host); 376 LayerTreeHost* layer_tree_host);
377 377
378 // This method is similar to PushPropertiesTo, but instead of pushing to 378 // This method is similar to PushPropertiesTo, but instead of pushing to
379 // a LayerImpl, it pushes the properties to proto::LayerProperties. It is 379 // a LayerImpl, it pushes the properties to proto::LayerProperties. It is
380 // called only on layers that have changed properties. The properties 380 // called only on layers that have changed properties. The properties
381 // themselves are pushed to proto::LayerProperties. 381 // themselves are pushed to proto::LayerProperties.
382 void ToLayerPropertiesProto(proto::LayerUpdate* layer_update); 382 void ToLayerPropertiesProto(proto::LayerUpdate* layer_update,
383 bool inputs_only);
383 384
384 // Read all property values from the given LayerProperties object and update 385 // Read all property values from the given LayerProperties object and update
385 // the current layer. The values for |needs_push_properties_| and 386 // the current layer. The values for |needs_push_properties_| and
386 // |num_dependents_need_push_properties_| are always updated, but the rest 387 // |num_dependents_need_push_properties_| are always updated, but the rest
387 // of |proto| is only read if |needs_push_properties_| is set. 388 // of |proto| is only read if |needs_push_properties_| is set.
388 void FromLayerPropertiesProto(const proto::LayerProperties& proto); 389 void FromLayerPropertiesProto(const proto::LayerProperties& proto);
389 390
390 LayerTreeHost* GetLayerTreeHostForTesting() const { return layer_tree_host_; } 391 LayerTreeHost* GetLayerTreeHostForTesting() const { return layer_tree_host_; }
391 LayerTree* GetLayerTree() const; 392 LayerTree* GetLayerTree() const;
392 393
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 AnimationHost* GetAnimationHost() const; 487 AnimationHost* GetAnimationHost() const;
487 488
488 ElementListType GetElementTypeForAnimation() const; 489 ElementListType GetElementTypeForAnimation() const;
489 490
490 protected: 491 protected:
491 friend class LayerImpl; 492 friend class LayerImpl;
492 friend class TreeSynchronizer; 493 friend class TreeSynchronizer;
493 virtual ~Layer(); 494 virtual ~Layer();
494 Layer(); 495 Layer();
495 496
497 // Tests in remote mode need to explicitly set the layer id so it matches the
498 // layer id for the corresponding Layer on the engine.
499 explicit Layer(int layer_id);
500
496 LayerTreeHost* layer_tree_host() { return layer_tree_host_; } 501 LayerTreeHost* layer_tree_host() { return layer_tree_host_; }
497 const LayerTreeHost* layer_tree_host() const { return layer_tree_host_; } 502 const LayerTreeHost* layer_tree_host() const { return layer_tree_host_; }
498 503
499 // These SetNeeds functions are in order of severity of update: 504 // These SetNeeds functions are in order of severity of update:
500 // 505 //
501 // Called when this layer has been modified in some way, but isn't sure 506 // Called when this layer has been modified in some way, but isn't sure
502 // that it needs a commit yet. It needs CalcDrawProperties and UpdateLayers 507 // that it needs a commit yet. It needs CalcDrawProperties and UpdateLayers
503 // before it knows whether or not a commit is required. 508 // before it knows whether or not a commit is required.
504 void SetNeedsUpdate(); 509 void SetNeedsUpdate();
505 // Called when a property has been modified in a way that the layer 510 // Called when a property has been modified in a way that the layer
(...skipping 19 matching lines...) Expand all
525 530
526 // Called when the layer's number of drawable descendants changes. 531 // Called when the layer's number of drawable descendants changes.
527 void AddDrawableDescendants(int num); 532 void AddDrawableDescendants(int num);
528 533
529 bool IsPropertyChangeAllowed() const; 534 bool IsPropertyChangeAllowed() const;
530 535
531 // Serialize all the necessary properties to be able to reconstruct this Layer 536 // Serialize all the necessary properties to be able to reconstruct this Layer
532 // into proto::LayerProperties. This method is not marked as const 537 // into proto::LayerProperties. This method is not marked as const
533 // as some implementations need reset member fields, similarly to 538 // as some implementations need reset member fields, similarly to
534 // PushPropertiesTo(). 539 // PushPropertiesTo().
535 virtual void LayerSpecificPropertiesToProto(proto::LayerProperties* proto); 540 virtual void LayerSpecificPropertiesToProto(proto::LayerProperties* proto,
541 bool inputs_only);
536 542
537 // Deserialize all the necessary properties from proto::LayerProperties into 543 // Deserialize all the necessary properties from proto::LayerProperties into
538 // this Layer. 544 // this Layer.
539 virtual void FromLayerSpecificPropertiesProto( 545 virtual void FromLayerSpecificPropertiesProto(
540 const proto::LayerProperties& proto); 546 const proto::LayerProperties& proto);
541 547
542 gfx::Rect& update_rect() { return inputs_.update_rect; } 548 gfx::Rect& update_rect() { return inputs_.update_rect; }
543 549
544 // When true, the layer is about to perform an update. Any commit requests 550 // When true, the layer is about to perform an update. Any commit requests
545 // will be handled implicitly after the update completes. 551 // will be handled implicitly after the update completes.
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 596
591 // When we detach or attach layer to new LayerTreeHost, all property trees' 597 // When we detach or attach layer to new LayerTreeHost, all property trees'
592 // indices becomes invalid. 598 // indices becomes invalid.
593 void InvalidatePropertyTreesIndices(); 599 void InvalidatePropertyTreesIndices();
594 600
595 // Encapsulates all data, callbacks or interfaces received from the embedder. 601 // Encapsulates all data, callbacks or interfaces received from the embedder.
596 // TODO(khushalsagar): This is only valid when PropertyTrees are built 602 // TODO(khushalsagar): This is only valid when PropertyTrees are built
597 // internally in cc. Update this for the SPv2 path where blink generates 603 // internally in cc. Update this for the SPv2 path where blink generates
598 // PropertyTrees. 604 // PropertyTrees.
599 struct Inputs { 605 struct Inputs {
600 Inputs(); 606 explicit Inputs(int layer_id);
601 ~Inputs(); 607 ~Inputs();
602 608
603 int layer_id; 609 int layer_id;
604 610
605 LayerList children; 611 LayerList children;
606 612
607 // The update rect is the region of the compositor resource that was 613 // The update rect is the region of the compositor resource that was
608 // actually updated by the compositor. For layers that may do updating 614 // actually updated by the compositor. For layers that may do updating
609 // outside the compositor's control (i.e. plugin layers), this information 615 // outside the compositor's control (i.e. plugin layers), this information
610 // is not available and the update rect will remain empty. 616 // is not available and the update rect will remain empty.
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
718 // These all act like draw properties, so don't need push properties. 724 // These all act like draw properties, so don't need push properties.
719 gfx::Rect visible_layer_rect_; 725 gfx::Rect visible_layer_rect_;
720 size_t num_unclipped_descendants_; 726 size_t num_unclipped_descendants_;
721 727
722 DISALLOW_COPY_AND_ASSIGN(Layer); 728 DISALLOW_COPY_AND_ASSIGN(Layer);
723 }; 729 };
724 730
725 } // namespace cc 731 } // namespace cc
726 732
727 #endif // CC_LAYERS_LAYER_H_ 733 #endif // CC_LAYERS_LAYER_H_
OLDNEW
« no previous file with comments | « cc/blimp/layer_tree_host_remote.cc ('k') | cc/layers/layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698