| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 class LayerTreeHost; | 60 class LayerTreeHost; |
| 61 class LayerTreeHostCommon; | 61 class LayerTreeHostCommon; |
| 62 class LayerTreeImpl; | 62 class LayerTreeImpl; |
| 63 class LayerTreeSettings; | 63 class LayerTreeSettings; |
| 64 class RenderingStatsInstrumentation; | 64 class RenderingStatsInstrumentation; |
| 65 class ResourceUpdateQueue; | 65 class ResourceUpdateQueue; |
| 66 class ScrollbarLayerInterface; | 66 class ScrollbarLayerInterface; |
| 67 class SimpleEnclosedRegion; | 67 class SimpleEnclosedRegion; |
| 68 struct AnimationEvent; | 68 struct AnimationEvent; |
| 69 | 69 |
| 70 namespace proto { |
| 71 class LayerNode; |
| 72 } // proto |
| 73 |
| 70 // Base class for composited layers. Special layer types are derived from | 74 // Base class for composited layers. Special layer types are derived from |
| 71 // this class. | 75 // this class. |
| 72 class CC_EXPORT Layer : public base::RefCounted<Layer>, | 76 class CC_EXPORT Layer : public base::RefCounted<Layer>, |
| 73 public LayerAnimationValueObserver, | 77 public LayerAnimationValueObserver, |
| 74 public LayerAnimationValueProvider { | 78 public LayerAnimationValueProvider { |
| 75 public: | 79 public: |
| 76 typedef LayerList LayerListType; | 80 typedef LayerList LayerListType; |
| 81 typedef base::hash_map<int, scoped_refptr<Layer>> LayerIdMap; |
| 77 | 82 |
| 78 enum LayerIdLabels { | 83 enum LayerIdLabels { |
| 79 INVALID_ID = -1, | 84 INVALID_ID = -1, |
| 80 }; | 85 }; |
| 81 | 86 |
| 82 static scoped_refptr<Layer> Create(const LayerSettings& settings); | 87 static scoped_refptr<Layer> Create(const LayerSettings& settings); |
| 83 | 88 |
| 84 int id() const { return layer_id_; } | 89 int id() const { return layer_id_; } |
| 85 | 90 |
| 86 Layer* RootLayer(); | 91 Layer* RootLayer(); |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 virtual void SetIsMask(bool is_mask) {} | 356 virtual void SetIsMask(bool is_mask) {} |
| 352 virtual bool IsSuitableForGpuRasterization() const; | 357 virtual bool IsSuitableForGpuRasterization() const; |
| 353 | 358 |
| 354 virtual scoped_refptr<base::trace_event::ConvertableToTraceFormat> | 359 virtual scoped_refptr<base::trace_event::ConvertableToTraceFormat> |
| 355 TakeDebugInfo(); | 360 TakeDebugInfo(); |
| 356 | 361 |
| 357 void SetLayerClient(LayerClient* client) { client_ = client; } | 362 void SetLayerClient(LayerClient* client) { client_ = client; } |
| 358 | 363 |
| 359 virtual void PushPropertiesTo(LayerImpl* layer); | 364 virtual void PushPropertiesTo(LayerImpl* layer); |
| 360 | 365 |
| 366 // Recursively iterate over this layer and all children and write the |
| 367 // hierarchical structure to the given LayerNode proto. In addition to the |
| 368 // structure itself, the Layer id and type is also written to facilitate |
| 369 // construction of the correct layer on the client. |
| 370 virtual void ToLayerNodeProto(proto::LayerNode* proto); |
| 371 // Recursively iterate over the given LayerNode proto and read the structure |
| 372 // into this node and its children. The |layer_map| should be used to look |
| 373 // for previously existing Layers, since they should be re-used between each |
| 374 // hierarchy update. |
| 375 virtual void FromLayerNodeProto(const proto::LayerNode& proto, |
| 376 const LayerIdMap& layer_map); |
| 377 |
| 361 LayerTreeHost* layer_tree_host() { return layer_tree_host_; } | 378 LayerTreeHost* layer_tree_host() { return layer_tree_host_; } |
| 362 const LayerTreeHost* layer_tree_host() const { return layer_tree_host_; } | 379 const LayerTreeHost* layer_tree_host() const { return layer_tree_host_; } |
| 363 | 380 |
| 364 bool AddAnimation(scoped_ptr<Animation> animation); | 381 bool AddAnimation(scoped_ptr<Animation> animation); |
| 365 void PauseAnimation(int animation_id, double time_offset); | 382 void PauseAnimation(int animation_id, double time_offset); |
| 366 void RemoveAnimation(int animation_id); | 383 void RemoveAnimation(int animation_id); |
| 367 void RemoveAnimation(int animation_id, Animation::TargetProperty property); | 384 void RemoveAnimation(int animation_id, Animation::TargetProperty property); |
| 368 LayerAnimationController* layer_animation_controller() const { | 385 LayerAnimationController* layer_animation_controller() const { |
| 369 return layer_animation_controller_.get(); | 386 return layer_animation_controller_.get(); |
| 370 } | 387 } |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 713 | 730 |
| 714 std::vector<FrameTimingRequest> frame_timing_requests_; | 731 std::vector<FrameTimingRequest> frame_timing_requests_; |
| 715 bool frame_timing_requests_dirty_; | 732 bool frame_timing_requests_dirty_; |
| 716 | 733 |
| 717 DISALLOW_COPY_AND_ASSIGN(Layer); | 734 DISALLOW_COPY_AND_ASSIGN(Layer); |
| 718 }; | 735 }; |
| 719 | 736 |
| 720 } // namespace cc | 737 } // namespace cc |
| 721 | 738 |
| 722 #endif // CC_LAYERS_LAYER_H_ | 739 #endif // CC_LAYERS_LAYER_H_ |
| OLD | NEW |