| 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 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 612 ScrollNode* scroll_node) const; | 612 ScrollNode* scroll_node) const; |
| 613 | 613 |
| 614 // Returns true if a scroll offset animation is created and false if we scroll | 614 // Returns true if a scroll offset animation is created and false if we scroll |
| 615 // by the desired amount without an animation. | 615 // by the desired amount without an animation. |
| 616 bool ScrollAnimationCreate(ScrollNode* scroll_node, | 616 bool ScrollAnimationCreate(ScrollNode* scroll_node, |
| 617 const gfx::Vector2dF& scroll_amount); | 617 const gfx::Vector2dF& scroll_amount); |
| 618 | 618 |
| 619 void SetLayerTreeMutator(std::unique_ptr<LayerTreeMutator> mutator); | 619 void SetLayerTreeMutator(std::unique_ptr<LayerTreeMutator> mutator); |
| 620 LayerTreeMutator* mutator() { return mutator_.get(); } | 620 LayerTreeMutator* mutator() { return mutator_.get(); } |
| 621 | 621 |
| 622 void set_fixed_raster_scale_has_blurry_content() { | |
| 623 has_fixed_raster_scale_blurry_content_ = true; | |
| 624 } | |
| 625 bool has_fixed_raster_scale_blurry_content() const { | |
| 626 return has_fixed_raster_scale_blurry_content_; | |
| 627 } | |
| 628 | |
| 629 bool HasFixedRasterScalePotentialPerformanceRegression() const; | |
| 630 void SetFixedRasterScaleAttemptedToChangeScale(); | |
| 631 | |
| 632 protected: | 622 protected: |
| 633 LayerTreeHostImpl( | 623 LayerTreeHostImpl( |
| 634 const LayerTreeSettings& settings, | 624 const LayerTreeSettings& settings, |
| 635 LayerTreeHostImplClient* client, | 625 LayerTreeHostImplClient* client, |
| 636 TaskRunnerProvider* task_runner_provider, | 626 TaskRunnerProvider* task_runner_provider, |
| 637 RenderingStatsInstrumentation* rendering_stats_instrumentation, | 627 RenderingStatsInstrumentation* rendering_stats_instrumentation, |
| 638 SharedBitmapManager* shared_bitmap_manager, | 628 SharedBitmapManager* shared_bitmap_manager, |
| 639 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 629 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
| 640 TaskGraphRunner* task_graph_runner, | 630 TaskGraphRunner* task_graph_runner, |
| 641 std::unique_ptr<AnimationHost> animation_host, | 631 std::unique_ptr<AnimationHost> animation_host, |
| 642 int id); | 632 int id); |
| 643 | 633 |
| 644 // Virtual for testing. | 634 // Virtual for testing. |
| 645 virtual bool AnimateLayers(base::TimeTicks monotonic_time); | 635 virtual bool AnimateLayers(base::TimeTicks monotonic_time); |
| 646 | 636 |
| 647 bool is_likely_to_require_a_draw() const { | 637 bool is_likely_to_require_a_draw() const { |
| 648 return is_likely_to_require_a_draw_; | 638 return is_likely_to_require_a_draw_; |
| 649 } | 639 } |
| 650 | 640 |
| 651 // Removes empty or orphan RenderPasses from the frame. | 641 // Removes empty or orphan RenderPasses from the frame. |
| 652 static void RemoveRenderPasses(FrameData* frame); | 642 static void RemoveRenderPasses(FrameData* frame); |
| 653 | 643 |
| 654 LayerTreeHostImplClient* client_; | 644 LayerTreeHostImplClient* client_; |
| 655 TaskRunnerProvider* task_runner_provider_; | 645 TaskRunnerProvider* task_runner_provider_; |
| 656 | 646 |
| 657 BeginFrameTracker current_begin_frame_tracker_; | 647 BeginFrameTracker current_begin_frame_tracker_; |
| 658 | 648 |
| 659 private: | 649 private: |
| 660 enum { kFixedRasterScaleAttemptedScaleChangeThreshold = 5 }; | |
| 661 enum { kFixedRasterScaleAttemptedScaleChangeHistoryCount = 10 }; | |
| 662 | |
| 663 gfx::Vector2dF ScrollNodeWithViewportSpaceDelta( | 650 gfx::Vector2dF ScrollNodeWithViewportSpaceDelta( |
| 664 ScrollNode* scroll_node, | 651 ScrollNode* scroll_node, |
| 665 const gfx::PointF& viewport_point, | 652 const gfx::PointF& viewport_point, |
| 666 const gfx::Vector2dF& viewport_delta, | 653 const gfx::Vector2dF& viewport_delta, |
| 667 ScrollTree* scroll_tree); | 654 ScrollTree* scroll_tree); |
| 668 | 655 |
| 669 void CreateAndSetRenderer(); | 656 void CreateAndSetRenderer(); |
| 670 void CleanUpTileManagerAndUIResources(); | 657 void CleanUpTileManagerAndUIResources(); |
| 671 void CreateTileManagerResources(); | 658 void CreateTileManagerResources(); |
| 672 void ReleaseTreeResources(); | 659 void ReleaseTreeResources(); |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 855 | 842 |
| 856 std::set<SwapPromiseMonitor*> swap_promise_monitor_; | 843 std::set<SwapPromiseMonitor*> swap_promise_monitor_; |
| 857 | 844 |
| 858 bool requires_high_res_to_draw_; | 845 bool requires_high_res_to_draw_; |
| 859 bool is_likely_to_require_a_draw_; | 846 bool is_likely_to_require_a_draw_; |
| 860 | 847 |
| 861 std::unique_ptr<Viewport> viewport_; | 848 std::unique_ptr<Viewport> viewport_; |
| 862 | 849 |
| 863 std::unique_ptr<LayerTreeMutator> mutator_; | 850 std::unique_ptr<LayerTreeMutator> mutator_; |
| 864 | 851 |
| 865 bool has_fixed_raster_scale_blurry_content_; | |
| 866 std::bitset<kFixedRasterScaleAttemptedScaleChangeHistoryCount> | |
| 867 fixed_raster_scale_attempted_scale_change_history_; | |
| 868 std::unique_ptr<PendingTreeDurationHistogramTimer> | 852 std::unique_ptr<PendingTreeDurationHistogramTimer> |
| 869 pending_tree_duration_timer_; | 853 pending_tree_duration_timer_; |
| 870 | 854 |
| 871 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 855 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
| 872 }; | 856 }; |
| 873 | 857 |
| 874 } // namespace cc | 858 } // namespace cc |
| 875 | 859 |
| 876 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 860 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
| OLD | NEW |