OLD | NEW |
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 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 // called only on layers that have changed properties. The properties | 384 // called only on layers that have changed properties. The properties |
385 // themselves are pushed to proto::LayerProperties. | 385 // themselves are pushed to proto::LayerProperties. |
386 void ToLayerPropertiesProto(proto::LayerUpdate* layer_update); | 386 void ToLayerPropertiesProto(proto::LayerUpdate* layer_update); |
387 | 387 |
388 // Read all property values from the given LayerProperties object and update | 388 // Read all property values from the given LayerProperties object and update |
389 // the current layer. The values for |needs_push_properties_| and | 389 // the current layer. The values for |needs_push_properties_| and |
390 // |num_dependents_need_push_properties_| are always updated, but the rest | 390 // |num_dependents_need_push_properties_| are always updated, but the rest |
391 // of |proto| is only read if |needs_push_properties_| is set. | 391 // of |proto| is only read if |needs_push_properties_| is set. |
392 void FromLayerPropertiesProto(const proto::LayerProperties& proto); | 392 void FromLayerPropertiesProto(const proto::LayerProperties& proto); |
393 | 393 |
394 LayerTreeHost* layer_tree_host() { return layer_tree_host_; } | 394 LayerTreeHost* GetLayerTreeHostForTesting() const { return layer_tree_host_; } |
395 const LayerTreeHost* layer_tree_host() const { return layer_tree_host_; } | |
396 LayerTree* GetLayerTree() const; | 395 LayerTree* GetLayerTree() const; |
397 | 396 |
398 virtual ScrollbarLayerInterface* ToScrollbarLayer(); | 397 virtual ScrollbarLayerInterface* ToScrollbarLayer(); |
399 | 398 |
400 virtual sk_sp<SkPicture> GetPicture() const; | 399 virtual sk_sp<SkPicture> GetPicture() const; |
401 | 400 |
402 // Constructs a LayerImpl of the correct runtime type for this Layer type. | 401 // Constructs a LayerImpl of the correct runtime type for this Layer type. |
403 virtual std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl); | 402 virtual std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl); |
404 | 403 |
405 bool NeedsDisplayForTesting() const { return !inputs_.update_rect.IsEmpty(); } | 404 bool NeedsDisplayForTesting() const { return !inputs_.update_rect.IsEmpty(); } |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 AnimationHost* GetAnimationHost() const; | 493 AnimationHost* GetAnimationHost() const; |
495 | 494 |
496 ElementListType GetElementTypeForAnimation() const; | 495 ElementListType GetElementTypeForAnimation() const; |
497 | 496 |
498 protected: | 497 protected: |
499 friend class LayerImpl; | 498 friend class LayerImpl; |
500 friend class TreeSynchronizer; | 499 friend class TreeSynchronizer; |
501 virtual ~Layer(); | 500 virtual ~Layer(); |
502 Layer(); | 501 Layer(); |
503 | 502 |
| 503 LayerTreeHost* layer_tree_host() { return layer_tree_host_; } |
| 504 const LayerTreeHost* layer_tree_host() const { return layer_tree_host_; } |
| 505 |
504 // These SetNeeds functions are in order of severity of update: | 506 // These SetNeeds functions are in order of severity of update: |
505 // | 507 // |
506 // Called when this layer has been modified in some way, but isn't sure | 508 // Called when this layer has been modified in some way, but isn't sure |
507 // that it needs a commit yet. It needs CalcDrawProperties and UpdateLayers | 509 // that it needs a commit yet. It needs CalcDrawProperties and UpdateLayers |
508 // before it knows whether or not a commit is required. | 510 // before it knows whether or not a commit is required. |
509 void SetNeedsUpdate(); | 511 void SetNeedsUpdate(); |
510 // Called when a property has been modified in a way that the layer | 512 // Called when a property has been modified in a way that the layer |
511 // knows immediately that a commit is required. This implies SetNeedsUpdate | 513 // knows immediately that a commit is required. This implies SetNeedsUpdate |
512 // as well as SetNeedsPushProperties to push that property. | 514 // as well as SetNeedsPushProperties to push that property. |
513 void SetNeedsCommit(); | 515 void SetNeedsCommit(); |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
728 // These all act like draw properties, so don't need push properties. | 730 // These all act like draw properties, so don't need push properties. |
729 gfx::Rect visible_layer_rect_; | 731 gfx::Rect visible_layer_rect_; |
730 size_t num_unclipped_descendants_; | 732 size_t num_unclipped_descendants_; |
731 | 733 |
732 DISALLOW_COPY_AND_ASSIGN(Layer); | 734 DISALLOW_COPY_AND_ASSIGN(Layer); |
733 }; | 735 }; |
734 | 736 |
735 } // namespace cc | 737 } // namespace cc |
736 | 738 |
737 #endif // CC_LAYERS_LAYER_H_ | 739 #endif // CC_LAYERS_LAYER_H_ |
OLD | NEW |