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