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 17 matching lines...) Expand all Loading... |
28 #include "cc/output/begin_frame_args.h" | 28 #include "cc/output/begin_frame_args.h" |
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/trees/layer_tree_mutators_client.h" |
38 #include "cc/trees/layer_tree_settings.h" | 39 #include "cc/trees/layer_tree_settings.h" |
39 #include "cc/trees/proxy.h" | 40 #include "cc/trees/proxy.h" |
40 #include "skia/ext/refptr.h" | 41 #include "skia/ext/refptr.h" |
41 #include "third_party/skia/include/core/SkColor.h" | 42 #include "third_party/skia/include/core/SkColor.h" |
42 #include "ui/gfx/geometry/rect.h" | 43 #include "ui/gfx/geometry/rect.h" |
43 | 44 |
44 namespace gfx { | 45 namespace gfx { |
45 class ScrollOffset; | 46 class ScrollOffset; |
46 } | 47 } |
47 | 48 |
48 namespace cc { | 49 namespace cc { |
49 | 50 |
| 51 class AnimationHost; |
50 class CompletionEvent; | 52 class CompletionEvent; |
51 class CompositorFrameMetadata; | 53 class CompositorFrameMetadata; |
52 class DebugRectHistory; | 54 class DebugRectHistory; |
53 class EvictionTilePriorityQueue; | 55 class EvictionTilePriorityQueue; |
54 class FrameRateCounter; | 56 class FrameRateCounter; |
55 class LayerImpl; | 57 class LayerImpl; |
56 class LayerTreeImpl; | 58 class LayerTreeImpl; |
57 class MemoryHistory; | 59 class MemoryHistory; |
58 class PageScaleAnimation; | 60 class PageScaleAnimation; |
59 class PaintTimeCounter; | 61 class PaintTimeCounter; |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 | 131 |
130 // LayerTreeHostImpl owns the LayerImpl trees as well as associated rendering | 132 // LayerTreeHostImpl owns the LayerImpl trees as well as associated rendering |
131 // state. | 133 // state. |
132 class CC_EXPORT LayerTreeHostImpl | 134 class CC_EXPORT LayerTreeHostImpl |
133 : public InputHandler, | 135 : public InputHandler, |
134 public RendererClient, | 136 public RendererClient, |
135 public TileManagerClient, | 137 public TileManagerClient, |
136 public OutputSurfaceClient, | 138 public OutputSurfaceClient, |
137 public TopControlsManagerClient, | 139 public TopControlsManagerClient, |
138 public ScrollbarAnimationControllerClient, | 140 public ScrollbarAnimationControllerClient, |
139 public base::SupportsWeakPtr<LayerTreeHostImpl> { | 141 public base::SupportsWeakPtr<LayerTreeHostImpl>, |
| 142 public LayerTreeMutatorsClient { |
140 public: | 143 public: |
141 static scoped_ptr<LayerTreeHostImpl> Create( | 144 static scoped_ptr<LayerTreeHostImpl> Create( |
142 const LayerTreeSettings& settings, | 145 const LayerTreeSettings& settings, |
143 LayerTreeHostImplClient* client, | 146 LayerTreeHostImplClient* client, |
144 Proxy* proxy, | 147 Proxy* proxy, |
145 RenderingStatsInstrumentation* rendering_stats_instrumentation, | 148 RenderingStatsInstrumentation* rendering_stats_instrumentation, |
146 SharedBitmapManager* shared_bitmap_manager, | 149 SharedBitmapManager* shared_bitmap_manager, |
147 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 150 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
148 TaskGraphRunner* task_graph_runner, | 151 TaskGraphRunner* task_graph_runner, |
149 int id); | 152 int id); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 virtual void BeginMainFrameAborted(CommitEarlyOutReason reason); | 218 virtual void BeginMainFrameAborted(CommitEarlyOutReason reason); |
216 virtual void BeginCommit(); | 219 virtual void BeginCommit(); |
217 virtual void CommitComplete(); | 220 virtual void CommitComplete(); |
218 virtual void Animate(base::TimeTicks monotonic_time); | 221 virtual void Animate(base::TimeTicks monotonic_time); |
219 virtual void UpdateAnimationState(bool start_ready_animations); | 222 virtual void UpdateAnimationState(bool start_ready_animations); |
220 void ActivateAnimations(); | 223 void ActivateAnimations(); |
221 void MainThreadHasStoppedFlinging(); | 224 void MainThreadHasStoppedFlinging(); |
222 void DidAnimateScrollOffset(); | 225 void DidAnimateScrollOffset(); |
223 void SetViewportDamage(const gfx::Rect& damage_rect); | 226 void SetViewportDamage(const gfx::Rect& damage_rect); |
224 | 227 |
| 228 void SetTreeLayerFilterMutated(int layer_id, |
| 229 LayerTreeImpl* tree, |
| 230 const FilterOperations& filters); |
| 231 void SetTreeLayerOpacityMutated(int layer_id, |
| 232 LayerTreeImpl* tree, |
| 233 float opacity); |
| 234 void SetTreeLayerTransformMutated(int layer_id, |
| 235 LayerTreeImpl* tree, |
| 236 const gfx::Transform& transform); |
| 237 void SetTreeLayerScrollOffsetMutated(int layer_id, |
| 238 LayerTreeImpl* tree, |
| 239 const gfx::ScrollOffset& scroll_offset); |
| 240 |
| 241 // LayerTreeMutatorsClient implementation. |
| 242 bool IsLayerInActiveTree(int layer_id) const override; |
| 243 bool IsLayerInPendingTree(int layer_id) const override; |
| 244 void SetMutatorsNeedCommit() override; |
| 245 void SetLayerFilterMutated(int layer_id, |
| 246 bool affects_active_tree, |
| 247 const FilterOperations& filters) override; |
| 248 void SetLayerOpacityMutated(int layer_id, |
| 249 bool affects_active_tree, |
| 250 float opacity) override; |
| 251 void SetLayerTransformMutated(int layer_id, |
| 252 bool affects_active_tree, |
| 253 const gfx::Transform& transform) override; |
| 254 void SetLayerScrollOffsetMutated( |
| 255 int layer_id, |
| 256 bool active_tree, |
| 257 const gfx::ScrollOffset& scroll_offset) override; |
| 258 |
225 virtual void PrepareTiles(); | 259 virtual void PrepareTiles(); |
226 | 260 |
227 // Returns DRAW_SUCCESS unless problems occured preparing the frame, and we | 261 // Returns DRAW_SUCCESS unless problems occured preparing the frame, and we |
228 // should try to avoid displaying the frame. If PrepareToDraw is called, | 262 // should try to avoid displaying the frame. If PrepareToDraw is called, |
229 // DidDrawAllLayers must also be called, regardless of whether DrawLayers is | 263 // DidDrawAllLayers must also be called, regardless of whether DrawLayers is |
230 // called between the two. | 264 // called between the two. |
231 virtual DrawResult PrepareToDraw(FrameData* frame); | 265 virtual DrawResult PrepareToDraw(FrameData* frame); |
232 virtual void DrawLayers(FrameData* frame, base::TimeTicks frame_begin_time); | 266 virtual void DrawLayers(FrameData* frame, base::TimeTicks frame_begin_time); |
233 // Must be called if and only if PrepareToDraw was called. | 267 // Must be called if and only if PrepareToDraw was called. |
234 void DidDrawAllLayers(const FrameData& frame); | 268 void DidDrawAllLayers(const FrameData& frame); |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 } | 449 } |
416 const GlobalStateThatImpactsTilePriority& global_tile_state() { | 450 const GlobalStateThatImpactsTilePriority& global_tile_state() { |
417 return global_tile_state_; | 451 return global_tile_state_; |
418 } | 452 } |
419 | 453 |
420 Proxy* proxy() const { return proxy_; } | 454 Proxy* proxy() const { return proxy_; } |
421 | 455 |
422 AnimationRegistrar* animation_registrar() const { | 456 AnimationRegistrar* animation_registrar() const { |
423 return animation_registrar_.get(); | 457 return animation_registrar_.get(); |
424 } | 458 } |
| 459 AnimationHost* animation_host() const { return animation_host_.get(); } |
425 | 460 |
426 void SetDebugState(const LayerTreeDebugState& new_debug_state); | 461 void SetDebugState(const LayerTreeDebugState& new_debug_state); |
427 const LayerTreeDebugState& debug_state() const { return debug_state_; } | 462 const LayerTreeDebugState& debug_state() const { return debug_state_; } |
428 | 463 |
429 class CC_EXPORT CullRenderPassesWithNoQuads { | 464 class CC_EXPORT CullRenderPassesWithNoQuads { |
430 public: | 465 public: |
431 bool ShouldRemoveRenderPass(const RenderPassDrawQuad& quad, | 466 bool ShouldRemoveRenderPass(const RenderPassDrawQuad& quad, |
432 const FrameData& frame) const; | 467 const FrameData& frame) const; |
433 | 468 |
434 // Iterates in draw order, so that when a surface is removed, and its | 469 // Iterates in draw order, so that when a surface is removed, and its |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
732 bool resourceless_software_draw_; | 767 bool resourceless_software_draw_; |
733 | 768 |
734 gfx::Rect viewport_damage_rect_; | 769 gfx::Rect viewport_damage_rect_; |
735 | 770 |
736 BeginFrameArgs current_begin_frame_args_; | 771 BeginFrameArgs current_begin_frame_args_; |
737 | 772 |
738 // Expected time between two begin impl frame calls. | 773 // Expected time between two begin impl frame calls. |
739 base::TimeDelta begin_impl_frame_interval_; | 774 base::TimeDelta begin_impl_frame_interval_; |
740 | 775 |
741 scoped_ptr<AnimationRegistrar> animation_registrar_; | 776 scoped_ptr<AnimationRegistrar> animation_registrar_; |
| 777 scoped_ptr<AnimationHost> animation_host_; |
742 std::set<ScrollbarAnimationController*> scrollbar_animation_controllers_; | 778 std::set<ScrollbarAnimationController*> scrollbar_animation_controllers_; |
743 | 779 |
744 RenderingStatsInstrumentation* rendering_stats_instrumentation_; | 780 RenderingStatsInstrumentation* rendering_stats_instrumentation_; |
745 MicroBenchmarkControllerImpl micro_benchmark_controller_; | 781 MicroBenchmarkControllerImpl micro_benchmark_controller_; |
746 scoped_ptr<TaskGraphRunner> single_thread_synchronous_task_graph_runner_; | 782 scoped_ptr<TaskGraphRunner> single_thread_synchronous_task_graph_runner_; |
747 | 783 |
748 // Optional callback to notify of new tree activations. | 784 // Optional callback to notify of new tree activations. |
749 base::Closure tree_activation_callback_; | 785 base::Closure tree_activation_callback_; |
750 | 786 |
751 SharedBitmapManager* shared_bitmap_manager_; | 787 SharedBitmapManager* shared_bitmap_manager_; |
(...skipping 10 matching lines...) Expand all Loading... |
762 scoped_ptr<FrameTimingTracker> frame_timing_tracker_; | 798 scoped_ptr<FrameTimingTracker> frame_timing_tracker_; |
763 | 799 |
764 scoped_ptr<Viewport> viewport_; | 800 scoped_ptr<Viewport> viewport_; |
765 | 801 |
766 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 802 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
767 }; | 803 }; |
768 | 804 |
769 } // namespace cc | 805 } // namespace cc |
770 | 806 |
771 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 807 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
OLD | NEW |