| 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 <set> | 10 #include <set> |
| (...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 virtual ResourceId ResourceIdForUIResource(UIResourceId uid) const; | 529 virtual ResourceId ResourceIdForUIResource(UIResourceId uid) const; |
| 530 | 530 |
| 531 virtual bool IsUIResourceOpaque(UIResourceId uid) const; | 531 virtual bool IsUIResourceOpaque(UIResourceId uid) const; |
| 532 | 532 |
| 533 struct UIResourceData { | 533 struct UIResourceData { |
| 534 ResourceId resource_id; | 534 ResourceId resource_id; |
| 535 gfx::Size size; | 535 gfx::Size size; |
| 536 bool opaque; | 536 bool opaque; |
| 537 }; | 537 }; |
| 538 | 538 |
| 539 // Returns the amount of delta that can be applied to scroll_node, taking |
| 540 // page scale into account. |
| 541 gfx::Vector2dF ComputeScrollDelta(ScrollNode* scroll_node, |
| 542 const gfx::Vector2dF& delta); |
| 543 |
| 539 void ScheduleMicroBenchmark(scoped_ptr<MicroBenchmarkImpl> benchmark); | 544 void ScheduleMicroBenchmark(scoped_ptr<MicroBenchmarkImpl> benchmark); |
| 540 | 545 |
| 541 CompositorFrameMetadata MakeCompositorFrameMetadata() const; | 546 CompositorFrameMetadata MakeCompositorFrameMetadata() const; |
| 542 // Viewport rectangle and clip in nonflipped window space. These rects | 547 // Viewport rectangle and clip in nonflipped window space. These rects |
| 543 // should only be used by Renderer subclasses to populate glViewport/glClip | 548 // should only be used by Renderer subclasses to populate glViewport/glClip |
| 544 // and their software-mode equivalents. | 549 // and their software-mode equivalents. |
| 545 gfx::Rect DeviceViewport() const; | 550 gfx::Rect DeviceViewport() const; |
| 546 gfx::Rect DeviceClip() const; | 551 gfx::Rect DeviceClip() const; |
| 547 | 552 |
| 548 // When a SwapPromiseMonitor is created on the impl thread, it calls | 553 // When a SwapPromiseMonitor is created on the impl thread, it calls |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 609 return task_runner_provider_->HasImplThread() | 614 return task_runner_provider_->HasImplThread() |
| 610 ? task_runner_provider_->ImplThreadTaskRunner() | 615 ? task_runner_provider_->ImplThreadTaskRunner() |
| 611 : task_runner_provider_->MainThreadTaskRunner(); | 616 : task_runner_provider_->MainThreadTaskRunner(); |
| 612 } | 617 } |
| 613 | 618 |
| 614 InputHandler::ScrollStatus TryScroll(const gfx::PointF& screen_space_point, | 619 InputHandler::ScrollStatus TryScroll(const gfx::PointF& screen_space_point, |
| 615 InputHandler::ScrollInputType type, | 620 InputHandler::ScrollInputType type, |
| 616 const ScrollTree& scroll_tree, | 621 const ScrollTree& scroll_tree, |
| 617 ScrollNode* scroll_node) const; | 622 ScrollNode* scroll_node) const; |
| 618 | 623 |
| 624 // Returns true if a scroll offset animation is created and false if we scroll |
| 625 // by the desired amount without an animation. |
| 626 bool ScrollAnimationCreate(ScrollNode* scroll_node, |
| 627 const gfx::Vector2dF& scroll_amount); |
| 628 |
| 619 protected: | 629 protected: |
| 620 LayerTreeHostImpl( | 630 LayerTreeHostImpl( |
| 621 const LayerTreeSettings& settings, | 631 const LayerTreeSettings& settings, |
| 622 LayerTreeHostImplClient* client, | 632 LayerTreeHostImplClient* client, |
| 623 TaskRunnerProvider* task_runner_provider, | 633 TaskRunnerProvider* task_runner_provider, |
| 624 RenderingStatsInstrumentation* rendering_stats_instrumentation, | 634 RenderingStatsInstrumentation* rendering_stats_instrumentation, |
| 625 SharedBitmapManager* shared_bitmap_manager, | 635 SharedBitmapManager* shared_bitmap_manager, |
| 626 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 636 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
| 627 TaskGraphRunner* task_graph_runner, | 637 TaskGraphRunner* task_graph_runner, |
| 628 int id); | 638 int id); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 707 void MarkUIResourceNotEvicted(UIResourceId uid); | 717 void MarkUIResourceNotEvicted(UIResourceId uid); |
| 708 void ClearUIResources(); | 718 void ClearUIResources(); |
| 709 | 719 |
| 710 void NotifySwapPromiseMonitorsOfSetNeedsRedraw(); | 720 void NotifySwapPromiseMonitorsOfSetNeedsRedraw(); |
| 711 void NotifySwapPromiseMonitorsOfForwardingToMainThread(); | 721 void NotifySwapPromiseMonitorsOfForwardingToMainThread(); |
| 712 | 722 |
| 713 void UpdateRootLayerStateForSynchronousInputHandler(); | 723 void UpdateRootLayerStateForSynchronousInputHandler(); |
| 714 | 724 |
| 715 void ScrollAnimationAbort(LayerImpl* layer_impl); | 725 void ScrollAnimationAbort(LayerImpl* layer_impl); |
| 716 | 726 |
| 717 void ScrollAnimationCreate(ScrollNode* scroll_node, | |
| 718 const gfx::ScrollOffset& target_offset, | |
| 719 const gfx::ScrollOffset& current_offset); | |
| 720 bool ScrollAnimationUpdateTarget(ScrollNode* scroll_node, | 727 bool ScrollAnimationUpdateTarget(ScrollNode* scroll_node, |
| 721 const gfx::Vector2dF& scroll_delta); | 728 const gfx::Vector2dF& scroll_delta); |
| 722 | 729 |
| 723 using UIResourceMap = std::unordered_map<UIResourceId, UIResourceData>; | 730 using UIResourceMap = std::unordered_map<UIResourceId, UIResourceData>; |
| 724 UIResourceMap ui_resource_map_; | 731 UIResourceMap ui_resource_map_; |
| 725 | 732 |
| 726 // Resources that were evicted by EvictAllUIResources. Resources are removed | 733 // Resources that were evicted by EvictAllUIResources. Resources are removed |
| 727 // from this when they are touched by a create or destroy from the UI resource | 734 // from this when they are touched by a create or destroy from the UI resource |
| 728 // request queue. | 735 // request queue. |
| 729 std::set<UIResourceId> evicted_ui_resources_; | 736 std::set<UIResourceId> evicted_ui_resources_; |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 848 scoped_ptr<FrameTimingTracker> frame_timing_tracker_; | 855 scoped_ptr<FrameTimingTracker> frame_timing_tracker_; |
| 849 | 856 |
| 850 scoped_ptr<Viewport> viewport_; | 857 scoped_ptr<Viewport> viewport_; |
| 851 | 858 |
| 852 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 859 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
| 853 }; | 860 }; |
| 854 | 861 |
| 855 } // namespace cc | 862 } // namespace cc |
| 856 | 863 |
| 857 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 864 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
| OLD | NEW |