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 "base/values.h" | 9 #include "base/values.h" |
10 #include "cc/layer_impl.h" | 10 #include "cc/layer_impl.h" |
(...skipping 16 matching lines...) Expand all Loading... | |
27 class HeadsUpDisplayLayerImpl; | 27 class HeadsUpDisplayLayerImpl; |
28 class LayerTreeDebugState; | 28 class LayerTreeDebugState; |
29 class LayerTreeHostImpl; | 29 class LayerTreeHostImpl; |
30 class LayerTreeImpl; | 30 class LayerTreeImpl; |
31 class LayerTreeSettings; | 31 class LayerTreeSettings; |
32 class MemoryHistory; | 32 class MemoryHistory; |
33 class OutputSurface; | 33 class OutputSurface; |
34 class PaintTimeCounter; | 34 class PaintTimeCounter; |
35 class Proxy; | 35 class Proxy; |
36 class ResourceProvider; | 36 class ResourceProvider; |
37 class ScrollbarLayerImpl; | |
37 class TileManager; | 38 class TileManager; |
38 struct RendererCapabilities; | 39 struct RendererCapabilities; |
39 | 40 |
40 class CC_EXPORT LayerTreeImpl { | 41 class CC_EXPORT LayerTreeImpl { |
41 public: | 42 public: |
42 typedef std::vector<LayerImpl*> LayerList; | 43 typedef std::vector<LayerImpl*> LayerList; |
43 | 44 |
44 static scoped_ptr<LayerTreeImpl> create(LayerTreeHostImpl* layer_tree_host_imp l) | 45 static scoped_ptr<LayerTreeImpl> create(LayerTreeHostImpl* layer_tree_host_imp l) |
45 { | 46 { |
46 return make_scoped_ptr(new LayerTreeImpl(layer_tree_host_impl)); | 47 return make_scoped_ptr(new LayerTreeImpl(layer_tree_host_impl)); |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
183 | 184 |
184 // Set on the active tree when the viewport size recently changed | 185 // Set on the active tree when the viewport size recently changed |
185 // and the active tree's size is now out of date. | 186 // and the active tree's size is now out of date. |
186 bool ViewportSizeInvalid() const; | 187 bool ViewportSizeInvalid() const; |
187 void SetViewportSizeInvalid(); | 188 void SetViewportSizeInvalid(); |
188 void ResetViewportSizeInvalid(); | 189 void ResetViewportSizeInvalid(); |
189 | 190 |
190 // Useful for debug assertions, probably shouldn't be used for anything else. | 191 // Useful for debug assertions, probably shouldn't be used for anything else. |
191 Proxy* proxy() const; | 192 Proxy* proxy() const; |
192 | 193 |
194 void SetPinchZoomHorizontalLayerId(int layer_id); | |
195 ScrollbarLayerImpl* PinchZoomScrollbarHorizontal(); | |
196 void SetPinchZoomVerticalLayerId(int layer_id); | |
197 ScrollbarLayerImpl* PinchZoomScrollbarVertical(); | |
198 | |
199 enum PinchZoomScrollbarUpdateReason { | |
enne (OOO)
2013/03/06 19:32:58
What's the purpose of this enum? Are you just emul
wjmaclean
2013/03/06 22:36:53
I was hoping that it might reduce the number of pa
enne (OOO)
2013/03/06 22:45:38
Paints? Isn't all the painting done on the main th
wjmaclean
2013/03/07 22:57:39
Yes, but I was concerned about updates on the impl
enne (OOO)
2013/03/07 23:41:17
I think you're being overly cautious. I don't see
| |
200 UPDATE_IMPL_THREAD_SCROLL, | |
201 UPDATE_MAIN_THREAD_SCROLL | |
202 }; | |
203 | |
204 void UpdatePinchZoomScrollbarsIfNeeded( | |
205 PinchZoomScrollbarUpdateReason update_reason); | |
206 void FadeInPinchZoomScrollbars(); | |
207 void FadeOutPinchZoomScrollbars(); | |
208 | |
209 bool HasPinchZoomScrollbars() { | |
210 return pinch_zoom_scrollbar_horizontal_layer_id && | |
211 pinch_zoom_scrollbar_vertical_layer_id; | |
212 } | |
213 | |
193 protected: | 214 protected: |
194 LayerTreeImpl(LayerTreeHostImpl* layer_tree_host_impl); | 215 LayerTreeImpl(LayerTreeHostImpl* layer_tree_host_impl); |
195 | 216 |
196 LayerTreeHostImpl* layer_tree_host_impl_; | 217 LayerTreeHostImpl* layer_tree_host_impl_; |
197 int source_frame_number_; | 218 int source_frame_number_; |
198 scoped_ptr<LayerImpl> root_layer_; | 219 scoped_ptr<LayerImpl> root_layer_; |
199 HeadsUpDisplayLayerImpl* hud_layer_; | 220 HeadsUpDisplayLayerImpl* hud_layer_; |
200 LayerImpl* root_scroll_layer_; | 221 LayerImpl* root_scroll_layer_; |
201 LayerImpl* currently_scrolling_layer_; | 222 LayerImpl* currently_scrolling_layer_; |
202 SkColor background_color_; | 223 SkColor background_color_; |
203 bool has_transparent_background_; | 224 bool has_transparent_background_; |
204 | 225 |
226 int pinch_zoom_scrollbar_horizontal_layer_id; | |
enne (OOO)
2013/03/06 19:32:58
style nit: member variables end with trailing unde
wjmaclean
2013/03/06 22:36:53
Thanks, missed that!
Done.
| |
227 int pinch_zoom_scrollbar_vertical_layer_id; | |
228 | |
205 float page_scale_factor_; | 229 float page_scale_factor_; |
206 float page_scale_delta_; | 230 float page_scale_delta_; |
207 float sent_page_scale_delta_; | 231 float sent_page_scale_delta_; |
208 float min_page_scale_factor_; | 232 float min_page_scale_factor_; |
209 float max_page_scale_factor_; | 233 float max_page_scale_factor_; |
210 | 234 |
211 typedef base::hash_map<int, LayerImpl*> LayerIdMap; | 235 typedef base::hash_map<int, LayerImpl*> LayerIdMap; |
212 LayerIdMap layer_id_map_; | 236 LayerIdMap layer_id_map_; |
213 | 237 |
214 // Persisted state for non-impl-side-painting. | 238 // Persisted state for non-impl-side-painting. |
(...skipping 10 matching lines...) Expand all Loading... | |
225 // In impl-side painting mode, this is true when the tree may contain | 249 // In impl-side painting mode, this is true when the tree may contain |
226 // structural differences relative to the active tree. | 250 // structural differences relative to the active tree. |
227 bool needs_full_tree_sync_; | 251 bool needs_full_tree_sync_; |
228 | 252 |
229 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); | 253 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); |
230 }; | 254 }; |
231 | 255 |
232 } | 256 } |
233 | 257 |
234 #endif // CC_LAYER_TREE_IMPL_H_ | 258 #endif // CC_LAYER_TREE_IMPL_H_ |
OLD | NEW |