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 <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/values.h" | 13 #include "base/values.h" |
14 #include "cc/animation/layer_animation_controller.h" | 14 #include "cc/animation/layer_animation_controller.h" |
15 #include "cc/animation/layer_animation_value_observer.h" | 15 #include "cc/animation/layer_animation_value_observer.h" |
| 16 #include "cc/animation/layer_animation_value_provider.h" |
16 #include "cc/base/cc_export.h" | 17 #include "cc/base/cc_export.h" |
17 #include "cc/base/region.h" | 18 #include "cc/base/region.h" |
18 #include "cc/base/scoped_ptr_vector.h" | 19 #include "cc/base/scoped_ptr_vector.h" |
19 #include "cc/input/input_handler.h" | 20 #include "cc/input/input_handler.h" |
20 #include "cc/layers/compositing_reasons.h" | 21 #include "cc/layers/compositing_reasons.h" |
21 #include "cc/layers/draw_properties.h" | 22 #include "cc/layers/draw_properties.h" |
22 #include "cc/layers/layer_lists.h" | 23 #include "cc/layers/layer_lists.h" |
23 #include "cc/layers/layer_position_constraint.h" | 24 #include "cc/layers/layer_position_constraint.h" |
24 #include "cc/layers/render_surface_impl.h" | 25 #include "cc/layers/render_surface_impl.h" |
25 #include "cc/output/filter_operations.h" | 26 #include "cc/output/filter_operations.h" |
(...skipping 25 matching lines...) Expand all Loading... |
51 | 52 |
52 struct AppendQuadsData; | 53 struct AppendQuadsData; |
53 | 54 |
54 enum DrawMode { | 55 enum DrawMode { |
55 DRAW_MODE_NONE, | 56 DRAW_MODE_NONE, |
56 DRAW_MODE_HARDWARE, | 57 DRAW_MODE_HARDWARE, |
57 DRAW_MODE_SOFTWARE, | 58 DRAW_MODE_SOFTWARE, |
58 DRAW_MODE_RESOURCELESS_SOFTWARE | 59 DRAW_MODE_RESOURCELESS_SOFTWARE |
59 }; | 60 }; |
60 | 61 |
61 class CC_EXPORT LayerImpl : LayerAnimationValueObserver { | 62 class CC_EXPORT LayerImpl : public LayerAnimationValueObserver, |
| 63 public LayerAnimationValueProvider { |
62 public: | 64 public: |
63 typedef LayerImplList RenderSurfaceListType; | 65 typedef LayerImplList RenderSurfaceListType; |
64 typedef LayerImplList LayerListType; | 66 typedef LayerImplList LayerListType; |
65 typedef RenderSurfaceImpl RenderSurfaceType; | 67 typedef RenderSurfaceImpl RenderSurfaceType; |
66 | 68 |
67 static scoped_ptr<LayerImpl> Create(LayerTreeImpl* tree_impl, int id) { | 69 static scoped_ptr<LayerImpl> Create(LayerTreeImpl* tree_impl, int id) { |
68 return make_scoped_ptr(new LayerImpl(tree_impl, id)); | 70 return make_scoped_ptr(new LayerImpl(tree_impl, id)); |
69 } | 71 } |
70 | 72 |
71 virtual ~LayerImpl(); | 73 virtual ~LayerImpl(); |
72 | 74 |
73 int id() const { return layer_id_; } | 75 int id() const { return layer_id_; } |
74 | 76 |
| 77 // LayerAnimationValueProvider implementation. |
| 78 virtual gfx::Vector2dF ScrollOffsetForAnimation() const OVERRIDE; |
| 79 |
75 // LayerAnimationValueObserver implementation. | 80 // LayerAnimationValueObserver implementation. |
76 virtual void OnFilterAnimated(const FilterOperations& filters) OVERRIDE; | 81 virtual void OnFilterAnimated(const FilterOperations& filters) OVERRIDE; |
77 virtual void OnOpacityAnimated(float opacity) OVERRIDE; | 82 virtual void OnOpacityAnimated(float opacity) OVERRIDE; |
78 virtual void OnTransformAnimated(const gfx::Transform& transform) OVERRIDE; | 83 virtual void OnTransformAnimated(const gfx::Transform& transform) OVERRIDE; |
| 84 virtual void OnScrollOffsetAnimated(gfx::Vector2dF scroll_offset) OVERRIDE; |
79 virtual void OnAnimationWaitingForDeletion() OVERRIDE; | 85 virtual void OnAnimationWaitingForDeletion() OVERRIDE; |
80 virtual bool IsActive() const OVERRIDE; | 86 virtual bool IsActive() const OVERRIDE; |
81 | 87 |
82 // Tree structure. | 88 // Tree structure. |
83 LayerImpl* parent() { return parent_; } | 89 LayerImpl* parent() { return parent_; } |
84 const LayerImpl* parent() const { return parent_; } | 90 const LayerImpl* parent() const { return parent_; } |
85 const OwnedLayerImplList& children() const { return children_; } | 91 const OwnedLayerImplList& children() const { return children_; } |
86 OwnedLayerImplList& children() { return children_; } | 92 OwnedLayerImplList& children() { return children_; } |
87 LayerImpl* child_at(size_t index) const { return children_[index]; } | 93 LayerImpl* child_at(size_t index) const { return children_[index]; } |
88 void AddChild(scoped_ptr<LayerImpl> child); | 94 void AddChild(scoped_ptr<LayerImpl> child); |
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
644 // Group of properties that need to be computed based on the layer tree | 650 // Group of properties that need to be computed based on the layer tree |
645 // hierarchy before layers can be drawn. | 651 // hierarchy before layers can be drawn. |
646 DrawProperties<LayerImpl> draw_properties_; | 652 DrawProperties<LayerImpl> draw_properties_; |
647 | 653 |
648 DISALLOW_COPY_AND_ASSIGN(LayerImpl); | 654 DISALLOW_COPY_AND_ASSIGN(LayerImpl); |
649 }; | 655 }; |
650 | 656 |
651 } // namespace cc | 657 } // namespace cc |
652 | 658 |
653 #endif // CC_LAYERS_LAYER_IMPL_H_ | 659 #endif // CC_LAYERS_LAYER_IMPL_H_ |
OLD | NEW |