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 18 matching lines...) Expand all Loading... |
29 #include "cc/output/managed_memory_policy.h" | 29 #include "cc/output/managed_memory_policy.h" |
30 #include "cc/output/output_surface_client.h" | 30 #include "cc/output/output_surface_client.h" |
31 #include "cc/output/renderer.h" | 31 #include "cc/output/renderer.h" |
32 #include "cc/quads/render_pass.h" | 32 #include "cc/quads/render_pass.h" |
33 #include "cc/resources/resource_provider.h" | 33 #include "cc/resources/resource_provider.h" |
34 #include "cc/resources/tile_manager.h" | 34 #include "cc/resources/tile_manager.h" |
35 #include "cc/resources/ui_resource_client.h" | 35 #include "cc/resources/ui_resource_client.h" |
36 #include "cc/scheduler/commit_earlyout_reason.h" | 36 #include "cc/scheduler/commit_earlyout_reason.h" |
37 #include "cc/scheduler/draw_result.h" | 37 #include "cc/scheduler/draw_result.h" |
38 #include "cc/scheduler/video_frame_controller.h" | 38 #include "cc/scheduler/video_frame_controller.h" |
| 39 #include "cc/trees/layer_tree_mutators_client.h" |
39 #include "cc/trees/layer_tree_settings.h" | 40 #include "cc/trees/layer_tree_settings.h" |
40 #include "cc/trees/proxy.h" | 41 #include "cc/trees/proxy.h" |
41 #include "skia/ext/refptr.h" | 42 #include "skia/ext/refptr.h" |
42 #include "third_party/skia/include/core/SkColor.h" | 43 #include "third_party/skia/include/core/SkColor.h" |
43 #include "ui/gfx/geometry/rect.h" | 44 #include "ui/gfx/geometry/rect.h" |
44 | 45 |
45 namespace gfx { | 46 namespace gfx { |
46 class ScrollOffset; | 47 class ScrollOffset; |
47 } | 48 } |
48 | 49 |
49 namespace cc { | 50 namespace cc { |
50 | 51 |
| 52 class AnimationHost; |
51 class CompletionEvent; | 53 class CompletionEvent; |
52 class CompositorFrameMetadata; | 54 class CompositorFrameMetadata; |
53 class DebugRectHistory; | 55 class DebugRectHistory; |
54 class EvictionTilePriorityQueue; | 56 class EvictionTilePriorityQueue; |
55 class FrameRateCounter; | 57 class FrameRateCounter; |
56 class LayerImpl; | 58 class LayerImpl; |
57 class LayerTreeImpl; | 59 class LayerTreeImpl; |
58 class MemoryHistory; | 60 class MemoryHistory; |
59 class PageScaleAnimation; | 61 class PageScaleAnimation; |
60 class PaintTimeCounter; | 62 class PaintTimeCounter; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 // LayerTreeHostImpl owns the LayerImpl trees as well as associated rendering | 134 // LayerTreeHostImpl owns the LayerImpl trees as well as associated rendering |
133 // state. | 135 // state. |
134 class CC_EXPORT LayerTreeHostImpl | 136 class CC_EXPORT LayerTreeHostImpl |
135 : public InputHandler, | 137 : public InputHandler, |
136 public RendererClient, | 138 public RendererClient, |
137 public TileManagerClient, | 139 public TileManagerClient, |
138 public OutputSurfaceClient, | 140 public OutputSurfaceClient, |
139 public TopControlsManagerClient, | 141 public TopControlsManagerClient, |
140 public ScrollbarAnimationControllerClient, | 142 public ScrollbarAnimationControllerClient, |
141 public VideoFrameControllerClient, | 143 public VideoFrameControllerClient, |
| 144 public LayerTreeMutatorsClient, |
142 public base::SupportsWeakPtr<LayerTreeHostImpl> { | 145 public base::SupportsWeakPtr<LayerTreeHostImpl> { |
143 public: | 146 public: |
144 static scoped_ptr<LayerTreeHostImpl> Create( | 147 static scoped_ptr<LayerTreeHostImpl> Create( |
145 const LayerTreeSettings& settings, | 148 const LayerTreeSettings& settings, |
146 LayerTreeHostImplClient* client, | 149 LayerTreeHostImplClient* client, |
147 Proxy* proxy, | 150 Proxy* proxy, |
148 RenderingStatsInstrumentation* rendering_stats_instrumentation, | 151 RenderingStatsInstrumentation* rendering_stats_instrumentation, |
149 SharedBitmapManager* shared_bitmap_manager, | 152 SharedBitmapManager* shared_bitmap_manager, |
150 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 153 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
151 TaskGraphRunner* task_graph_runner, | 154 TaskGraphRunner* task_graph_runner, |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 virtual void BeginMainFrameAborted(CommitEarlyOutReason reason); | 221 virtual void BeginMainFrameAborted(CommitEarlyOutReason reason); |
219 virtual void BeginCommit(); | 222 virtual void BeginCommit(); |
220 virtual void CommitComplete(); | 223 virtual void CommitComplete(); |
221 virtual void Animate(base::TimeTicks monotonic_time); | 224 virtual void Animate(base::TimeTicks monotonic_time); |
222 virtual void UpdateAnimationState(bool start_ready_animations); | 225 virtual void UpdateAnimationState(bool start_ready_animations); |
223 void ActivateAnimations(); | 226 void ActivateAnimations(); |
224 void MainThreadHasStoppedFlinging(); | 227 void MainThreadHasStoppedFlinging(); |
225 void DidAnimateScrollOffset(); | 228 void DidAnimateScrollOffset(); |
226 void SetViewportDamage(const gfx::Rect& damage_rect); | 229 void SetViewportDamage(const gfx::Rect& damage_rect); |
227 | 230 |
| 231 void SetTreeLayerFilterMutated(int layer_id, |
| 232 LayerTreeImpl* tree, |
| 233 const FilterOperations& filters); |
| 234 void SetTreeLayerOpacityMutated(int layer_id, |
| 235 LayerTreeImpl* tree, |
| 236 float opacity); |
| 237 void SetTreeLayerTransformMutated(int layer_id, |
| 238 LayerTreeImpl* tree, |
| 239 const gfx::Transform& transform); |
| 240 void SetTreeLayerScrollOffsetMutated(int layer_id, |
| 241 LayerTreeImpl* tree, |
| 242 const gfx::ScrollOffset& scroll_offset); |
| 243 |
| 244 // LayerTreeMutatorsClient implementation. |
| 245 bool IsLayerInActiveTree(int layer_id) const override; |
| 246 bool IsLayerInPendingTree(int layer_id) const override; |
| 247 void SetMutatorsNeedCommit() override; |
| 248 void SetLayerFilterMutated(int layer_id, |
| 249 bool affects_active_tree, |
| 250 const FilterOperations& filters) override; |
| 251 void SetLayerOpacityMutated(int layer_id, |
| 252 bool affects_active_tree, |
| 253 float opacity) override; |
| 254 void SetLayerTransformMutated(int layer_id, |
| 255 bool affects_active_tree, |
| 256 const gfx::Transform& transform) override; |
| 257 void SetLayerScrollOffsetMutated( |
| 258 int layer_id, |
| 259 bool active_tree, |
| 260 const gfx::ScrollOffset& scroll_offset) override; |
| 261 |
228 virtual void PrepareTiles(); | 262 virtual void PrepareTiles(); |
229 | 263 |
230 // Returns DRAW_SUCCESS unless problems occured preparing the frame, and we | 264 // Returns DRAW_SUCCESS unless problems occured preparing the frame, and we |
231 // should try to avoid displaying the frame. If PrepareToDraw is called, | 265 // should try to avoid displaying the frame. If PrepareToDraw is called, |
232 // DidDrawAllLayers must also be called, regardless of whether DrawLayers is | 266 // DidDrawAllLayers must also be called, regardless of whether DrawLayers is |
233 // called between the two. | 267 // called between the two. |
234 virtual DrawResult PrepareToDraw(FrameData* frame); | 268 virtual DrawResult PrepareToDraw(FrameData* frame); |
235 virtual void DrawLayers(FrameData* frame, base::TimeTicks frame_begin_time); | 269 virtual void DrawLayers(FrameData* frame, base::TimeTicks frame_begin_time); |
236 // Must be called if and only if PrepareToDraw was called. | 270 // Must be called if and only if PrepareToDraw was called. |
237 void DidDrawAllLayers(const FrameData& frame); | 271 void DidDrawAllLayers(const FrameData& frame); |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 } | 456 } |
423 const GlobalStateThatImpactsTilePriority& global_tile_state() { | 457 const GlobalStateThatImpactsTilePriority& global_tile_state() { |
424 return global_tile_state_; | 458 return global_tile_state_; |
425 } | 459 } |
426 | 460 |
427 Proxy* proxy() const { return proxy_; } | 461 Proxy* proxy() const { return proxy_; } |
428 | 462 |
429 AnimationRegistrar* animation_registrar() const { | 463 AnimationRegistrar* animation_registrar() const { |
430 return animation_registrar_.get(); | 464 return animation_registrar_.get(); |
431 } | 465 } |
| 466 AnimationHost* animation_host() const { return animation_host_.get(); } |
432 | 467 |
433 void SetDebugState(const LayerTreeDebugState& new_debug_state); | 468 void SetDebugState(const LayerTreeDebugState& new_debug_state); |
434 const LayerTreeDebugState& debug_state() const { return debug_state_; } | 469 const LayerTreeDebugState& debug_state() const { return debug_state_; } |
435 | 470 |
436 gfx::Vector2dF accumulated_root_overscroll() const { | 471 gfx::Vector2dF accumulated_root_overscroll() const { |
437 return accumulated_root_overscroll_; | 472 return accumulated_root_overscroll_; |
438 } | 473 } |
439 | 474 |
440 bool pinch_gesture_active() const { return pinch_gesture_active_; } | 475 bool pinch_gesture_active() const { return pinch_gesture_active_; } |
441 | 476 |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
726 bool resourceless_software_draw_; | 761 bool resourceless_software_draw_; |
727 | 762 |
728 gfx::Rect viewport_damage_rect_; | 763 gfx::Rect viewport_damage_rect_; |
729 | 764 |
730 BeginFrameArgs current_begin_frame_args_; | 765 BeginFrameArgs current_begin_frame_args_; |
731 | 766 |
732 // Expected time between two begin impl frame calls. | 767 // Expected time between two begin impl frame calls. |
733 base::TimeDelta begin_impl_frame_interval_; | 768 base::TimeDelta begin_impl_frame_interval_; |
734 | 769 |
735 scoped_ptr<AnimationRegistrar> animation_registrar_; | 770 scoped_ptr<AnimationRegistrar> animation_registrar_; |
| 771 scoped_ptr<AnimationHost> animation_host_; |
736 std::set<ScrollbarAnimationController*> scrollbar_animation_controllers_; | 772 std::set<ScrollbarAnimationController*> scrollbar_animation_controllers_; |
737 std::set<VideoFrameController*> video_frame_controllers_; | 773 std::set<VideoFrameController*> video_frame_controllers_; |
738 | 774 |
739 RenderingStatsInstrumentation* rendering_stats_instrumentation_; | 775 RenderingStatsInstrumentation* rendering_stats_instrumentation_; |
740 MicroBenchmarkControllerImpl micro_benchmark_controller_; | 776 MicroBenchmarkControllerImpl micro_benchmark_controller_; |
741 scoped_ptr<TaskGraphRunner> single_thread_synchronous_task_graph_runner_; | 777 scoped_ptr<TaskGraphRunner> single_thread_synchronous_task_graph_runner_; |
742 | 778 |
743 // Optional callback to notify of new tree activations. | 779 // Optional callback to notify of new tree activations. |
744 base::Closure tree_activation_callback_; | 780 base::Closure tree_activation_callback_; |
745 | 781 |
(...skipping 11 matching lines...) Expand all Loading... |
757 scoped_ptr<FrameTimingTracker> frame_timing_tracker_; | 793 scoped_ptr<FrameTimingTracker> frame_timing_tracker_; |
758 | 794 |
759 scoped_ptr<Viewport> viewport_; | 795 scoped_ptr<Viewport> viewport_; |
760 | 796 |
761 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 797 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
762 }; | 798 }; |
763 | 799 |
764 } // namespace cc | 800 } // namespace cc |
765 | 801 |
766 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 802 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
OLD | NEW |