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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 #include "ui/gfx/geometry/rect.h" | 43 #include "ui/gfx/geometry/rect.h" |
44 | 44 |
45 namespace gfx { | 45 namespace gfx { |
46 class ScrollOffset; | 46 class ScrollOffset; |
47 } | 47 } |
48 | 48 |
49 namespace cc { | 49 namespace cc { |
50 | 50 |
51 class CompletionEvent; | 51 class CompletionEvent; |
52 class CompositorFrameMetadata; | 52 class CompositorFrameMetadata; |
| 53 class CompositorMutator; |
53 class DebugRectHistory; | 54 class DebugRectHistory; |
54 class EvictionTilePriorityQueue; | 55 class EvictionTilePriorityQueue; |
55 class FrameRateCounter; | 56 class FrameRateCounter; |
56 class LayerImpl; | 57 class LayerImpl; |
57 class LayerTreeImpl; | 58 class LayerTreeImpl; |
58 class MemoryHistory; | 59 class MemoryHistory; |
59 class PageScaleAnimation; | 60 class PageScaleAnimation; |
60 class PaintTimeCounter; | 61 class PaintTimeCounter; |
61 class PictureLayerImpl; | 62 class PictureLayerImpl; |
62 class RasterTilePriorityQueue; | 63 class RasterTilePriorityQueue; |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 public ScrollbarAnimationControllerClient, | 136 public ScrollbarAnimationControllerClient, |
136 public base::SupportsWeakPtr<LayerTreeHostImpl> { | 137 public base::SupportsWeakPtr<LayerTreeHostImpl> { |
137 public: | 138 public: |
138 static scoped_ptr<LayerTreeHostImpl> Create( | 139 static scoped_ptr<LayerTreeHostImpl> Create( |
139 const LayerTreeSettings& settings, | 140 const LayerTreeSettings& settings, |
140 LayerTreeHostImplClient* client, | 141 LayerTreeHostImplClient* client, |
141 Proxy* proxy, | 142 Proxy* proxy, |
142 RenderingStatsInstrumentation* rendering_stats_instrumentation, | 143 RenderingStatsInstrumentation* rendering_stats_instrumentation, |
143 SharedBitmapManager* shared_bitmap_manager, | 144 SharedBitmapManager* shared_bitmap_manager, |
144 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 145 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
| 146 CompositorMutator* compositor_mutator, |
145 int id); | 147 int id); |
146 ~LayerTreeHostImpl() override; | 148 ~LayerTreeHostImpl() override; |
147 | 149 |
148 // InputHandler implementation | 150 // InputHandler implementation |
149 void BindToClient(InputHandlerClient* client) override; | 151 void BindToClient(InputHandlerClient* client) override; |
150 InputHandler::ScrollStatus ScrollBegin( | 152 InputHandler::ScrollStatus ScrollBegin( |
151 const gfx::Point& viewport_point, | 153 const gfx::Point& viewport_point, |
152 InputHandler::ScrollInputType type) override; | 154 InputHandler::ScrollInputType type) override; |
153 InputHandler::ScrollStatus ScrollAnimated( | 155 InputHandler::ScrollStatus ScrollAnimated( |
154 const gfx::Point& viewport_point, | 156 const gfx::Point& viewport_point, |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 | 208 |
207 // RenderPassSink implementation. | 209 // RenderPassSink implementation. |
208 void AppendRenderPass(scoped_ptr<RenderPass> render_pass) override; | 210 void AppendRenderPass(scoped_ptr<RenderPass> render_pass) override; |
209 }; | 211 }; |
210 | 212 |
211 virtual void BeginMainFrameAborted(CommitEarlyOutReason reason); | 213 virtual void BeginMainFrameAborted(CommitEarlyOutReason reason); |
212 virtual void BeginCommit(); | 214 virtual void BeginCommit(); |
213 virtual void CommitComplete(); | 215 virtual void CommitComplete(); |
214 virtual void Animate(base::TimeTicks monotonic_time); | 216 virtual void Animate(base::TimeTicks monotonic_time); |
215 virtual void UpdateAnimationState(bool start_ready_animations); | 217 virtual void UpdateAnimationState(bool start_ready_animations); |
| 218 void ApplyCustomMutations(base::TimeTicks monotinic_time); |
216 void ActivateAnimations(); | 219 void ActivateAnimations(); |
217 void MainThreadHasStoppedFlinging(); | 220 void MainThreadHasStoppedFlinging(); |
218 void DidAnimateScrollOffset(); | 221 void DidAnimateScrollOffset(); |
219 void SetViewportDamage(const gfx::Rect& damage_rect); | 222 void SetViewportDamage(const gfx::Rect& damage_rect); |
220 | 223 |
221 virtual void PrepareTiles(); | 224 virtual void PrepareTiles(); |
222 | 225 |
223 // Returns DRAW_SUCCESS unless problems occured preparing the frame, and we | 226 // Returns DRAW_SUCCESS unless problems occured preparing the frame, and we |
224 // should try to avoid displaying the frame. If PrepareToDraw is called, | 227 // should try to avoid displaying the frame. If PrepareToDraw is called, |
225 // DidDrawAllLayers must also be called, regardless of whether DrawLayers is | 228 // DidDrawAllLayers must also be called, regardless of whether DrawLayers is |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 } | 527 } |
525 | 528 |
526 protected: | 529 protected: |
527 LayerTreeHostImpl( | 530 LayerTreeHostImpl( |
528 const LayerTreeSettings& settings, | 531 const LayerTreeSettings& settings, |
529 LayerTreeHostImplClient* client, | 532 LayerTreeHostImplClient* client, |
530 Proxy* proxy, | 533 Proxy* proxy, |
531 RenderingStatsInstrumentation* rendering_stats_instrumentation, | 534 RenderingStatsInstrumentation* rendering_stats_instrumentation, |
532 SharedBitmapManager* shared_bitmap_manager, | 535 SharedBitmapManager* shared_bitmap_manager, |
533 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 536 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
| 537 CompositorMutator* compositor_mutator, |
534 int id); | 538 int id); |
535 | 539 |
536 | |
537 // Virtual for testing. | 540 // Virtual for testing. |
538 virtual void AnimateLayers(base::TimeTicks monotonic_time); | 541 virtual void AnimateLayers(base::TimeTicks monotonic_time); |
539 | 542 |
540 LayerTreeHostImplClient* client_; | 543 LayerTreeHostImplClient* client_; |
541 Proxy* proxy_; | 544 Proxy* proxy_; |
542 | 545 |
543 private: | 546 private: |
544 void CreateAndSetRenderer(); | 547 void CreateAndSetRenderer(); |
545 void CreateAndSetTileManager(); | 548 void CreateAndSetTileManager(); |
546 void DestroyTileManager(); | 549 void DestroyTileManager(); |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
724 | 727 |
725 RenderingStatsInstrumentation* rendering_stats_instrumentation_; | 728 RenderingStatsInstrumentation* rendering_stats_instrumentation_; |
726 MicroBenchmarkControllerImpl micro_benchmark_controller_; | 729 MicroBenchmarkControllerImpl micro_benchmark_controller_; |
727 scoped_ptr<TaskGraphRunner> single_thread_synchronous_task_graph_runner_; | 730 scoped_ptr<TaskGraphRunner> single_thread_synchronous_task_graph_runner_; |
728 | 731 |
729 // Optional callback to notify of new tree activations. | 732 // Optional callback to notify of new tree activations. |
730 base::Closure tree_activation_callback_; | 733 base::Closure tree_activation_callback_; |
731 | 734 |
732 SharedBitmapManager* shared_bitmap_manager_; | 735 SharedBitmapManager* shared_bitmap_manager_; |
733 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; | 736 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; |
| 737 |
| 738 CompositorMutator* compositor_mutator_; |
| 739 |
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 |