OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_LAYER_TREE_IMPL_H_ | 5 #ifndef CC_LAYER_TREE_IMPL_H_ |
6 #define CC_LAYER_TREE_IMPL_H_ | 6 #define CC_LAYER_TREE_IMPL_H_ |
7 | 7 |
8 #include "base/hash_tables.h" | 8 #include "base/hash_tables.h" |
9 #include "cc/layer_impl.h" | 9 #include "cc/layer_impl.h" |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 class DebugRectHistory; | 24 class DebugRectHistory; |
25 class FrameRateCounter; | 25 class FrameRateCounter; |
26 class HeadsUpDisplayLayerImpl; | 26 class HeadsUpDisplayLayerImpl; |
27 class LayerTreeDebugState; | 27 class LayerTreeDebugState; |
28 class LayerTreeHostImpl; | 28 class LayerTreeHostImpl; |
29 class LayerTreeImpl; | 29 class LayerTreeImpl; |
30 class LayerTreeSettings; | 30 class LayerTreeSettings; |
31 class OutputSurface; | 31 class OutputSurface; |
32 class PinchZoomViewport; | 32 class PinchZoomViewport; |
| 33 class Proxy; |
33 class ResourceProvider; | 34 class ResourceProvider; |
34 class TileManager; | 35 class TileManager; |
35 | 36 |
36 class CC_EXPORT LayerTreeImpl { | 37 class CC_EXPORT LayerTreeImpl { |
37 public: | 38 public: |
38 typedef std::vector<LayerImpl*> LayerList; | 39 typedef std::vector<LayerImpl*> LayerList; |
39 | 40 |
40 static scoped_ptr<LayerTreeImpl> create(LayerTreeHostImpl* layer_tree_host_imp
l) | 41 static scoped_ptr<LayerTreeImpl> create(LayerTreeHostImpl* layer_tree_host_imp
l) |
41 { | 42 { |
42 return make_scoped_ptr(new LayerTreeImpl(layer_tree_host_impl)); | 43 return make_scoped_ptr(new LayerTreeImpl(layer_tree_host_impl)); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 int source_frame_number() const { return source_frame_number_; } | 82 int source_frame_number() const { return source_frame_number_; } |
82 void set_source_frame_number(int frame_number) { | 83 void set_source_frame_number(int frame_number) { |
83 source_frame_number_ = frame_number; | 84 source_frame_number_ = frame_number; |
84 } | 85 } |
85 | 86 |
86 HeadsUpDisplayLayerImpl* hud_layer() { return hud_layer_; } | 87 HeadsUpDisplayLayerImpl* hud_layer() { return hud_layer_; } |
87 void set_hud_layer(HeadsUpDisplayLayerImpl* layer_impl) { | 88 void set_hud_layer(HeadsUpDisplayLayerImpl* layer_impl) { |
88 hud_layer_ = layer_impl; | 89 hud_layer_ = layer_impl; |
89 } | 90 } |
90 | 91 |
91 LayerImpl* root_scroll_layer() { return root_scroll_layer_; } | 92 LayerImpl* RootScrollLayer(); |
92 const LayerImpl* root_scroll_layer() const { return root_scroll_layer_; } | 93 LayerImpl* CurrentlyScrollingLayer(); |
93 void set_root_scroll_layer(LayerImpl* layer_impl) { | 94 void set_currently_scrolling_layer(LayerImpl* layer) { |
94 root_scroll_layer_ = layer_impl; | 95 currently_scrolling_layer_ = layer; |
95 } | 96 } |
96 | 97 |
97 LayerImpl* currently_scrolling_layer() { return currently_scrolling_layer_; } | |
98 void set_currently_scrolling_layer(LayerImpl* layer_impl) { | |
99 currently_scrolling_layer_ = layer_impl; | |
100 } | |
101 | |
102 void FindRootScrollLayer(); | |
103 void ClearCurrentlyScrollingLayer(); | 98 void ClearCurrentlyScrollingLayer(); |
104 | 99 |
105 void UpdateMaxScrollOffset(); | 100 void UpdateMaxScrollOffset(); |
106 | 101 |
107 SkColor background_color() const { return background_color_; } | 102 SkColor background_color() const { return background_color_; } |
108 void set_background_color(SkColor color) { background_color_ = color; } | 103 void set_background_color(SkColor color) { background_color_ = color; } |
109 | 104 |
110 bool has_transparent_background() const { | 105 bool has_transparent_background() const { |
111 return has_transparent_background_; | 106 return has_transparent_background_; |
112 } | 107 } |
(...skipping 20 matching lines...) Expand all Loading... |
133 | 128 |
134 AnimationRegistrar* animationRegistrar() const; | 129 AnimationRegistrar* animationRegistrar() const; |
135 | 130 |
136 void PushPersistedState(LayerTreeImpl* pendingTree); | 131 void PushPersistedState(LayerTreeImpl* pendingTree); |
137 | 132 |
138 void DidBecomeActive(); | 133 void DidBecomeActive(); |
139 | 134 |
140 protected: | 135 protected: |
141 LayerTreeImpl(LayerTreeHostImpl* layer_tree_host_impl); | 136 LayerTreeImpl(LayerTreeHostImpl* layer_tree_host_impl); |
142 | 137 |
| 138 void FindRootScrollLayer(); |
| 139 |
143 LayerTreeHostImpl* layer_tree_host_impl_; | 140 LayerTreeHostImpl* layer_tree_host_impl_; |
144 int source_frame_number_; | 141 int source_frame_number_; |
145 scoped_ptr<LayerImpl> root_layer_; | 142 scoped_ptr<LayerImpl> root_layer_; |
146 HeadsUpDisplayLayerImpl* hud_layer_; | 143 HeadsUpDisplayLayerImpl* hud_layer_; |
147 LayerImpl* root_scroll_layer_; | 144 LayerImpl* root_scroll_layer_; |
148 LayerImpl* currently_scrolling_layer_; | 145 LayerImpl* currently_scrolling_layer_; |
149 SkColor background_color_; | 146 SkColor background_color_; |
150 bool has_transparent_background_; | 147 bool has_transparent_background_; |
151 | 148 |
152 typedef base::hash_map<int, LayerImpl*> LayerIdMap; | 149 typedef base::hash_map<int, LayerImpl*> LayerIdMap; |
153 LayerIdMap layer_id_map_; | 150 LayerIdMap layer_id_map_; |
154 | 151 |
155 // Persisted state for non-impl-side-painting. | 152 // Persisted state for non-impl-side-painting. |
156 int scrolling_layer_id_from_previous_tree_; | 153 int scrolling_layer_id_from_previous_tree_; |
157 | 154 |
158 // List of visible layers for the most recently prepared frame. Used for | 155 // List of visible layers for the most recently prepared frame. Used for |
159 // rendering and input event hit testing. | 156 // rendering and input event hit testing. |
160 LayerList render_surface_layer_list_; | 157 LayerList render_surface_layer_list_; |
161 | 158 |
162 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); | 159 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); |
163 }; | 160 }; |
164 | 161 |
165 } | 162 } |
166 | 163 |
167 #endif // CC_LAYER_TREE_IMPL_H_ | 164 #endif // CC_LAYER_TREE_IMPL_H_ |
OLD | NEW |