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 20 matching lines...) Expand all Loading... |
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/ui_resource_client.h" | 34 #include "cc/resources/ui_resource_client.h" |
35 #include "cc/scheduler/begin_frame_tracker.h" | 35 #include "cc/scheduler/begin_frame_tracker.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/tiles/tile_manager.h" | 39 #include "cc/tiles/tile_manager.h" |
40 #include "cc/trees/layer_tree_settings.h" | 40 #include "cc/trees/layer_tree_settings.h" |
| 41 #include "cc/trees/mutator_host_client.h" |
41 #include "cc/trees/proxy.h" | 42 #include "cc/trees/proxy.h" |
42 #include "skia/ext/refptr.h" | 43 #include "skia/ext/refptr.h" |
43 #include "third_party/skia/include/core/SkColor.h" | 44 #include "third_party/skia/include/core/SkColor.h" |
44 #include "ui/gfx/geometry/rect.h" | 45 #include "ui/gfx/geometry/rect.h" |
45 | 46 |
46 namespace gfx { | 47 namespace gfx { |
47 class ScrollOffset; | 48 class ScrollOffset; |
48 } | 49 } |
49 | 50 |
50 namespace cc { | 51 namespace cc { |
51 | 52 |
| 53 class AnimationHost; |
52 class CompletionEvent; | 54 class CompletionEvent; |
53 class CompositorFrameMetadata; | 55 class CompositorFrameMetadata; |
54 class DebugRectHistory; | 56 class DebugRectHistory; |
55 class EvictionTilePriorityQueue; | 57 class EvictionTilePriorityQueue; |
56 class FrameRateCounter; | 58 class FrameRateCounter; |
57 class LayerImpl; | 59 class LayerImpl; |
58 class LayerTreeImpl; | 60 class LayerTreeImpl; |
59 class MemoryHistory; | 61 class MemoryHistory; |
60 class PageScaleAnimation; | 62 class PageScaleAnimation; |
61 class PaintTimeCounter; | 63 class PaintTimeCounter; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 // LayerTreeHostImpl owns the LayerImpl trees as well as associated rendering | 140 // LayerTreeHostImpl owns the LayerImpl trees as well as associated rendering |
139 // state. | 141 // state. |
140 class CC_EXPORT LayerTreeHostImpl | 142 class CC_EXPORT LayerTreeHostImpl |
141 : public InputHandler, | 143 : public InputHandler, |
142 public RendererClient, | 144 public RendererClient, |
143 public TileManagerClient, | 145 public TileManagerClient, |
144 public OutputSurfaceClient, | 146 public OutputSurfaceClient, |
145 public TopControlsManagerClient, | 147 public TopControlsManagerClient, |
146 public ScrollbarAnimationControllerClient, | 148 public ScrollbarAnimationControllerClient, |
147 public VideoFrameControllerClient, | 149 public VideoFrameControllerClient, |
| 150 public MutatorHostClient, |
148 public base::SupportsWeakPtr<LayerTreeHostImpl> { | 151 public base::SupportsWeakPtr<LayerTreeHostImpl> { |
149 public: | 152 public: |
150 static scoped_ptr<LayerTreeHostImpl> Create( | 153 static scoped_ptr<LayerTreeHostImpl> Create( |
151 const LayerTreeSettings& settings, | 154 const LayerTreeSettings& settings, |
152 LayerTreeHostImplClient* client, | 155 LayerTreeHostImplClient* client, |
153 Proxy* proxy, | 156 Proxy* proxy, |
154 RenderingStatsInstrumentation* rendering_stats_instrumentation, | 157 RenderingStatsInstrumentation* rendering_stats_instrumentation, |
155 SharedBitmapManager* shared_bitmap_manager, | 158 SharedBitmapManager* shared_bitmap_manager, |
156 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 159 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
157 TaskGraphRunner* task_graph_runner, | 160 TaskGraphRunner* task_graph_runner, |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 virtual void BeginMainFrameAborted(CommitEarlyOutReason reason); | 227 virtual void BeginMainFrameAborted(CommitEarlyOutReason reason); |
225 virtual void BeginCommit(); | 228 virtual void BeginCommit(); |
226 virtual void CommitComplete(); | 229 virtual void CommitComplete(); |
227 virtual void Animate(base::TimeTicks monotonic_time); | 230 virtual void Animate(base::TimeTicks monotonic_time); |
228 virtual void UpdateAnimationState(bool start_ready_animations); | 231 virtual void UpdateAnimationState(bool start_ready_animations); |
229 void ActivateAnimations(); | 232 void ActivateAnimations(); |
230 void MainThreadHasStoppedFlinging(); | 233 void MainThreadHasStoppedFlinging(); |
231 void DidAnimateScrollOffset(); | 234 void DidAnimateScrollOffset(); |
232 void SetViewportDamage(const gfx::Rect& damage_rect); | 235 void SetViewportDamage(const gfx::Rect& damage_rect); |
233 | 236 |
| 237 void SetTreeLayerFilterMutated(int layer_id, |
| 238 LayerTreeImpl* tree, |
| 239 const FilterOperations& filters); |
| 240 void SetTreeLayerOpacityMutated(int layer_id, |
| 241 LayerTreeImpl* tree, |
| 242 float opacity); |
| 243 void SetTreeLayerTransformMutated(int layer_id, |
| 244 LayerTreeImpl* tree, |
| 245 const gfx::Transform& transform); |
| 246 void SetTreeLayerScrollOffsetMutated(int layer_id, |
| 247 LayerTreeImpl* tree, |
| 248 const gfx::ScrollOffset& scroll_offset); |
| 249 |
| 250 // LayerTreeMutatorsClient implementation. |
| 251 bool IsLayerInTree(int layer_id, LayerTreeType tree_type) const override; |
| 252 void SetMutatorsNeedCommit() override; |
| 253 void SetLayerFilterMutated(int layer_id, |
| 254 LayerTreeType tree_type, |
| 255 const FilterOperations& filters) override; |
| 256 void SetLayerOpacityMutated(int layer_id, |
| 257 LayerTreeType tree_type, |
| 258 float opacity) override; |
| 259 void SetLayerTransformMutated(int layer_id, |
| 260 LayerTreeType tree_type, |
| 261 const gfx::Transform& transform) override; |
| 262 void SetLayerScrollOffsetMutated( |
| 263 int layer_id, |
| 264 LayerTreeType tree_type, |
| 265 const gfx::ScrollOffset& scroll_offset) override; |
| 266 |
234 virtual void PrepareTiles(); | 267 virtual void PrepareTiles(); |
235 | 268 |
236 // Returns DRAW_SUCCESS unless problems occured preparing the frame, and we | 269 // Returns DRAW_SUCCESS unless problems occured preparing the frame, and we |
237 // should try to avoid displaying the frame. If PrepareToDraw is called, | 270 // should try to avoid displaying the frame. If PrepareToDraw is called, |
238 // DidDrawAllLayers must also be called, regardless of whether DrawLayers is | 271 // DidDrawAllLayers must also be called, regardless of whether DrawLayers is |
239 // called between the two. | 272 // called between the two. |
240 virtual DrawResult PrepareToDraw(FrameData* frame); | 273 virtual DrawResult PrepareToDraw(FrameData* frame); |
241 virtual void DrawLayers(FrameData* frame); | 274 virtual void DrawLayers(FrameData* frame); |
242 // Must be called if and only if PrepareToDraw was called. | 275 // Must be called if and only if PrepareToDraw was called. |
243 void DidDrawAllLayers(const FrameData& frame); | 276 void DidDrawAllLayers(const FrameData& frame); |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 } | 471 } |
439 const GlobalStateThatImpactsTilePriority& global_tile_state() { | 472 const GlobalStateThatImpactsTilePriority& global_tile_state() { |
440 return global_tile_state_; | 473 return global_tile_state_; |
441 } | 474 } |
442 | 475 |
443 Proxy* proxy() const { return proxy_; } | 476 Proxy* proxy() const { return proxy_; } |
444 | 477 |
445 AnimationRegistrar* animation_registrar() const { | 478 AnimationRegistrar* animation_registrar() const { |
446 return animation_registrar_.get(); | 479 return animation_registrar_.get(); |
447 } | 480 } |
| 481 AnimationHost* animation_host() const { return animation_host_.get(); } |
448 | 482 |
449 void SetDebugState(const LayerTreeDebugState& new_debug_state); | 483 void SetDebugState(const LayerTreeDebugState& new_debug_state); |
450 const LayerTreeDebugState& debug_state() const { return debug_state_; } | 484 const LayerTreeDebugState& debug_state() const { return debug_state_; } |
451 | 485 |
452 gfx::Vector2dF accumulated_root_overscroll() const { | 486 gfx::Vector2dF accumulated_root_overscroll() const { |
453 return accumulated_root_overscroll_; | 487 return accumulated_root_overscroll_; |
454 } | 488 } |
455 | 489 |
456 bool pinch_gesture_active() const { return pinch_gesture_active_; } | 490 bool pinch_gesture_active() const { return pinch_gesture_active_; } |
457 | 491 |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
744 // tiling priority. | 778 // tiling priority. |
745 gfx::Transform external_transform_; | 779 gfx::Transform external_transform_; |
746 gfx::Rect external_viewport_; | 780 gfx::Rect external_viewport_; |
747 gfx::Rect external_clip_; | 781 gfx::Rect external_clip_; |
748 gfx::Rect viewport_rect_for_tile_priority_; | 782 gfx::Rect viewport_rect_for_tile_priority_; |
749 bool resourceless_software_draw_; | 783 bool resourceless_software_draw_; |
750 | 784 |
751 gfx::Rect viewport_damage_rect_; | 785 gfx::Rect viewport_damage_rect_; |
752 | 786 |
753 scoped_ptr<AnimationRegistrar> animation_registrar_; | 787 scoped_ptr<AnimationRegistrar> animation_registrar_; |
| 788 scoped_ptr<AnimationHost> animation_host_; |
754 std::set<ScrollbarAnimationController*> scrollbar_animation_controllers_; | 789 std::set<ScrollbarAnimationController*> scrollbar_animation_controllers_; |
755 std::set<VideoFrameController*> video_frame_controllers_; | 790 std::set<VideoFrameController*> video_frame_controllers_; |
756 | 791 |
757 RenderingStatsInstrumentation* rendering_stats_instrumentation_; | 792 RenderingStatsInstrumentation* rendering_stats_instrumentation_; |
758 MicroBenchmarkControllerImpl micro_benchmark_controller_; | 793 MicroBenchmarkControllerImpl micro_benchmark_controller_; |
759 scoped_ptr<TaskGraphRunner> single_thread_synchronous_task_graph_runner_; | 794 scoped_ptr<TaskGraphRunner> single_thread_synchronous_task_graph_runner_; |
760 | 795 |
761 // Optional callback to notify of new tree activations. | 796 // Optional callback to notify of new tree activations. |
762 base::Closure tree_activation_callback_; | 797 base::Closure tree_activation_callback_; |
763 | 798 |
(...skipping 10 matching lines...) Expand all Loading... |
774 scoped_ptr<FrameTimingTracker> frame_timing_tracker_; | 809 scoped_ptr<FrameTimingTracker> frame_timing_tracker_; |
775 | 810 |
776 scoped_ptr<Viewport> viewport_; | 811 scoped_ptr<Viewport> viewport_; |
777 | 812 |
778 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 813 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
779 }; | 814 }; |
780 | 815 |
781 } // namespace cc | 816 } // namespace cc |
782 | 817 |
783 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 818 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
OLD | NEW |