OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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_IMPL_H_ | 5 #ifndef CC_LAYERS_LAYER_IMPL_H_ |
6 #define CC_LAYERS_LAYER_IMPL_H_ | 6 #define CC_LAYERS_LAYER_IMPL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/values.h" | 15 #include "base/values.h" |
16 #include "cc/animation/animation_delegate.h" | 16 #include "cc/animation/animation_delegate.h" |
17 #include "cc/animation/layer_animation_controller.h" | 17 #include "cc/animation/layer_animation_controller.h" |
18 #include "cc/animation/layer_animation_value_observer.h" | 18 #include "cc/animation/layer_animation_value_observer.h" |
19 #include "cc/animation/layer_animation_value_provider.h" | 19 #include "cc/animation/layer_animation_value_provider.h" |
20 #include "cc/base/cc_export.h" | 20 #include "cc/base/cc_export.h" |
21 #include "cc/base/region.h" | 21 #include "cc/base/region.h" |
22 #include "cc/base/scoped_ptr_vector.h" | |
23 #include "cc/base/synced_property.h" | 22 #include "cc/base/synced_property.h" |
24 #include "cc/debug/frame_timing_request.h" | 23 #include "cc/debug/frame_timing_request.h" |
25 #include "cc/input/input_handler.h" | 24 #include "cc/input/input_handler.h" |
26 #include "cc/layers/draw_properties.h" | 25 #include "cc/layers/draw_properties.h" |
27 #include "cc/layers/layer_lists.h" | 26 #include "cc/layers/layer_lists.h" |
28 #include "cc/layers/layer_position_constraint.h" | 27 #include "cc/layers/layer_position_constraint.h" |
29 #include "cc/layers/render_surface_impl.h" | 28 #include "cc/layers/render_surface_impl.h" |
30 #include "cc/layers/scroll_blocks_on.h" | 29 #include "cc/layers/scroll_blocks_on.h" |
31 #include "cc/output/filter_operations.h" | 30 #include "cc/output/filter_operations.h" |
32 #include "cc/quads/shared_quad_state.h" | 31 #include "cc/quads/shared_quad_state.h" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 int group) override{}; | 119 int group) override{}; |
121 void NotifyAnimationFinished(base::TimeTicks monotonic_time, | 120 void NotifyAnimationFinished(base::TimeTicks monotonic_time, |
122 Animation::TargetProperty target_property, | 121 Animation::TargetProperty target_property, |
123 int group) override; | 122 int group) override; |
124 | 123 |
125 // Tree structure. | 124 // Tree structure. |
126 LayerImpl* parent() { return parent_; } | 125 LayerImpl* parent() { return parent_; } |
127 const LayerImpl* parent() const { return parent_; } | 126 const LayerImpl* parent() const { return parent_; } |
128 const OwnedLayerImplList& children() const { return children_; } | 127 const OwnedLayerImplList& children() const { return children_; } |
129 OwnedLayerImplList& children() { return children_; } | 128 OwnedLayerImplList& children() { return children_; } |
130 LayerImpl* child_at(size_t index) const { return children_[index]; } | 129 LayerImpl* child_at(size_t index) const { return children_[index].get(); } |
131 void AddChild(scoped_ptr<LayerImpl> child); | 130 void AddChild(scoped_ptr<LayerImpl> child); |
132 scoped_ptr<LayerImpl> RemoveChild(LayerImpl* child); | 131 scoped_ptr<LayerImpl> RemoveChild(LayerImpl* child); |
133 void SetParent(LayerImpl* parent); | 132 void SetParent(LayerImpl* parent); |
134 | 133 |
135 // Warning: This does not preserve tree structure invariants. | 134 // Warning: This does not preserve tree structure invariants. |
136 void ClearChildList(); | 135 void ClearChildList(); |
137 | 136 |
138 bool HasAncestor(const LayerImpl* ancestor) const; | 137 bool HasAncestor(const LayerImpl* ancestor) const; |
139 | 138 |
140 void SetScrollParent(LayerImpl* parent); | 139 void SetScrollParent(LayerImpl* parent); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 return clip_parent_; | 213 return clip_parent_; |
215 } | 214 } |
216 | 215 |
217 void SetClipChildren(std::set<LayerImpl*>* children); | 216 void SetClipChildren(std::set<LayerImpl*>* children); |
218 | 217 |
219 std::set<LayerImpl*>* clip_children() { return clip_children_.get(); } | 218 std::set<LayerImpl*>* clip_children() { return clip_children_.get(); } |
220 const std::set<LayerImpl*>* clip_children() const { | 219 const std::set<LayerImpl*>* clip_children() const { |
221 return clip_children_.get(); | 220 return clip_children_.get(); |
222 } | 221 } |
223 | 222 |
224 void PassCopyRequests(ScopedPtrVector<CopyOutputRequest>* requests); | 223 void PassCopyRequests(std::vector<scoped_ptr<CopyOutputRequest>>* requests); |
225 // Can only be called when the layer has a copy request. | 224 // Can only be called when the layer has a copy request. |
226 void TakeCopyRequestsAndTransformToTarget( | 225 void TakeCopyRequestsAndTransformToTarget( |
227 ScopedPtrVector<CopyOutputRequest>* request); | 226 std::vector<scoped_ptr<CopyOutputRequest>>* request); |
228 bool HasCopyRequest() const { return !copy_requests_.empty(); } | 227 bool HasCopyRequest() const { return !copy_requests_.empty(); } |
229 | 228 |
230 void SetMaskLayer(scoped_ptr<LayerImpl> mask_layer); | 229 void SetMaskLayer(scoped_ptr<LayerImpl> mask_layer); |
231 LayerImpl* mask_layer() { return mask_layer_.get(); } | 230 LayerImpl* mask_layer() { return mask_layer_.get(); } |
232 const LayerImpl* mask_layer() const { return mask_layer_.get(); } | 231 const LayerImpl* mask_layer() const { return mask_layer_.get(); } |
233 scoped_ptr<LayerImpl> TakeMaskLayer(); | 232 scoped_ptr<LayerImpl> TakeMaskLayer(); |
234 | 233 |
235 void SetReplicaLayer(scoped_ptr<LayerImpl> replica_layer); | 234 void SetReplicaLayer(scoped_ptr<LayerImpl> replica_layer); |
236 LayerImpl* replica_layer() { return replica_layer_.get(); } | 235 LayerImpl* replica_layer() { return replica_layer_.get(); } |
237 const LayerImpl* replica_layer() const { return replica_layer_.get(); } | 236 const LayerImpl* replica_layer() const { return replica_layer_.get(); } |
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
841 // This is in the layer's space. | 840 // This is in the layer's space. |
842 gfx::Rect update_rect_; | 841 gfx::Rect update_rect_; |
843 | 842 |
844 // Denotes an area that is damaged and needs redraw. This is in the layer's | 843 // Denotes an area that is damaged and needs redraw. This is in the layer's |
845 // space. | 844 // space. |
846 gfx::Rect damage_rect_; | 845 gfx::Rect damage_rect_; |
847 | 846 |
848 // Manages animations for this layer. | 847 // Manages animations for this layer. |
849 scoped_refptr<LayerAnimationController> layer_animation_controller_; | 848 scoped_refptr<LayerAnimationController> layer_animation_controller_; |
850 | 849 |
851 ScopedPtrVector<CopyOutputRequest> copy_requests_; | 850 std::vector<scoped_ptr<CopyOutputRequest>> copy_requests_; |
852 | 851 |
853 // Group of properties that need to be computed based on the layer tree | 852 // Group of properties that need to be computed based on the layer tree |
854 // hierarchy before layers can be drawn. | 853 // hierarchy before layers can be drawn. |
855 DrawProperties draw_properties_; | 854 DrawProperties draw_properties_; |
856 | 855 |
857 scoped_refptr<base::trace_event::ConvertableToTraceFormat> debug_info_; | 856 scoped_refptr<base::trace_event::ConvertableToTraceFormat> debug_info_; |
858 scoped_ptr<RenderSurfaceImpl> render_surface_; | 857 scoped_ptr<RenderSurfaceImpl> render_surface_; |
859 | 858 |
860 std::vector<FrameTimingRequest> frame_timing_requests_; | 859 std::vector<FrameTimingRequest> frame_timing_requests_; |
861 int num_layer_or_descendants_with_copy_request_; | 860 int num_layer_or_descendants_with_copy_request_; |
862 bool frame_timing_requests_dirty_; | 861 bool frame_timing_requests_dirty_; |
863 bool visited_; | 862 bool visited_; |
864 bool layer_or_descendant_is_drawn_; | 863 bool layer_or_descendant_is_drawn_; |
865 // If true, the layer or one of its descendants has a wheel or touch handler. | 864 // If true, the layer or one of its descendants has a wheel or touch handler. |
866 bool layer_or_descendant_has_input_handler_; | 865 bool layer_or_descendant_has_input_handler_; |
867 bool sorted_for_recursion_; | 866 bool sorted_for_recursion_; |
868 | 867 |
869 DISALLOW_COPY_AND_ASSIGN(LayerImpl); | 868 DISALLOW_COPY_AND_ASSIGN(LayerImpl); |
870 }; | 869 }; |
871 | 870 |
872 } // namespace cc | 871 } // namespace cc |
873 | 872 |
874 #endif // CC_LAYERS_LAYER_IMPL_H_ | 873 #endif // CC_LAYERS_LAYER_IMPL_H_ |
OLD | NEW |