| 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 virtual void WillPrepareTiles() = 0; | 114 virtual void WillPrepareTiles() = 0; |
| 115 virtual void DidPrepareTiles() = 0; | 115 virtual void DidPrepareTiles() = 0; |
| 116 | 116 |
| 117 // Called when page scale animation has completed on the impl thread. | 117 // Called when page scale animation has completed on the impl thread. |
| 118 virtual void DidCompletePageScaleAnimationOnImplThread() = 0; | 118 virtual void DidCompletePageScaleAnimationOnImplThread() = 0; |
| 119 | 119 |
| 120 // Called when output surface asks for a draw. | 120 // Called when output surface asks for a draw. |
| 121 virtual void OnDrawForCompositorFrameSink( | 121 virtual void OnDrawForCompositorFrameSink( |
| 122 bool resourceless_software_draw) = 0; | 122 bool resourceless_software_draw) = 0; |
| 123 | 123 |
| 124 virtual void NeedsImplSideInvalidation() = 0; |
| 125 |
| 124 protected: | 126 protected: |
| 125 virtual ~LayerTreeHostImplClient() {} | 127 virtual ~LayerTreeHostImplClient() {} |
| 126 }; | 128 }; |
| 127 | 129 |
| 128 // LayerTreeHostImpl owns the LayerImpl trees as well as associated rendering | 130 // LayerTreeHostImpl owns the LayerImpl trees as well as associated rendering |
| 129 // state. | 131 // state. |
| 130 class CC_EXPORT LayerTreeHostImpl | 132 class CC_EXPORT LayerTreeHostImpl |
| 131 : public InputHandler, | 133 : public InputHandler, |
| 132 public TileManagerClient, | 134 public TileManagerClient, |
| 133 public CompositorFrameSinkClient, | 135 public CompositorFrameSinkClient, |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 virtual void UpdateAnimationState(bool start_ready_animations); | 244 virtual void UpdateAnimationState(bool start_ready_animations); |
| 243 bool Mutate(base::TimeTicks monotonic_time); | 245 bool Mutate(base::TimeTicks monotonic_time); |
| 244 void ActivateAnimations(); | 246 void ActivateAnimations(); |
| 245 void Animate(); | 247 void Animate(); |
| 246 void AnimatePendingTreeAfterCommit(); | 248 void AnimatePendingTreeAfterCommit(); |
| 247 void MainThreadHasStoppedFlinging(); | 249 void MainThreadHasStoppedFlinging(); |
| 248 void DidAnimateScrollOffset(); | 250 void DidAnimateScrollOffset(); |
| 249 void SetFullViewportDamage(); | 251 void SetFullViewportDamage(); |
| 250 void SetViewportDamage(const gfx::Rect& damage_rect); | 252 void SetViewportDamage(const gfx::Rect& damage_rect); |
| 251 | 253 |
| 254 // Analogous to a commit, this function is used to create a sync tree and |
| 255 // add impl-side invalidations to it. |
| 256 void InvalidateContentOnImplSide(); |
| 257 |
| 252 void SetTreeLayerFilterMutated(ElementId element_id, | 258 void SetTreeLayerFilterMutated(ElementId element_id, |
| 253 LayerTreeImpl* tree, | 259 LayerTreeImpl* tree, |
| 254 const FilterOperations& filters); | 260 const FilterOperations& filters); |
| 255 void SetTreeLayerOpacityMutated(ElementId element_id, | 261 void SetTreeLayerOpacityMutated(ElementId element_id, |
| 256 LayerTreeImpl* tree, | 262 LayerTreeImpl* tree, |
| 257 float opacity); | 263 float opacity); |
| 258 void SetTreeLayerTransformMutated(ElementId element_id, | 264 void SetTreeLayerTransformMutated(ElementId element_id, |
| 259 LayerTreeImpl* tree, | 265 LayerTreeImpl* tree, |
| 260 const gfx::Transform& transform); | 266 const gfx::Transform& transform); |
| 261 void SetTreeLayerScrollOffsetMutated(ElementId element_id, | 267 void SetTreeLayerScrollOffsetMutated(ElementId element_id, |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 void NotifyReadyToDraw() override; | 342 void NotifyReadyToDraw() override; |
| 337 void NotifyAllTileTasksCompleted() override; | 343 void NotifyAllTileTasksCompleted() override; |
| 338 void NotifyTileStateChanged(const Tile* tile) override; | 344 void NotifyTileStateChanged(const Tile* tile) override; |
| 339 std::unique_ptr<RasterTilePriorityQueue> BuildRasterQueue( | 345 std::unique_ptr<RasterTilePriorityQueue> BuildRasterQueue( |
| 340 TreePriority tree_priority, | 346 TreePriority tree_priority, |
| 341 RasterTilePriorityQueue::Type type) override; | 347 RasterTilePriorityQueue::Type type) override; |
| 342 std::unique_ptr<EvictionTilePriorityQueue> BuildEvictionQueue( | 348 std::unique_ptr<EvictionTilePriorityQueue> BuildEvictionQueue( |
| 343 TreePriority tree_priority) override; | 349 TreePriority tree_priority) override; |
| 344 void SetIsLikelyToRequireADraw(bool is_likely_to_require_a_draw) override; | 350 void SetIsLikelyToRequireADraw(bool is_likely_to_require_a_draw) override; |
| 345 gfx::ColorSpace GetTileColorSpace() const override; | 351 gfx::ColorSpace GetTileColorSpace() const override; |
| 352 void RequestImplSideInvalidation() override; |
| 346 | 353 |
| 347 // ScrollbarAnimationControllerClient implementation. | 354 // ScrollbarAnimationControllerClient implementation. |
| 348 void PostDelayedScrollbarAnimationTask(const base::Closure& task, | 355 void PostDelayedScrollbarAnimationTask(const base::Closure& task, |
| 349 base::TimeDelta delay) override; | 356 base::TimeDelta delay) override; |
| 350 void SetNeedsAnimateForScrollbarAnimation() override; | 357 void SetNeedsAnimateForScrollbarAnimation() override; |
| 351 void SetNeedsRedrawForScrollbarAnimation() override; | 358 void SetNeedsRedrawForScrollbarAnimation() override; |
| 352 ScrollbarSet ScrollbarsFor(int scroll_layer_id) const override; | 359 ScrollbarSet ScrollbarsFor(int scroll_layer_id) const override; |
| 353 void DidChangeScrollbarVisibility() override; | 360 void DidChangeScrollbarVisibility() override; |
| 354 | 361 |
| 355 // VideoBeginFrameSource implementation. | 362 // VideoBeginFrameSource implementation. |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 622 ScrollTree* scroll_tree); | 629 ScrollTree* scroll_tree); |
| 623 | 630 |
| 624 void CleanUpTileManagerAndUIResources(); | 631 void CleanUpTileManagerAndUIResources(); |
| 625 void CreateTileManagerResources(); | 632 void CreateTileManagerResources(); |
| 626 void ReleaseTreeResources(); | 633 void ReleaseTreeResources(); |
| 627 void ReleaseTileResources(); | 634 void ReleaseTileResources(); |
| 628 void RecreateTileResources(); | 635 void RecreateTileResources(); |
| 629 | 636 |
| 630 void AnimateInternal(bool active_tree); | 637 void AnimateInternal(bool active_tree); |
| 631 | 638 |
| 639 // The function is called to update state on the sync tree after a commit |
| 640 // finishes or after the sync tree was created to invalidate content on the |
| 641 // impl thread. |
| 642 void UpdateSyncTreeAfterCommitOrImplSideInvalidation(); |
| 643 |
| 632 // Returns true if status changed. | 644 // Returns true if status changed. |
| 633 bool UpdateGpuRasterizationStatus(); | 645 bool UpdateGpuRasterizationStatus(); |
| 634 void UpdateTreeResourcesForGpuRasterizationIfNeeded(); | 646 void UpdateTreeResourcesForGpuRasterizationIfNeeded(); |
| 635 | 647 |
| 636 Viewport* viewport() const { return viewport_.get(); } | 648 Viewport* viewport() const { return viewport_.get(); } |
| 637 | 649 |
| 638 InputHandler::ScrollStatus ScrollBeginImpl( | 650 InputHandler::ScrollStatus ScrollBeginImpl( |
| 639 ScrollState* scroll_state, | 651 ScrollState* scroll_state, |
| 640 LayerImpl* scrolling_layer_impl, | 652 LayerImpl* scrolling_layer_impl, |
| 641 InputHandler::ScrollInputType type); | 653 InputHandler::ScrollInputType type); |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 822 | 834 |
| 823 std::unique_ptr<PendingTreeDurationHistogramTimer> | 835 std::unique_ptr<PendingTreeDurationHistogramTimer> |
| 824 pending_tree_duration_timer_; | 836 pending_tree_duration_timer_; |
| 825 | 837 |
| 826 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 838 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
| 827 }; | 839 }; |
| 828 | 840 |
| 829 } // namespace cc | 841 } // namespace cc |
| 830 | 842 |
| 831 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 843 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
| OLD | NEW |