Chromium Code Reviews| 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 struct ScrollAmount { | |
|
bokan
2016/04/06 13:35:52
I don't like this, there's opportunity for delta a
ymalik
2016/04/06 15:33:45
You're right, it's not used often enough to justif
| |
| 540 ScrollAmount(gfx::Vector2dF delta, gfx::ScrollOffset offset) | |
| 541 : delta(delta), target_offset(offset) {} | |
| 542 gfx::Vector2dF delta; | |
| 543 gfx::ScrollOffset target_offset; | |
| 544 }; | |
| 545 | |
| 546 // Returns the amount of delta that can be applied to scroll_node, taking | |
| 547 // page scale into account. | |
| 548 ScrollAmount ComputeScrollDelta(ScrollNode* scroll_node, | |
| 549 const gfx::Vector2dF& delta); | |
| 550 | |
| 539 void ScheduleMicroBenchmark(scoped_ptr<MicroBenchmarkImpl> benchmark); | 551 void ScheduleMicroBenchmark(scoped_ptr<MicroBenchmarkImpl> benchmark); |
| 540 | 552 |
| 541 CompositorFrameMetadata MakeCompositorFrameMetadata() const; | 553 CompositorFrameMetadata MakeCompositorFrameMetadata() const; |
| 542 // Viewport rectangle and clip in nonflipped window space. These rects | 554 // Viewport rectangle and clip in nonflipped window space. These rects |
| 543 // should only be used by Renderer subclasses to populate glViewport/glClip | 555 // should only be used by Renderer subclasses to populate glViewport/glClip |
| 544 // and their software-mode equivalents. | 556 // and their software-mode equivalents. |
| 545 gfx::Rect DeviceViewport() const; | 557 gfx::Rect DeviceViewport() const; |
| 546 gfx::Rect DeviceClip() const; | 558 gfx::Rect DeviceClip() const; |
| 547 | 559 |
| 548 // When a SwapPromiseMonitor is created on the impl thread, it calls | 560 // 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() | 621 return task_runner_provider_->HasImplThread() |
| 610 ? task_runner_provider_->ImplThreadTaskRunner() | 622 ? task_runner_provider_->ImplThreadTaskRunner() |
| 611 : task_runner_provider_->MainThreadTaskRunner(); | 623 : task_runner_provider_->MainThreadTaskRunner(); |
| 612 } | 624 } |
| 613 | 625 |
| 614 InputHandler::ScrollStatus TryScroll(const gfx::PointF& screen_space_point, | 626 InputHandler::ScrollStatus TryScroll(const gfx::PointF& screen_space_point, |
| 615 InputHandler::ScrollInputType type, | 627 InputHandler::ScrollInputType type, |
| 616 const ScrollTree& scroll_tree, | 628 const ScrollTree& scroll_tree, |
| 617 ScrollNode* scroll_node) const; | 629 ScrollNode* scroll_node) const; |
| 618 | 630 |
| 631 // Returns true if a scroll offset animation is created and false if we scroll | |
| 632 // by the desired amount without an animation. | |
| 633 bool ScrollAnimationCreate(ScrollNode* scroll_node, | |
| 634 const ScrollAmount& scroll_amount); | |
| 635 | |
| 619 protected: | 636 protected: |
| 620 LayerTreeHostImpl( | 637 LayerTreeHostImpl( |
| 621 const LayerTreeSettings& settings, | 638 const LayerTreeSettings& settings, |
| 622 LayerTreeHostImplClient* client, | 639 LayerTreeHostImplClient* client, |
| 623 TaskRunnerProvider* task_runner_provider, | 640 TaskRunnerProvider* task_runner_provider, |
| 624 RenderingStatsInstrumentation* rendering_stats_instrumentation, | 641 RenderingStatsInstrumentation* rendering_stats_instrumentation, |
| 625 SharedBitmapManager* shared_bitmap_manager, | 642 SharedBitmapManager* shared_bitmap_manager, |
| 626 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 643 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
| 627 TaskGraphRunner* task_graph_runner, | 644 TaskGraphRunner* task_graph_runner, |
| 628 int id); | 645 int id); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 707 void MarkUIResourceNotEvicted(UIResourceId uid); | 724 void MarkUIResourceNotEvicted(UIResourceId uid); |
| 708 void ClearUIResources(); | 725 void ClearUIResources(); |
| 709 | 726 |
| 710 void NotifySwapPromiseMonitorsOfSetNeedsRedraw(); | 727 void NotifySwapPromiseMonitorsOfSetNeedsRedraw(); |
| 711 void NotifySwapPromiseMonitorsOfForwardingToMainThread(); | 728 void NotifySwapPromiseMonitorsOfForwardingToMainThread(); |
| 712 | 729 |
| 713 void UpdateRootLayerStateForSynchronousInputHandler(); | 730 void UpdateRootLayerStateForSynchronousInputHandler(); |
| 714 | 731 |
| 715 void ScrollAnimationAbort(LayerImpl* layer_impl); | 732 void ScrollAnimationAbort(LayerImpl* layer_impl); |
| 716 | 733 |
| 717 void ScrollAnimationCreate(ScrollNode* scroll_node, | |
| 718 const gfx::ScrollOffset& target_offset, | |
| 719 const gfx::ScrollOffset& current_offset); | |
| 720 bool ScrollAnimationUpdateTarget(ScrollNode* scroll_node, | 734 bool ScrollAnimationUpdateTarget(ScrollNode* scroll_node, |
| 721 const gfx::Vector2dF& scroll_delta); | 735 const gfx::Vector2dF& scroll_delta); |
| 722 | 736 |
| 723 using UIResourceMap = std::unordered_map<UIResourceId, UIResourceData>; | 737 using UIResourceMap = std::unordered_map<UIResourceId, UIResourceData>; |
| 724 UIResourceMap ui_resource_map_; | 738 UIResourceMap ui_resource_map_; |
| 725 | 739 |
| 726 // Resources that were evicted by EvictAllUIResources. Resources are removed | 740 // 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 | 741 // from this when they are touched by a create or destroy from the UI resource |
| 728 // request queue. | 742 // request queue. |
| 729 std::set<UIResourceId> evicted_ui_resources_; | 743 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_; | 862 scoped_ptr<FrameTimingTracker> frame_timing_tracker_; |
| 849 | 863 |
| 850 scoped_ptr<Viewport> viewport_; | 864 scoped_ptr<Viewport> viewport_; |
| 851 | 865 |
| 852 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 866 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
| 853 }; | 867 }; |
| 854 | 868 |
| 855 } // namespace cc | 869 } // namespace cc |
| 856 | 870 |
| 857 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 871 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
| OLD | NEW |