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 <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 15 matching lines...) Expand all Loading... |
26 class TracedValue; | 26 class TracedValue; |
27 } | 27 } |
28 } | 28 } |
29 | 29 |
30 namespace cc { | 30 namespace cc { |
31 | 31 |
32 class ContextProvider; | 32 class ContextProvider; |
33 class DebugRectHistory; | 33 class DebugRectHistory; |
34 class FrameRateCounter; | 34 class FrameRateCounter; |
35 class HeadsUpDisplayLayerImpl; | 35 class HeadsUpDisplayLayerImpl; |
36 class LayerScrollOffsetDelegateProxy; | 36 class LayerExternalScrollOffsetListener; |
| 37 class LayerScrollOffsetDelegate; |
37 class LayerTreeDebugState; | 38 class LayerTreeDebugState; |
38 class LayerTreeImpl; | 39 class LayerTreeImpl; |
39 class LayerTreeSettings; | 40 class LayerTreeSettings; |
40 class MemoryHistory; | 41 class MemoryHistory; |
41 class OutputSurface; | 42 class OutputSurface; |
42 class PageScaleAnimation; | 43 class PageScaleAnimation; |
43 class PaintTimeCounter; | 44 class PaintTimeCounter; |
44 class PictureLayerImpl; | 45 class PictureLayerImpl; |
45 class Proxy; | 46 class Proxy; |
46 class ResourceProvider; | 47 class ResourceProvider; |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 int source_frame_number() const { return source_frame_number_; } | 132 int source_frame_number() const { return source_frame_number_; } |
132 void set_source_frame_number(int frame_number) { | 133 void set_source_frame_number(int frame_number) { |
133 source_frame_number_ = frame_number; | 134 source_frame_number_ = frame_number; |
134 } | 135 } |
135 | 136 |
136 HeadsUpDisplayLayerImpl* hud_layer() { return hud_layer_; } | 137 HeadsUpDisplayLayerImpl* hud_layer() { return hud_layer_; } |
137 void set_hud_layer(HeadsUpDisplayLayerImpl* layer_impl) { | 138 void set_hud_layer(HeadsUpDisplayLayerImpl* layer_impl) { |
138 hud_layer_ = layer_impl; | 139 hud_layer_ = layer_impl; |
139 } | 140 } |
140 | 141 |
| 142 // This function may return NULL, it is the caller's responsibility to check. |
141 LayerImpl* InnerViewportScrollLayer() const; | 143 LayerImpl* InnerViewportScrollLayer() const; |
142 // This function may return NULL, it is the caller's responsibility to check. | 144 // This function may return NULL, it is the caller's responsibility to check. |
143 LayerImpl* OuterViewportScrollLayer() const; | 145 LayerImpl* OuterViewportScrollLayer() const; |
144 gfx::ScrollOffset TotalScrollOffset() const; | 146 gfx::ScrollOffset TotalScrollOffset() const; |
145 gfx::ScrollOffset TotalMaxScrollOffset() const; | 147 gfx::ScrollOffset TotalMaxScrollOffset() const; |
146 | 148 |
147 LayerImpl* InnerViewportContainerLayer() const; | 149 LayerImpl* InnerViewportContainerLayer() const; |
148 LayerImpl* OuterViewportContainerLayer() const; | 150 LayerImpl* OuterViewportContainerLayer() const; |
149 LayerImpl* CurrentlyScrollingLayer() const; | 151 LayerImpl* CurrentlyScrollingLayer() const; |
150 void SetCurrentlyScrollingLayer(LayerImpl* layer); | 152 void SetCurrentlyScrollingLayer(LayerImpl* layer); |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 // and the active tree's size is now out of date. | 258 // and the active tree's size is now out of date. |
257 bool ViewportSizeInvalid() const; | 259 bool ViewportSizeInvalid() const; |
258 void SetViewportSizeInvalid(); | 260 void SetViewportSizeInvalid(); |
259 void ResetViewportSizeInvalid(); | 261 void ResetViewportSizeInvalid(); |
260 | 262 |
261 // Useful for debug assertions, probably shouldn't be used for anything else. | 263 // Useful for debug assertions, probably shouldn't be used for anything else. |
262 Proxy* proxy() const; | 264 Proxy* proxy() const; |
263 | 265 |
264 void SetRootLayerScrollOffsetDelegate( | 266 void SetRootLayerScrollOffsetDelegate( |
265 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate); | 267 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate); |
266 void OnRootLayerDelegatedScrollOffsetChanged(); | 268 void UpdateRootScrollOffsetDelegate(); |
267 void UpdateScrollOffsetDelegate(); | 269 // Distribute the rool scroll between outer and inner viewport scroll layer. |
268 gfx::ScrollOffset GetDelegatedScrollOffset(LayerImpl* layer); | 270 // The outer viewport scroll layer scrolls first. |
| 271 void DistributeRootScrollOffset(); |
269 | 272 |
270 // Call this function when you expect there to be a swap buffer. | 273 // Call this function when you expect there to be a swap buffer. |
271 // See swap_promise.h for how to use SwapPromise. | 274 // See swap_promise.h for how to use SwapPromise. |
272 void QueueSwapPromise(scoped_ptr<SwapPromise> swap_promise); | 275 void QueueSwapPromise(scoped_ptr<SwapPromise> swap_promise); |
273 | 276 |
274 // Take the |new_swap_promise| and append it to |swap_promise_list_|. | 277 // Take the |new_swap_promise| and append it to |swap_promise_list_|. |
275 void PassSwapPromises(ScopedPtrVector<SwapPromise>* new_swap_promise); | 278 void PassSwapPromises(ScopedPtrVector<SwapPromise>* new_swap_promise); |
276 void FinishSwapPromises(CompositorFrameMetadata* metadata); | 279 void FinishSwapPromises(CompositorFrameMetadata* metadata); |
277 void BreakSwapPromises(SwapPromise::DidNotSwapReason reason); | 280 void BreakSwapPromises(SwapPromise::DidNotSwapReason reason); |
278 | 281 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 float max_page_scale_factor); | 351 float max_page_scale_factor); |
349 void DidUpdatePageScale(); | 352 void DidUpdatePageScale(); |
350 void HideInnerViewportScrollbarsIfNearMinimumScale(); | 353 void HideInnerViewportScrollbarsIfNearMinimumScale(); |
351 void PushTopControls(const float* top_controls_shown_ratio); | 354 void PushTopControls(const float* top_controls_shown_ratio); |
352 LayerTreeHostImpl* layer_tree_host_impl_; | 355 LayerTreeHostImpl* layer_tree_host_impl_; |
353 int source_frame_number_; | 356 int source_frame_number_; |
354 scoped_ptr<LayerImpl> root_layer_; | 357 scoped_ptr<LayerImpl> root_layer_; |
355 HeadsUpDisplayLayerImpl* hud_layer_; | 358 HeadsUpDisplayLayerImpl* hud_layer_; |
356 LayerImpl* currently_scrolling_layer_; | 359 LayerImpl* currently_scrolling_layer_; |
357 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate_; | 360 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate_; |
358 scoped_ptr<LayerScrollOffsetDelegateProxy> | 361 scoped_ptr<LayerExternalScrollOffsetListener> layer_scroll_offset_listener_; |
359 inner_viewport_scroll_delegate_proxy_; | |
360 scoped_ptr<LayerScrollOffsetDelegateProxy> | |
361 outer_viewport_scroll_delegate_proxy_; | |
362 SkColor background_color_; | 362 SkColor background_color_; |
363 bool has_transparent_background_; | 363 bool has_transparent_background_; |
364 | 364 |
365 LayerImpl* overscroll_elasticity_layer_; | 365 LayerImpl* overscroll_elasticity_layer_; |
366 LayerImpl* page_scale_layer_; | 366 LayerImpl* page_scale_layer_; |
367 LayerImpl* inner_viewport_scroll_layer_; | 367 LayerImpl* inner_viewport_scroll_layer_; |
368 LayerImpl* outer_viewport_scroll_layer_; | 368 LayerImpl* outer_viewport_scroll_layer_; |
369 | 369 |
370 LayerSelectionBound selection_start_; | 370 LayerSelectionBound selection_start_; |
371 LayerSelectionBound selection_end_; | 371 LayerSelectionBound selection_end_; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 | 421 |
422 scoped_ptr<PendingPageScaleAnimation> pending_page_scale_animation_; | 422 scoped_ptr<PendingPageScaleAnimation> pending_page_scale_animation_; |
423 | 423 |
424 private: | 424 private: |
425 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); | 425 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); |
426 }; | 426 }; |
427 | 427 |
428 } // namespace cc | 428 } // namespace cc |
429 | 429 |
430 #endif // CC_TREES_LAYER_TREE_IMPL_H_ | 430 #endif // CC_TREES_LAYER_TREE_IMPL_H_ |
OLD | NEW |