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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 base::TimeTicks CurrentFrameTime() const; | 64 base::TimeTicks CurrentFrameTime() const; |
65 | 65 |
66 // Tree specific methods exposed to layer-impl tree. | 66 // Tree specific methods exposed to layer-impl tree. |
67 // --------------------------------------------------------------------------- | 67 // --------------------------------------------------------------------------- |
68 void SetNeedsRedraw(); | 68 void SetNeedsRedraw(); |
69 | 69 |
70 // TODO(nduca): These are implemented in cc files temporarily, but will become | 70 // TODO(nduca): These are implemented in cc files temporarily, but will become |
71 // trivial accessors in a followup patch. | 71 // trivial accessors in a followup patch. |
72 const LayerTreeDebugState& debug_state() const; | 72 const LayerTreeDebugState& debug_state() const; |
73 float device_scale_factor() const; | 73 float device_scale_factor() const; |
74 const gfx::Size& device_viewport_size() const; | |
75 const gfx::Size& layout_viewport_size() const; | |
76 std::string layer_tree_as_text() const; | 74 std::string layer_tree_as_text() const; |
77 DebugRectHistory* debug_rect_history() const; | 75 DebugRectHistory* debug_rect_history() const; |
78 | 76 |
79 // Other public methods | 77 // Other public methods |
80 // --------------------------------------------------------------------------- | 78 // --------------------------------------------------------------------------- |
81 LayerImpl* RootLayer() const { return root_layer_.get(); } | 79 LayerImpl* RootLayer() const { return root_layer_.get(); } |
82 void SetRootLayer(scoped_ptr<LayerImpl>); | 80 void SetRootLayer(scoped_ptr<LayerImpl>); |
83 scoped_ptr<LayerImpl> DetachLayerTree(); | 81 scoped_ptr<LayerImpl> DetachLayerTree(); |
84 | 82 |
85 void pushPropertiesTo(LayerTreeImpl*); | 83 void pushPropertiesTo(LayerTreeImpl*); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 } | 129 } |
132 float page_scale_factor() const { return page_scale_factor_; } | 130 float page_scale_factor() const { return page_scale_factor_; } |
133 float min_page_scale_factor() const { return min_page_scale_factor_; } | 131 float min_page_scale_factor() const { return min_page_scale_factor_; } |
134 float max_page_scale_factor() const { return max_page_scale_factor_; } | 132 float max_page_scale_factor() const { return max_page_scale_factor_; } |
135 float page_scale_delta() const { return page_scale_delta_; } | 133 float page_scale_delta() const { return page_scale_delta_; } |
136 void set_sent_page_scale_delta(float delta) { | 134 void set_sent_page_scale_delta(float delta) { |
137 sent_page_scale_delta_ = delta; | 135 sent_page_scale_delta_ = delta; |
138 } | 136 } |
139 float sent_page_scale_delta() const { return sent_page_scale_delta_; } | 137 float sent_page_scale_delta() const { return sent_page_scale_delta_; } |
140 | 138 |
| 139 void SetViewportSize(gfx::Size layout_viewport_size, gfx::Size device_viewport
_size); |
| 140 const gfx::Size& layout_viewport_size() const { return layout_viewport_size_;
} |
| 141 const gfx::Size& device_viewport_size() const { return device_viewport_size_;
} |
| 142 |
141 // Updates draw properties and render surface layer list | 143 // Updates draw properties and render surface layer list |
142 void UpdateDrawProperties(UpdateDrawPropertiesReason reason); | 144 void UpdateDrawProperties(UpdateDrawPropertiesReason reason); |
143 void set_needs_update_draw_properties() { | 145 void set_needs_update_draw_properties() { |
144 needs_update_draw_properties_ = true; | 146 needs_update_draw_properties_ = true; |
145 } | 147 } |
146 bool needs_update_draw_properties() const { | 148 bool needs_update_draw_properties() const { |
147 return needs_update_draw_properties_; | 149 return needs_update_draw_properties_; |
148 } | 150 } |
149 | 151 |
150 void set_needs_full_tree_sync(bool needs) { needs_full_tree_sync_ = needs; } | 152 void set_needs_full_tree_sync(bool needs) { needs_full_tree_sync_ = needs; } |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 LayerImpl* currently_scrolling_layer_; | 193 LayerImpl* currently_scrolling_layer_; |
192 SkColor background_color_; | 194 SkColor background_color_; |
193 bool has_transparent_background_; | 195 bool has_transparent_background_; |
194 | 196 |
195 float page_scale_factor_; | 197 float page_scale_factor_; |
196 float page_scale_delta_; | 198 float page_scale_delta_; |
197 float sent_page_scale_delta_; | 199 float sent_page_scale_delta_; |
198 float min_page_scale_factor_; | 200 float min_page_scale_factor_; |
199 float max_page_scale_factor_; | 201 float max_page_scale_factor_; |
200 | 202 |
| 203 gfx::Size device_viewport_size_; |
| 204 gfx::Size layout_viewport_size_; |
| 205 |
201 typedef base::hash_map<int, LayerImpl*> LayerIdMap; | 206 typedef base::hash_map<int, LayerImpl*> LayerIdMap; |
202 LayerIdMap layer_id_map_; | 207 LayerIdMap layer_id_map_; |
203 | 208 |
204 // Persisted state for non-impl-side-painting. | 209 // Persisted state for non-impl-side-painting. |
205 int scrolling_layer_id_from_previous_tree_; | 210 int scrolling_layer_id_from_previous_tree_; |
206 | 211 |
207 // List of visible layers for the most recently prepared frame. Used for | 212 // List of visible layers for the most recently prepared frame. Used for |
208 // rendering and input event hit testing. | 213 // rendering and input event hit testing. |
209 LayerList render_surface_layer_list_; | 214 LayerList render_surface_layer_list_; |
210 | 215 |
211 bool contents_textures_purged_; | 216 bool contents_textures_purged_; |
212 bool needs_update_draw_properties_; | 217 bool needs_update_draw_properties_; |
213 | 218 |
214 // In impl-side painting mode, this is true when the tree may contain | 219 // In impl-side painting mode, this is true when the tree may contain |
215 // structural differences relative to the active tree. | 220 // structural differences relative to the active tree. |
216 bool needs_full_tree_sync_; | 221 bool needs_full_tree_sync_; |
217 | 222 |
218 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); | 223 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); |
219 }; | 224 }; |
220 | 225 |
221 } | 226 } |
222 | 227 |
223 #endif // CC_LAYER_TREE_IMPL_H_ | 228 #endif // CC_LAYER_TREE_IMPL_H_ |
OLD | NEW |