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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 // and the active tree's size is now out of date. | 257 // and the active tree's size is now out of date. |
257 bool ViewportSizeInvalid() const; | 258 bool ViewportSizeInvalid() const; |
258 void SetViewportSizeInvalid(); | 259 void SetViewportSizeInvalid(); |
259 void ResetViewportSizeInvalid(); | 260 void ResetViewportSizeInvalid(); |
260 | 261 |
261 // Useful for debug assertions, probably shouldn't be used for anything else. | 262 // Useful for debug assertions, probably shouldn't be used for anything else. |
262 Proxy* proxy() const; | 263 Proxy* proxy() const; |
263 | 264 |
264 void SetRootLayerScrollOffsetDelegate( | 265 void SetRootLayerScrollOffsetDelegate( |
265 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate); | 266 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate); |
266 void OnRootLayerDelegatedScrollOffsetChanged(); | 267 void UpdateRootScrollOffsetDelegate(); |
267 void UpdateScrollOffsetDelegate(); | 268 // Distribute the rool scroll between outer and inner viewport scroll layer. |
268 gfx::ScrollOffset GetDelegatedScrollOffset(LayerImpl* layer); | 269 // The outer viewport scroll layer scrolls first. |
| 270 void DistributeRootScrollOffset(); |
269 | 271 |
270 // Call this function when you expect there to be a swap buffer. | 272 // Call this function when you expect there to be a swap buffer. |
271 // See swap_promise.h for how to use SwapPromise. | 273 // See swap_promise.h for how to use SwapPromise. |
272 void QueueSwapPromise(scoped_ptr<SwapPromise> swap_promise); | 274 void QueueSwapPromise(scoped_ptr<SwapPromise> swap_promise); |
273 | 275 |
274 // Take the |new_swap_promise| and append it to |swap_promise_list_|. | 276 // Take the |new_swap_promise| and append it to |swap_promise_list_|. |
275 void PassSwapPromises(ScopedPtrVector<SwapPromise>* new_swap_promise); | 277 void PassSwapPromises(ScopedPtrVector<SwapPromise>* new_swap_promise); |
276 void FinishSwapPromises(CompositorFrameMetadata* metadata); | 278 void FinishSwapPromises(CompositorFrameMetadata* metadata); |
277 void BreakSwapPromises(SwapPromise::DidNotSwapReason reason); | 279 void BreakSwapPromises(SwapPromise::DidNotSwapReason reason); |
278 | 280 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 void set_top_controls_height(float top_controls_height); | 329 void set_top_controls_height(float top_controls_height); |
328 float top_controls_height() const { return top_controls_height_; } | 330 float top_controls_height() const { return top_controls_height_; } |
329 void PushTopControlsFromMainThread(float top_controls_shown_ratio); | 331 void PushTopControlsFromMainThread(float top_controls_shown_ratio); |
330 | 332 |
331 void SetPendingPageScaleAnimation( | 333 void SetPendingPageScaleAnimation( |
332 scoped_ptr<PendingPageScaleAnimation> pending_animation); | 334 scoped_ptr<PendingPageScaleAnimation> pending_animation); |
333 scoped_ptr<PendingPageScaleAnimation> TakePendingPageScaleAnimation(); | 335 scoped_ptr<PendingPageScaleAnimation> TakePendingPageScaleAnimation(); |
334 | 336 |
335 void GatherFrameTimingRequestIds(std::vector<int64_t>* request_ids); | 337 void GatherFrameTimingRequestIds(std::vector<int64_t>* request_ids); |
336 | 338 |
| 339 bool IsExternalFlingActive() const; |
| 340 void DidUpdateScrollOffset(int layer_id); |
| 341 |
337 protected: | 342 protected: |
338 explicit LayerTreeImpl( | 343 explicit LayerTreeImpl( |
339 LayerTreeHostImpl* layer_tree_host_impl, | 344 LayerTreeHostImpl* layer_tree_host_impl, |
340 scoped_refptr<SyncedProperty<ScaleGroup>> page_scale_factor, | 345 scoped_refptr<SyncedProperty<ScaleGroup>> page_scale_factor, |
341 scoped_refptr<SyncedTopControls> top_controls_shown_ratio, | 346 scoped_refptr<SyncedTopControls> top_controls_shown_ratio, |
342 scoped_refptr<SyncedElasticOverscroll> elastic_overscroll); | 347 scoped_refptr<SyncedElasticOverscroll> elastic_overscroll); |
343 float ClampPageScaleFactorToLimits(float page_scale_factor) const; | 348 float ClampPageScaleFactorToLimits(float page_scale_factor) const; |
344 void PushPageScaleFactorAndLimits(const float* page_scale_factor, | 349 void PushPageScaleFactorAndLimits(const float* page_scale_factor, |
345 float min_page_scale_factor, | 350 float min_page_scale_factor, |
346 float max_page_scale_factor); | 351 float max_page_scale_factor); |
347 bool SetPageScaleFactorLimits(float min_page_scale_factor, | 352 bool SetPageScaleFactorLimits(float min_page_scale_factor, |
348 float max_page_scale_factor); | 353 float max_page_scale_factor); |
349 void DidUpdatePageScale(); | 354 void DidUpdatePageScale(); |
350 void HideInnerViewportScrollbarsIfNearMinimumScale(); | 355 void HideInnerViewportScrollbarsIfNearMinimumScale(); |
351 void PushTopControls(const float* top_controls_shown_ratio); | 356 void PushTopControls(const float* top_controls_shown_ratio); |
352 LayerTreeHostImpl* layer_tree_host_impl_; | 357 LayerTreeHostImpl* layer_tree_host_impl_; |
353 int source_frame_number_; | 358 int source_frame_number_; |
354 scoped_ptr<LayerImpl> root_layer_; | 359 scoped_ptr<LayerImpl> root_layer_; |
355 HeadsUpDisplayLayerImpl* hud_layer_; | 360 HeadsUpDisplayLayerImpl* hud_layer_; |
356 LayerImpl* currently_scrolling_layer_; | 361 LayerImpl* currently_scrolling_layer_; |
357 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate_; | 362 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate_; |
358 scoped_ptr<LayerScrollOffsetDelegateProxy> | 363 bool is_distributing_root_scroll_; |
359 inner_viewport_scroll_delegate_proxy_; | |
360 scoped_ptr<LayerScrollOffsetDelegateProxy> | |
361 outer_viewport_scroll_delegate_proxy_; | |
362 SkColor background_color_; | 364 SkColor background_color_; |
363 bool has_transparent_background_; | 365 bool has_transparent_background_; |
364 | 366 |
365 LayerImpl* overscroll_elasticity_layer_; | 367 LayerImpl* overscroll_elasticity_layer_; |
366 LayerImpl* page_scale_layer_; | 368 LayerImpl* page_scale_layer_; |
367 LayerImpl* inner_viewport_scroll_layer_; | 369 LayerImpl* inner_viewport_scroll_layer_; |
368 LayerImpl* outer_viewport_scroll_layer_; | 370 LayerImpl* outer_viewport_scroll_layer_; |
369 | 371 |
370 LayerSelectionBound selection_start_; | 372 LayerSelectionBound selection_start_; |
371 LayerSelectionBound selection_end_; | 373 LayerSelectionBound selection_end_; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 | 423 |
422 scoped_ptr<PendingPageScaleAnimation> pending_page_scale_animation_; | 424 scoped_ptr<PendingPageScaleAnimation> pending_page_scale_animation_; |
423 | 425 |
424 private: | 426 private: |
425 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); | 427 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); |
426 }; | 428 }; |
427 | 429 |
428 } // namespace cc | 430 } // namespace cc |
429 | 431 |
430 #endif // CC_TREES_LAYER_TREE_IMPL_H_ | 432 #endif // CC_TREES_LAYER_TREE_IMPL_H_ |
OLD | NEW |