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 <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 public ScrollbarAnimationControllerClient, | 135 public ScrollbarAnimationControllerClient, |
136 public base::SupportsWeakPtr<LayerTreeHostImpl> { | 136 public base::SupportsWeakPtr<LayerTreeHostImpl> { |
137 public: | 137 public: |
138 static scoped_ptr<LayerTreeHostImpl> Create( | 138 static scoped_ptr<LayerTreeHostImpl> Create( |
139 const LayerTreeSettings& settings, | 139 const LayerTreeSettings& settings, |
140 LayerTreeHostImplClient* client, | 140 LayerTreeHostImplClient* client, |
141 Proxy* proxy, | 141 Proxy* proxy, |
142 RenderingStatsInstrumentation* rendering_stats_instrumentation, | 142 RenderingStatsInstrumentation* rendering_stats_instrumentation, |
143 SharedBitmapManager* shared_bitmap_manager, | 143 SharedBitmapManager* shared_bitmap_manager, |
144 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 144 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
| 145 TaskGraphRunner* task_graph_runner, |
145 int id); | 146 int id); |
146 ~LayerTreeHostImpl() override; | 147 ~LayerTreeHostImpl() override; |
147 | 148 |
148 // InputHandler implementation | 149 // InputHandler implementation |
149 void BindToClient(InputHandlerClient* client) override; | 150 void BindToClient(InputHandlerClient* client) override; |
150 InputHandler::ScrollStatus ScrollBegin( | 151 InputHandler::ScrollStatus ScrollBegin( |
151 const gfx::Point& viewport_point, | 152 const gfx::Point& viewport_point, |
152 InputHandler::ScrollInputType type) override; | 153 InputHandler::ScrollInputType type) override; |
153 InputHandler::ScrollStatus ScrollAnimated( | 154 InputHandler::ScrollStatus ScrollAnimated( |
154 const gfx::Point& viewport_point, | 155 const gfx::Point& viewport_point, |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 } | 525 } |
525 | 526 |
526 protected: | 527 protected: |
527 LayerTreeHostImpl( | 528 LayerTreeHostImpl( |
528 const LayerTreeSettings& settings, | 529 const LayerTreeSettings& settings, |
529 LayerTreeHostImplClient* client, | 530 LayerTreeHostImplClient* client, |
530 Proxy* proxy, | 531 Proxy* proxy, |
531 RenderingStatsInstrumentation* rendering_stats_instrumentation, | 532 RenderingStatsInstrumentation* rendering_stats_instrumentation, |
532 SharedBitmapManager* shared_bitmap_manager, | 533 SharedBitmapManager* shared_bitmap_manager, |
533 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 534 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
| 535 TaskGraphRunner* task_graph_runner, |
534 int id); | 536 int id); |
535 | 537 |
536 | |
537 // Virtual for testing. | 538 // Virtual for testing. |
538 virtual void AnimateLayers(base::TimeTicks monotonic_time); | 539 virtual void AnimateLayers(base::TimeTicks monotonic_time); |
539 | 540 |
| 541 bool is_likely_to_require_a_draw() const { |
| 542 return is_likely_to_require_a_draw_; |
| 543 } |
| 544 |
540 LayerTreeHostImplClient* client_; | 545 LayerTreeHostImplClient* client_; |
541 Proxy* proxy_; | 546 Proxy* proxy_; |
542 | 547 |
543 private: | 548 private: |
544 void CreateAndSetRenderer(); | 549 void CreateAndSetRenderer(); |
545 void CreateAndSetTileManager(); | 550 void CreateAndSetTileManager(); |
546 void DestroyTileManager(); | 551 void DestroyTileManager(); |
547 void ReleaseTreeResources(); | 552 void ReleaseTreeResources(); |
548 void RecreateTreeResources(); | 553 void RecreateTreeResources(); |
549 void EnforceZeroBudget(bool zero_budget); | 554 void EnforceZeroBudget(bool zero_budget); |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
724 | 729 |
725 RenderingStatsInstrumentation* rendering_stats_instrumentation_; | 730 RenderingStatsInstrumentation* rendering_stats_instrumentation_; |
726 MicroBenchmarkControllerImpl micro_benchmark_controller_; | 731 MicroBenchmarkControllerImpl micro_benchmark_controller_; |
727 scoped_ptr<TaskGraphRunner> single_thread_synchronous_task_graph_runner_; | 732 scoped_ptr<TaskGraphRunner> single_thread_synchronous_task_graph_runner_; |
728 | 733 |
729 // Optional callback to notify of new tree activations. | 734 // Optional callback to notify of new tree activations. |
730 base::Closure tree_activation_callback_; | 735 base::Closure tree_activation_callback_; |
731 | 736 |
732 SharedBitmapManager* shared_bitmap_manager_; | 737 SharedBitmapManager* shared_bitmap_manager_; |
733 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; | 738 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; |
| 739 TaskGraphRunner* task_graph_runner_; |
734 int id_; | 740 int id_; |
735 | 741 |
736 std::set<SwapPromiseMonitor*> swap_promise_monitor_; | 742 std::set<SwapPromiseMonitor*> swap_promise_monitor_; |
737 std::vector<PictureLayerImpl::Pair> picture_layer_pairs_; | 743 std::vector<PictureLayerImpl::Pair> picture_layer_pairs_; |
738 | 744 |
739 bool requires_high_res_to_draw_; | 745 bool requires_high_res_to_draw_; |
740 bool is_likely_to_require_a_draw_; | 746 bool is_likely_to_require_a_draw_; |
741 | 747 |
742 scoped_ptr<FrameTimingTracker> frame_timing_tracker_; | 748 scoped_ptr<FrameTimingTracker> frame_timing_tracker_; |
743 | 749 |
744 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 750 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
745 }; | 751 }; |
746 | 752 |
747 } // namespace cc | 753 } // namespace cc |
748 | 754 |
749 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 755 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
OLD | NEW |