| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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_HOST_IMPL_H_ | 5 #ifndef CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
| 6 #define CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 6 #define CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <bitset> | 10 #include <bitset> |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 return pending_tree_ ? pending_tree_.get() : active_tree_.get(); | 431 return pending_tree_ ? pending_tree_.get() : active_tree_.get(); |
| 432 } | 432 } |
| 433 virtual void CreatePendingTree(); | 433 virtual void CreatePendingTree(); |
| 434 virtual void ActivateSyncTree(); | 434 virtual void ActivateSyncTree(); |
| 435 | 435 |
| 436 // Shortcuts to layers on the active tree. | 436 // Shortcuts to layers on the active tree. |
| 437 LayerImpl* InnerViewportScrollLayer() const; | 437 LayerImpl* InnerViewportScrollLayer() const; |
| 438 LayerImpl* OuterViewportScrollLayer() const; | 438 LayerImpl* OuterViewportScrollLayer() const; |
| 439 LayerImpl* CurrentlyScrollingLayer() const; | 439 LayerImpl* CurrentlyScrollingLayer() const; |
| 440 | 440 |
| 441 int scroll_layer_id_when_mouse_over_scrollbar() const { | |
| 442 return scroll_layer_id_when_mouse_over_scrollbar_; | |
| 443 } | |
| 444 bool scroll_affects_scroll_handler() const { | 441 bool scroll_affects_scroll_handler() const { |
| 445 return scroll_affects_scroll_handler_; | 442 return scroll_affects_scroll_handler_; |
| 446 } | 443 } |
| 447 void QueueSwapPromiseForMainThreadScrollUpdate( | 444 void QueueSwapPromiseForMainThreadScrollUpdate( |
| 448 std::unique_ptr<SwapPromise> swap_promise); | 445 std::unique_ptr<SwapPromise> swap_promise); |
| 449 | 446 |
| 450 bool IsActivelyScrolling() const; | 447 bool IsActivelyScrolling() const; |
| 451 | 448 |
| 452 virtual void SetVisible(bool visible); | 449 virtual void SetVisible(bool visible); |
| 453 bool visible() const { return visible_; } | 450 bool visible() const { return visible_; } |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 663 | 660 |
| 664 void UpdateTileManagerMemoryPolicy(const ManagedMemoryPolicy& policy); | 661 void UpdateTileManagerMemoryPolicy(const ManagedMemoryPolicy& policy); |
| 665 | 662 |
| 666 // This function should only be called from PrepareToDraw, as DidDrawAllLayers | 663 // This function should only be called from PrepareToDraw, as DidDrawAllLayers |
| 667 // must be called if this helper function is called. Returns DRAW_SUCCESS if | 664 // must be called if this helper function is called. Returns DRAW_SUCCESS if |
| 668 // the frame should be drawn. | 665 // the frame should be drawn. |
| 669 DrawResult CalculateRenderPasses(FrameData* frame); | 666 DrawResult CalculateRenderPasses(FrameData* frame); |
| 670 | 667 |
| 671 void ClearCurrentlyScrollingLayer(); | 668 void ClearCurrentlyScrollingLayer(); |
| 672 | 669 |
| 673 void HandleMouseOverScrollbar(LayerImpl* layer_impl); | |
| 674 | |
| 675 LayerImpl* FindScrollLayerForDeviceViewportPoint( | 670 LayerImpl* FindScrollLayerForDeviceViewportPoint( |
| 676 const gfx::PointF& device_viewport_point, | 671 const gfx::PointF& device_viewport_point, |
| 677 InputHandler::ScrollInputType type, | 672 InputHandler::ScrollInputType type, |
| 678 LayerImpl* layer_hit_by_point, | 673 LayerImpl* layer_hit_by_point, |
| 679 bool* scroll_on_main_thread, | 674 bool* scroll_on_main_thread, |
| 680 uint32_t* main_thread_scrolling_reason) const; | 675 uint32_t* main_thread_scrolling_reason) const; |
| 681 float DeviceSpaceDistanceToLayer(const gfx::PointF& device_viewport_point, | 676 float DeviceSpaceDistanceToLayer(const gfx::PointF& device_viewport_point, |
| 682 LayerImpl* layer_impl); | 677 LayerImpl* layer_impl); |
| 683 void StartScrollbarFadeRecursive(LayerImpl* layer); | 678 void StartScrollbarFadeRecursive(LayerImpl* layer); |
| 684 void SetManagedMemoryPolicy(const ManagedMemoryPolicy& policy); | 679 void SetManagedMemoryPolicy(const ManagedMemoryPolicy& policy); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 741 std::unique_ptr<LayerTreeImpl> pending_tree_; | 736 std::unique_ptr<LayerTreeImpl> pending_tree_; |
| 742 | 737 |
| 743 // In impl-side painting mode, inert tree with layers that can be recycled | 738 // In impl-side painting mode, inert tree with layers that can be recycled |
| 744 // by the next sync from the main thread. | 739 // by the next sync from the main thread. |
| 745 std::unique_ptr<LayerTreeImpl> recycle_tree_; | 740 std::unique_ptr<LayerTreeImpl> recycle_tree_; |
| 746 | 741 |
| 747 InputHandlerClient* input_handler_client_; | 742 InputHandlerClient* input_handler_client_; |
| 748 bool did_lock_scrolling_layer_; | 743 bool did_lock_scrolling_layer_; |
| 749 bool wheel_scrolling_; | 744 bool wheel_scrolling_; |
| 750 bool scroll_affects_scroll_handler_; | 745 bool scroll_affects_scroll_handler_; |
| 751 int scroll_layer_id_when_mouse_over_scrollbar_; | 746 int scroll_layer_id_mouse_currently_over_; |
| 752 int captured_scrollbar_layer_id_; | |
| 753 | 747 |
| 754 std::vector<std::unique_ptr<SwapPromise>> | 748 std::vector<std::unique_ptr<SwapPromise>> |
| 755 swap_promises_for_main_thread_scroll_update_; | 749 swap_promises_for_main_thread_scroll_update_; |
| 756 | 750 |
| 757 // An object to implement the ScrollElasticityHelper interface and | 751 // An object to implement the ScrollElasticityHelper interface and |
| 758 // hold all state related to elasticity. May be NULL if never requested. | 752 // hold all state related to elasticity. May be NULL if never requested. |
| 759 std::unique_ptr<ScrollElasticityHelper> scroll_elasticity_helper_; | 753 std::unique_ptr<ScrollElasticityHelper> scroll_elasticity_helper_; |
| 760 | 754 |
| 761 bool tile_priorities_dirty_; | 755 bool tile_priorities_dirty_; |
| 762 | 756 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 840 | 834 |
| 841 std::unique_ptr<PendingTreeDurationHistogramTimer> | 835 std::unique_ptr<PendingTreeDurationHistogramTimer> |
| 842 pending_tree_duration_timer_; | 836 pending_tree_duration_timer_; |
| 843 | 837 |
| 844 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 838 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
| 845 }; | 839 }; |
| 846 | 840 |
| 847 } // namespace cc | 841 } // namespace cc |
| 848 | 842 |
| 849 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 843 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
| OLD | NEW |