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_TREES_LAYER_TREE_IMPL_H_ | 5 #ifndef CC_TREES_LAYER_TREE_IMPL_H_ |
6 #define CC_TREES_LAYER_TREE_IMPL_H_ | 6 #define CC_TREES_LAYER_TREE_IMPL_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 26 matching lines...) Expand all Loading... |
37 class LayerTreeSettings; | 37 class LayerTreeSettings; |
38 class MemoryHistory; | 38 class MemoryHistory; |
39 class OutputSurface; | 39 class OutputSurface; |
40 class PageScaleAnimation; | 40 class PageScaleAnimation; |
41 class PaintTimeCounter; | 41 class PaintTimeCounter; |
42 class PictureLayerImpl; | 42 class PictureLayerImpl; |
43 class Proxy; | 43 class Proxy; |
44 class ResourceProvider; | 44 class ResourceProvider; |
45 class TileManager; | 45 class TileManager; |
46 class UIResourceRequest; | 46 class UIResourceRequest; |
| 47 struct PendingPageScaleAnimation; |
47 struct RendererCapabilities; | 48 struct RendererCapabilities; |
48 struct SelectionHandle; | 49 struct SelectionHandle; |
49 | 50 |
50 typedef std::list<UIResourceRequest> UIResourceRequestQueue; | 51 typedef std::list<UIResourceRequest> UIResourceRequestQueue; |
51 | 52 |
52 class CC_EXPORT LayerTreeImpl { | 53 class CC_EXPORT LayerTreeImpl { |
53 public: | 54 public: |
54 static scoped_ptr<LayerTreeImpl> create( | 55 static scoped_ptr<LayerTreeImpl> create( |
55 LayerTreeHostImpl* layer_tree_host_impl) { | 56 LayerTreeHostImpl* layer_tree_host_impl) { |
56 return make_scoped_ptr(new LayerTreeImpl(layer_tree_host_impl)); | 57 return make_scoped_ptr(new LayerTreeImpl(layer_tree_host_impl)); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 gfx::ScrollOffset TotalScrollOffset() const; | 131 gfx::ScrollOffset TotalScrollOffset() const; |
131 gfx::ScrollOffset TotalMaxScrollOffset() const; | 132 gfx::ScrollOffset TotalMaxScrollOffset() const; |
132 gfx::Vector2dF TotalScrollDelta() const; | 133 gfx::Vector2dF TotalScrollDelta() const; |
133 | 134 |
134 LayerImpl* InnerViewportContainerLayer() const; | 135 LayerImpl* InnerViewportContainerLayer() const; |
135 LayerImpl* OuterViewportContainerLayer() const; | 136 LayerImpl* OuterViewportContainerLayer() const; |
136 LayerImpl* CurrentlyScrollingLayer() const; | 137 LayerImpl* CurrentlyScrollingLayer() const; |
137 void SetCurrentlyScrollingLayer(LayerImpl* layer); | 138 void SetCurrentlyScrollingLayer(LayerImpl* layer); |
138 void ClearCurrentlyScrollingLayer(); | 139 void ClearCurrentlyScrollingLayer(); |
139 | 140 |
140 void SetViewportLayersFromIds(int page_scale_layer_id, | 141 void SetViewportLayersFromIds(int overscroll_elasticity_layer, |
| 142 int page_scale_layer_id, |
141 int inner_viewport_scroll_layer_id, | 143 int inner_viewport_scroll_layer_id, |
142 int outer_viewport_scroll_layer_id); | 144 int outer_viewport_scroll_layer_id); |
143 void ClearViewportLayers(); | 145 void ClearViewportLayers(); |
| 146 LayerImpl* overscroll_elasticity_layer() { |
| 147 return overscroll_elasticity_layer_; |
| 148 } |
144 LayerImpl* page_scale_layer() { return page_scale_layer_; } | 149 LayerImpl* page_scale_layer() { return page_scale_layer_; } |
145 void ApplySentScrollAndScaleDeltasFromAbortedCommit(); | 150 void ApplySentScrollAndScaleDeltasFromAbortedCommit(); |
146 void ApplyScrollDeltasSinceBeginMainFrame(); | 151 void ApplyScrollDeltasSinceBeginMainFrame(); |
147 | 152 |
148 SkColor background_color() const { return background_color_; } | 153 SkColor background_color() const { return background_color_; } |
149 void set_background_color(SkColor color) { background_color_ = color; } | 154 void set_background_color(SkColor color) { background_color_ = color; } |
150 | 155 |
151 bool has_transparent_background() const { | 156 bool has_transparent_background() const { |
152 return has_transparent_background_; | 157 return has_transparent_background_; |
153 } | 158 } |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 float top_controls_delta() const { | 308 float top_controls_delta() const { |
304 return top_controls_delta_; | 309 return top_controls_delta_; |
305 } | 310 } |
306 float sent_top_controls_delta() const { | 311 float sent_top_controls_delta() const { |
307 return sent_top_controls_delta_; | 312 return sent_top_controls_delta_; |
308 } | 313 } |
309 float total_top_controls_content_offset() const { | 314 float total_top_controls_content_offset() const { |
310 return top_controls_content_offset_ + top_controls_delta_; | 315 return top_controls_content_offset_ + top_controls_delta_; |
311 } | 316 } |
312 | 317 |
313 void SetPageScaleAnimation( | 318 void SetPendingPageScaleAnimation( |
314 const gfx::Vector2d& target_offset, | 319 scoped_ptr<PendingPageScaleAnimation> pending_animation); |
315 bool anchor_point, | 320 scoped_ptr<PendingPageScaleAnimation> TakePendingPageScaleAnimation(); |
316 float page_scale, | |
317 base::TimeDelta duration); | |
318 scoped_ptr<PageScaleAnimation> TakePageScaleAnimation(); | |
319 | 321 |
320 protected: | 322 protected: |
321 explicit LayerTreeImpl(LayerTreeHostImpl* layer_tree_host_impl); | 323 explicit LayerTreeImpl(LayerTreeHostImpl* layer_tree_host_impl); |
322 void ReleaseResourcesRecursive(LayerImpl* current); | 324 void ReleaseResourcesRecursive(LayerImpl* current); |
323 | 325 |
324 LayerTreeHostImpl* layer_tree_host_impl_; | 326 LayerTreeHostImpl* layer_tree_host_impl_; |
325 int source_frame_number_; | 327 int source_frame_number_; |
326 scoped_ptr<LayerImpl> root_layer_; | 328 scoped_ptr<LayerImpl> root_layer_; |
327 HeadsUpDisplayLayerImpl* hud_layer_; | 329 HeadsUpDisplayLayerImpl* hud_layer_; |
328 LayerImpl* currently_scrolling_layer_; | 330 LayerImpl* currently_scrolling_layer_; |
329 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate_; | 331 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate_; |
330 scoped_ptr<LayerScrollOffsetDelegateProxy> | 332 scoped_ptr<LayerScrollOffsetDelegateProxy> |
331 inner_viewport_scroll_delegate_proxy_; | 333 inner_viewport_scroll_delegate_proxy_; |
332 scoped_ptr<LayerScrollOffsetDelegateProxy> | 334 scoped_ptr<LayerScrollOffsetDelegateProxy> |
333 outer_viewport_scroll_delegate_proxy_; | 335 outer_viewport_scroll_delegate_proxy_; |
334 SkColor background_color_; | 336 SkColor background_color_; |
335 bool has_transparent_background_; | 337 bool has_transparent_background_; |
336 | 338 |
| 339 LayerImpl* overscroll_elasticity_layer_; |
337 LayerImpl* page_scale_layer_; | 340 LayerImpl* page_scale_layer_; |
338 LayerImpl* inner_viewport_scroll_layer_; | 341 LayerImpl* inner_viewport_scroll_layer_; |
339 LayerImpl* outer_viewport_scroll_layer_; | 342 LayerImpl* outer_viewport_scroll_layer_; |
340 | 343 |
341 LayerSelectionBound selection_start_; | 344 LayerSelectionBound selection_start_; |
342 LayerSelectionBound selection_end_; | 345 LayerSelectionBound selection_end_; |
343 | 346 |
344 float page_scale_factor_; | 347 float page_scale_factor_; |
345 float page_scale_delta_; | 348 float page_scale_delta_; |
346 float sent_page_scale_delta_; | 349 float sent_page_scale_delta_; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 // viewport resize) in Blink. i.e. How much the viewport was shrunk by the top | 383 // viewport resize) in Blink. i.e. How much the viewport was shrunk by the top |
381 // controls. | 384 // controls. |
382 float top_controls_layout_height_; | 385 float top_controls_layout_height_; |
383 | 386 |
384 // The up-to-date content offset of the top controls, i.e. the amount that the | 387 // The up-to-date content offset of the top controls, i.e. the amount that the |
385 // web contents have been shifted down from the top of the device viewport. | 388 // web contents have been shifted down from the top of the device viewport. |
386 float top_controls_content_offset_; | 389 float top_controls_content_offset_; |
387 float top_controls_delta_; | 390 float top_controls_delta_; |
388 float sent_top_controls_delta_; | 391 float sent_top_controls_delta_; |
389 | 392 |
390 scoped_ptr<PageScaleAnimation> page_scale_animation_; | 393 scoped_ptr<PendingPageScaleAnimation> pending_page_scale_animation_; |
391 | 394 |
392 private: | 395 private: |
393 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); | 396 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); |
394 }; | 397 }; |
395 | 398 |
396 } // namespace cc | 399 } // namespace cc |
397 | 400 |
398 #endif // CC_TREES_LAYER_TREE_IMPL_H_ | 401 #endif // CC_TREES_LAYER_TREE_IMPL_H_ |
OLD | NEW |