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 <memory> | 11 #include <memory> |
11 #include <set> | 12 #include <set> |
12 #include <string> | 13 #include <string> |
13 #include <unordered_map> | 14 #include <unordered_map> |
14 #include <vector> | 15 #include <vector> |
15 | 16 |
16 #include "base/callback.h" | 17 #include "base/callback.h" |
17 #include "base/macros.h" | 18 #include "base/macros.h" |
18 #include "base/time/time.h" | 19 #include "base/time/time.h" |
19 #include "cc/animation/layer_tree_mutator.h" | 20 #include "cc/animation/layer_tree_mutator.h" |
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
607 ScrollNode* scroll_node) const; | 608 ScrollNode* scroll_node) const; |
608 | 609 |
609 // Returns true if a scroll offset animation is created and false if we scroll | 610 // Returns true if a scroll offset animation is created and false if we scroll |
610 // by the desired amount without an animation. | 611 // by the desired amount without an animation. |
611 bool ScrollAnimationCreate(ScrollNode* scroll_node, | 612 bool ScrollAnimationCreate(ScrollNode* scroll_node, |
612 const gfx::Vector2dF& scroll_amount); | 613 const gfx::Vector2dF& scroll_amount); |
613 | 614 |
614 void SetLayerTreeMutator(LayerTreeMutator* mutator); | 615 void SetLayerTreeMutator(LayerTreeMutator* mutator); |
615 LayerTreeMutator* mutator() { return mutator_; } | 616 LayerTreeMutator* mutator() { return mutator_; } |
616 | 617 |
618 void set_fixed_raster_scale_has_blurry_content() { | |
619 has_fixed_raster_scale_blurry_content_ = true; | |
620 } | |
621 bool has_fixed_raster_scale_blurry_content() const { | |
622 return has_fixed_raster_scale_blurry_content_; | |
623 } | |
624 | |
625 bool HasFixedRasterScalePotentialPerformanceRegression() const; | |
626 void SetFixedRasterScaleAttemptedToChangeScale(); | |
627 | |
617 protected: | 628 protected: |
618 LayerTreeHostImpl( | 629 LayerTreeHostImpl( |
619 const LayerTreeSettings& settings, | 630 const LayerTreeSettings& settings, |
620 LayerTreeHostImplClient* client, | 631 LayerTreeHostImplClient* client, |
621 TaskRunnerProvider* task_runner_provider, | 632 TaskRunnerProvider* task_runner_provider, |
622 RenderingStatsInstrumentation* rendering_stats_instrumentation, | 633 RenderingStatsInstrumentation* rendering_stats_instrumentation, |
623 SharedBitmapManager* shared_bitmap_manager, | 634 SharedBitmapManager* shared_bitmap_manager, |
624 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 635 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
625 TaskGraphRunner* task_graph_runner, | 636 TaskGraphRunner* task_graph_runner, |
626 int id); | 637 int id); |
627 | 638 |
628 // Virtual for testing. | 639 // Virtual for testing. |
629 virtual bool AnimateLayers(base::TimeTicks monotonic_time); | 640 virtual bool AnimateLayers(base::TimeTicks monotonic_time); |
630 | 641 |
631 bool is_likely_to_require_a_draw() const { | 642 bool is_likely_to_require_a_draw() const { |
632 return is_likely_to_require_a_draw_; | 643 return is_likely_to_require_a_draw_; |
633 } | 644 } |
634 | 645 |
635 // Removes empty or orphan RenderPasses from the frame. | 646 // Removes empty or orphan RenderPasses from the frame. |
636 static void RemoveRenderPasses(FrameData* frame); | 647 static void RemoveRenderPasses(FrameData* frame); |
637 | 648 |
638 LayerTreeHostImplClient* client_; | 649 LayerTreeHostImplClient* client_; |
639 TaskRunnerProvider* task_runner_provider_; | 650 TaskRunnerProvider* task_runner_provider_; |
640 | 651 |
641 BeginFrameTracker current_begin_frame_tracker_; | 652 BeginFrameTracker current_begin_frame_tracker_; |
642 | 653 |
643 private: | 654 private: |
655 enum { | |
656 kFixedRasterScaleAttemptedScaleChangeThreshold = 5, | |
danakj
2016/05/05 00:09:49
1 value per if you're doing this with enums.
enum
vmpstr
2016/05/05 01:33:51
Done.
| |
657 kFixedRasterScaleAttemptedScaleChangeHistoryCount = 10 | |
658 }; | |
659 | |
644 gfx::Vector2dF ScrollNodeWithViewportSpaceDelta( | 660 gfx::Vector2dF ScrollNodeWithViewportSpaceDelta( |
645 ScrollNode* scroll_node, | 661 ScrollNode* scroll_node, |
646 const gfx::PointF& viewport_point, | 662 const gfx::PointF& viewport_point, |
647 const gfx::Vector2dF& viewport_delta, | 663 const gfx::Vector2dF& viewport_delta, |
648 ScrollTree* scroll_tree); | 664 ScrollTree* scroll_tree); |
649 | 665 |
650 void CreateAndSetRenderer(); | 666 void CreateAndSetRenderer(); |
651 void CleanUpTileManagerAndUIResources(); | 667 void CleanUpTileManagerAndUIResources(); |
652 void CreateTileManagerResources(); | 668 void CreateTileManagerResources(); |
653 void ReleaseTreeResources(); | 669 void ReleaseTreeResources(); |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
837 | 853 |
838 std::set<SwapPromiseMonitor*> swap_promise_monitor_; | 854 std::set<SwapPromiseMonitor*> swap_promise_monitor_; |
839 | 855 |
840 bool requires_high_res_to_draw_; | 856 bool requires_high_res_to_draw_; |
841 bool is_likely_to_require_a_draw_; | 857 bool is_likely_to_require_a_draw_; |
842 | 858 |
843 std::unique_ptr<Viewport> viewport_; | 859 std::unique_ptr<Viewport> viewport_; |
844 | 860 |
845 LayerTreeMutator* mutator_; | 861 LayerTreeMutator* mutator_; |
846 | 862 |
863 bool has_fixed_raster_scale_blurry_content_; | |
864 std::bitset<kFixedRasterScaleAttemptedScaleChangeHistoryCount> | |
865 fixed_raster_scale_attempted_scale_change_history_; | |
866 | |
847 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 867 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
848 }; | 868 }; |
849 | 869 |
850 } // namespace cc | 870 } // namespace cc |
851 | 871 |
852 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 872 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
OLD | NEW |