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 <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 | 51 |
52 namespace cc { | 52 namespace cc { |
53 | 53 |
54 class Animation; | 54 class Animation; |
55 class AnimationDelegate; | 55 class AnimationDelegate; |
56 struct AnimationEvent; | 56 struct AnimationEvent; |
57 class CopyOutputRequest; | 57 class CopyOutputRequest; |
58 class LayerAnimationEventObserver; | 58 class LayerAnimationEventObserver; |
59 class LayerClient; | 59 class LayerClient; |
60 class LayerImpl; | 60 class LayerImpl; |
| 61 class LayerSettings; |
61 class LayerTreeHost; | 62 class LayerTreeHost; |
62 class LayerTreeHostCommon; | 63 class LayerTreeHostCommon; |
63 class LayerTreeImpl; | 64 class LayerTreeImpl; |
64 class PriorityCalculator; | 65 class PriorityCalculator; |
65 class RenderingStatsInstrumentation; | 66 class RenderingStatsInstrumentation; |
66 class ResourceUpdateQueue; | 67 class ResourceUpdateQueue; |
67 class ScrollbarLayerInterface; | 68 class ScrollbarLayerInterface; |
68 class SimpleEnclosedRegion; | 69 class SimpleEnclosedRegion; |
69 struct AnimationEvent; | 70 struct AnimationEvent; |
70 template <typename LayerType> | 71 template <typename LayerType> |
71 class OcclusionTracker; | 72 class OcclusionTracker; |
72 | 73 |
73 // Base class for composited layers. Special layer types are derived from | 74 // Base class for composited layers. Special layer types are derived from |
74 // this class. | 75 // this class. |
75 class CC_EXPORT Layer : public base::RefCounted<Layer>, | 76 class CC_EXPORT Layer : public base::RefCounted<Layer>, |
76 public LayerAnimationValueObserver, | 77 public LayerAnimationValueObserver, |
77 public LayerAnimationValueProvider { | 78 public LayerAnimationValueProvider { |
78 public: | 79 public: |
79 typedef RenderSurfaceLayerList RenderSurfaceListType; | 80 typedef RenderSurfaceLayerList RenderSurfaceListType; |
80 typedef LayerList LayerListType; | 81 typedef LayerList LayerListType; |
81 typedef RenderSurface RenderSurfaceType; | 82 typedef RenderSurface RenderSurfaceType; |
82 | 83 |
83 enum LayerIdLabels { | 84 enum LayerIdLabels { |
84 INVALID_ID = -1, | 85 INVALID_ID = -1, |
85 }; | 86 }; |
86 | 87 |
87 static scoped_refptr<Layer> Create(); | 88 static scoped_refptr<Layer> Create(const LayerSettings& settings); |
88 | 89 |
89 int id() const { return layer_id_; } | 90 int id() const { return layer_id_; } |
90 | 91 |
91 Layer* RootLayer(); | 92 Layer* RootLayer(); |
92 Layer* parent() { return parent_; } | 93 Layer* parent() { return parent_; } |
93 const Layer* parent() const { return parent_; } | 94 const Layer* parent() const { return parent_; } |
94 void AddChild(scoped_refptr<Layer> child); | 95 void AddChild(scoped_refptr<Layer> child); |
95 void InsertChild(scoped_refptr<Layer> child, size_t index); | 96 void InsertChild(scoped_refptr<Layer> child, size_t index); |
96 void ReplaceChild(Layer* reference, scoped_refptr<Layer> new_layer); | 97 void ReplaceChild(Layer* reference, scoped_refptr<Layer> new_layer); |
97 void RemoveFromParent(); | 98 void RemoveFromParent(); |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 | 558 |
558 int num_layer_or_descendants_with_input_handler() { | 559 int num_layer_or_descendants_with_input_handler() { |
559 return num_layer_or_descendants_with_input_handler_; | 560 return num_layer_or_descendants_with_input_handler_; |
560 } | 561 } |
561 | 562 |
562 protected: | 563 protected: |
563 friend class LayerImpl; | 564 friend class LayerImpl; |
564 friend class TreeSynchronizer; | 565 friend class TreeSynchronizer; |
565 ~Layer() override; | 566 ~Layer() override; |
566 | 567 |
567 Layer(); | 568 explicit Layer(const LayerSettings& settings); |
568 | 569 |
569 // These SetNeeds functions are in order of severity of update: | 570 // These SetNeeds functions are in order of severity of update: |
570 // | 571 // |
571 // Called when this layer has been modified in some way, but isn't sure | 572 // Called when this layer has been modified in some way, but isn't sure |
572 // that it needs a commit yet. It needs CalcDrawProperties and UpdateLayers | 573 // that it needs a commit yet. It needs CalcDrawProperties and UpdateLayers |
573 // before it knows whether or not a commit is required. | 574 // before it knows whether or not a commit is required. |
574 void SetNeedsUpdate(); | 575 void SetNeedsUpdate(); |
575 // Called when a property has been modified in a way that the layer | 576 // Called when a property has been modified in a way that the layer |
576 // knows immediately that a commit is required. This implies SetNeedsUpdate | 577 // knows immediately that a commit is required. This implies SetNeedsUpdate |
577 // as well as SetNeedsPushProperties to push that property. | 578 // as well as SetNeedsPushProperties to push that property. |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
766 | 767 |
767 std::vector<FrameTimingRequest> frame_timing_requests_; | 768 std::vector<FrameTimingRequest> frame_timing_requests_; |
768 bool frame_timing_requests_dirty_; | 769 bool frame_timing_requests_dirty_; |
769 | 770 |
770 DISALLOW_COPY_AND_ASSIGN(Layer); | 771 DISALLOW_COPY_AND_ASSIGN(Layer); |
771 }; | 772 }; |
772 | 773 |
773 } // namespace cc | 774 } // namespace cc |
774 | 775 |
775 #endif // CC_LAYERS_LAYER_H_ | 776 #endif // CC_LAYERS_LAYER_H_ |
OLD | NEW |