| 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 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 const LayerTreeImpl* recycle_tree() const { return recycle_tree_.get(); } | 433 const LayerTreeImpl* recycle_tree() const { return recycle_tree_.get(); } |
| 434 // Returns the tree LTH synchronizes with. | 434 // Returns the tree LTH synchronizes with. |
| 435 LayerTreeImpl* sync_tree() const { | 435 LayerTreeImpl* sync_tree() const { |
| 436 // TODO(enne): This is bogus. It should return based on the value of | 436 // TODO(enne): This is bogus. It should return based on the value of |
| 437 // CommitToActiveTree() and not whether the pending tree exists. | 437 // CommitToActiveTree() and not whether the pending tree exists. |
| 438 return pending_tree_ ? pending_tree_.get() : active_tree_.get(); | 438 return pending_tree_ ? pending_tree_.get() : active_tree_.get(); |
| 439 } | 439 } |
| 440 virtual void CreatePendingTree(); | 440 virtual void CreatePendingTree(); |
| 441 virtual void ActivateSyncTree(); | 441 virtual void ActivateSyncTree(); |
| 442 | 442 |
| 443 // Shortcuts to layers on the active tree. | 443 // Shortcuts to layers/nodes on the active tree. |
| 444 LayerImpl* InnerViewportScrollLayer() const; | 444 LayerImpl* InnerViewportScrollLayer() const; |
| 445 LayerImpl* OuterViewportScrollLayer() const; | 445 LayerImpl* OuterViewportScrollLayer() const; |
| 446 LayerImpl* CurrentlyScrollingLayer() const; | 446 ScrollNode* OuterViewportScrollNode() const; |
| 447 ScrollNode* CurrentlyScrollingNode(); |
| 448 const ScrollNode* CurrentlyScrollingNode() const; |
| 447 | 449 |
| 448 bool scroll_affects_scroll_handler() const { | 450 bool scroll_affects_scroll_handler() const { |
| 449 return scroll_affects_scroll_handler_; | 451 return scroll_affects_scroll_handler_; |
| 450 } | 452 } |
| 451 void QueueSwapPromiseForMainThreadScrollUpdate( | 453 void QueueSwapPromiseForMainThreadScrollUpdate( |
| 452 std::unique_ptr<SwapPromise> swap_promise); | 454 std::unique_ptr<SwapPromise> swap_promise); |
| 453 | 455 |
| 454 bool IsActivelyScrolling() const; | 456 bool IsActivelyScrolling() const; |
| 455 | 457 |
| 456 virtual void SetVisible(bool visible); | 458 virtual void SetVisible(bool visible); |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 void UpdateSyncTreeAfterCommitOrImplSideInvalidation(); | 650 void UpdateSyncTreeAfterCommitOrImplSideInvalidation(); |
| 649 | 651 |
| 650 // Returns true if status changed. | 652 // Returns true if status changed. |
| 651 bool UpdateGpuRasterizationStatus(); | 653 bool UpdateGpuRasterizationStatus(); |
| 652 void UpdateTreeResourcesForGpuRasterizationIfNeeded(); | 654 void UpdateTreeResourcesForGpuRasterizationIfNeeded(); |
| 653 | 655 |
| 654 Viewport* viewport() const { return viewport_.get(); } | 656 Viewport* viewport() const { return viewport_.get(); } |
| 655 | 657 |
| 656 InputHandler::ScrollStatus ScrollBeginImpl( | 658 InputHandler::ScrollStatus ScrollBeginImpl( |
| 657 ScrollState* scroll_state, | 659 ScrollState* scroll_state, |
| 658 LayerImpl* scrolling_layer_impl, | 660 ScrollNode* scrolling_node, |
| 659 InputHandler::ScrollInputType type); | 661 InputHandler::ScrollInputType type); |
| 660 bool IsInitialScrollHitTestReliable(LayerImpl* layer, const gfx::PointF&); | 662 bool IsInitialScrollHitTestReliable(LayerImpl* layer, const gfx::PointF&); |
| 661 void DistributeScrollDelta(ScrollState* scroll_state); | 663 void DistributeScrollDelta(ScrollState* scroll_state); |
| 662 | 664 |
| 663 bool AnimatePageScale(base::TimeTicks monotonic_time); | 665 bool AnimatePageScale(base::TimeTicks monotonic_time); |
| 664 bool AnimateScrollbars(base::TimeTicks monotonic_time); | 666 bool AnimateScrollbars(base::TimeTicks monotonic_time); |
| 665 bool AnimateBrowserControls(base::TimeTicks monotonic_time); | 667 bool AnimateBrowserControls(base::TimeTicks monotonic_time); |
| 666 | 668 |
| 667 void TrackDamageForAllSurfaces( | 669 void TrackDamageForAllSurfaces( |
| 668 const LayerImplList& render_surface_layer_list); | 670 const LayerImplList& render_surface_layer_list); |
| 669 | 671 |
| 670 void UpdateTileManagerMemoryPolicy(const ManagedMemoryPolicy& policy); | 672 void UpdateTileManagerMemoryPolicy(const ManagedMemoryPolicy& policy); |
| 671 | 673 |
| 672 // This function should only be called from PrepareToDraw, as DidDrawAllLayers | 674 // This function should only be called from PrepareToDraw, as DidDrawAllLayers |
| 673 // must be called if this helper function is called. Returns DRAW_SUCCESS if | 675 // must be called if this helper function is called. Returns DRAW_SUCCESS if |
| 674 // the frame should be drawn. | 676 // the frame should be drawn. |
| 675 DrawResult CalculateRenderPasses(FrameData* frame); | 677 DrawResult CalculateRenderPasses(FrameData* frame); |
| 676 | 678 |
| 677 void ClearCurrentlyScrollingLayer(); | 679 void ClearCurrentlyScrollingNode(); |
| 678 | 680 |
| 679 LayerImpl* FindScrollLayerForDeviceViewportPoint( | 681 LayerImpl* FindScrollLayerForDeviceViewportPoint( |
| 680 const gfx::PointF& device_viewport_point, | 682 const gfx::PointF& device_viewport_point, |
| 681 InputHandler::ScrollInputType type, | 683 InputHandler::ScrollInputType type, |
| 682 LayerImpl* layer_hit_by_point, | 684 LayerImpl* layer_hit_by_point, |
| 683 bool* scroll_on_main_thread, | 685 bool* scroll_on_main_thread, |
| 684 uint32_t* main_thread_scrolling_reason) const; | 686 uint32_t* main_thread_scrolling_reason) const; |
| 685 float DeviceSpaceDistanceToLayer(const gfx::PointF& device_viewport_point, | 687 float DeviceSpaceDistanceToLayer(const gfx::PointF& device_viewport_point, |
| 686 LayerImpl* layer_impl); | 688 LayerImpl* layer_impl); |
| 687 void StartScrollbarFadeRecursive(LayerImpl* layer); | 689 void StartScrollbarFadeRecursive(LayerImpl* layer); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 765 bool visible_; | 767 bool visible_; |
| 766 ManagedMemoryPolicy cached_managed_memory_policy_; | 768 ManagedMemoryPolicy cached_managed_memory_policy_; |
| 767 | 769 |
| 768 const bool is_synchronous_single_threaded_; | 770 const bool is_synchronous_single_threaded_; |
| 769 TileManager tile_manager_; | 771 TileManager tile_manager_; |
| 770 DecodedImageTracker decoded_image_tracker_; | 772 DecodedImageTracker decoded_image_tracker_; |
| 771 | 773 |
| 772 gfx::Vector2dF accumulated_root_overscroll_; | 774 gfx::Vector2dF accumulated_root_overscroll_; |
| 773 | 775 |
| 774 bool pinch_gesture_active_; | 776 bool pinch_gesture_active_; |
| 775 bool pinch_gesture_end_should_clear_scrolling_layer_; | 777 bool pinch_gesture_end_should_clear_scrolling_node_; |
| 776 | 778 |
| 777 std::unique_ptr<BrowserControlsOffsetManager> | 779 std::unique_ptr<BrowserControlsOffsetManager> |
| 778 browser_controls_offset_manager_; | 780 browser_controls_offset_manager_; |
| 779 | 781 |
| 780 std::unique_ptr<PageScaleAnimation> page_scale_animation_; | 782 std::unique_ptr<PageScaleAnimation> page_scale_animation_; |
| 781 | 783 |
| 782 std::unique_ptr<FrameRateCounter> fps_counter_; | 784 std::unique_ptr<FrameRateCounter> fps_counter_; |
| 783 std::unique_ptr<MemoryHistory> memory_history_; | 785 std::unique_ptr<MemoryHistory> memory_history_; |
| 784 std::unique_ptr<DebugRectHistory> debug_rect_history_; | 786 std::unique_ptr<DebugRectHistory> debug_rect_history_; |
| 785 | 787 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 840 | 842 |
| 841 std::unique_ptr<PendingTreeDurationHistogramTimer> | 843 std::unique_ptr<PendingTreeDurationHistogramTimer> |
| 842 pending_tree_duration_timer_; | 844 pending_tree_duration_timer_; |
| 843 | 845 |
| 844 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 846 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
| 845 }; | 847 }; |
| 846 | 848 |
| 847 } // namespace cc | 849 } // namespace cc |
| 848 | 850 |
| 849 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 851 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
| OLD | NEW |