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 <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 virtual void RenewTreePriority() = 0; | 75 virtual void RenewTreePriority() = 0; |
76 virtual void RequestScrollbarAnimationOnImplThread(base::TimeDelta delay) = 0; | 76 virtual void RequestScrollbarAnimationOnImplThread(base::TimeDelta delay) = 0; |
77 virtual void DidReceiveLastInputEventForVSync(base::TimeTicks frame_time) = 0; | 77 virtual void DidReceiveLastInputEventForVSync(base::TimeTicks frame_time) = 0; |
78 | 78 |
79 protected: | 79 protected: |
80 virtual ~LayerTreeHostImplClient() {} | 80 virtual ~LayerTreeHostImplClient() {} |
81 }; | 81 }; |
82 | 82 |
83 // LayerTreeHostImpl owns the LayerImpl trees as well as associated rendering | 83 // LayerTreeHostImpl owns the LayerImpl trees as well as associated rendering |
84 // state. | 84 // state. |
85 class CC_EXPORT LayerTreeHostImpl : public InputHandler, | 85 class CC_EXPORT LayerTreeHostImpl |
86 public RendererClient, | 86 : public InputHandler, |
87 public TileManagerClient, | 87 public RendererClient, |
88 public OutputSurfaceClient, | 88 public TileManagerClient, |
89 public TopControlsManagerClient { | 89 public OutputSurfaceClient, |
| 90 public TopControlsManagerClient, |
| 91 public base::SupportsWeakPtr<LayerTreeHostImpl> { |
90 public: | 92 public: |
91 static scoped_ptr<LayerTreeHostImpl> Create( | 93 static scoped_ptr<LayerTreeHostImpl> Create( |
92 const LayerTreeSettings& settings, | 94 const LayerTreeSettings& settings, |
93 LayerTreeHostImplClient* client, | 95 LayerTreeHostImplClient* client, |
94 Proxy* proxy, | 96 Proxy* proxy, |
95 RenderingStatsInstrumentation* rendering_stats_instrumentation); | 97 RenderingStatsInstrumentation* rendering_stats_instrumentation); |
96 virtual ~LayerTreeHostImpl(); | 98 virtual ~LayerTreeHostImpl(); |
97 | 99 |
98 // InputHandler implementation | 100 // InputHandler implementation |
| 101 virtual void BindToClient(InputHandlerClient* client) OVERRIDE; |
99 virtual InputHandler::ScrollStatus ScrollBegin( | 102 virtual InputHandler::ScrollStatus ScrollBegin( |
100 gfx::Point viewport_point, | 103 gfx::Point viewport_point, |
101 InputHandler::ScrollInputType type) OVERRIDE; | 104 InputHandler::ScrollInputType type) OVERRIDE; |
102 virtual bool ScrollBy(gfx::Point viewport_point, | 105 virtual bool ScrollBy(gfx::Point viewport_point, |
103 gfx::Vector2dF scroll_delta) OVERRIDE; | 106 gfx::Vector2dF scroll_delta) OVERRIDE; |
104 virtual bool ScrollVerticallyByPage( | 107 virtual bool ScrollVerticallyByPage( |
105 gfx::Point viewport_point, | 108 gfx::Point viewport_point, |
106 WebKit::WebScrollbar::ScrollDirection direction) OVERRIDE; | 109 WebKit::WebScrollbar::ScrollDirection direction) OVERRIDE; |
107 virtual void SetRootLayerScrollOffsetDelegate( | 110 virtual void SetRootLayerScrollOffsetDelegate( |
108 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate) OVERRIDE; | 111 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate) OVERRIDE; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 | 149 |
147 // RenderPassSink implementation. | 150 // RenderPassSink implementation. |
148 virtual void AppendRenderPass(scoped_ptr<RenderPass> render_pass) OVERRIDE; | 151 virtual void AppendRenderPass(scoped_ptr<RenderPass> render_pass) OVERRIDE; |
149 }; | 152 }; |
150 | 153 |
151 virtual void BeginCommit(); | 154 virtual void BeginCommit(); |
152 virtual void CommitComplete(); | 155 virtual void CommitComplete(); |
153 virtual void Animate(base::TimeTicks monotonic_time, | 156 virtual void Animate(base::TimeTicks monotonic_time, |
154 base::Time wall_clock_time); | 157 base::Time wall_clock_time); |
155 virtual void UpdateAnimationState(bool start_ready_animations); | 158 virtual void UpdateAnimationState(bool start_ready_animations); |
| 159 void MainThreadHasStoppedFlinging(); |
156 void UpdateBackgroundAnimateTicking(bool should_background_tick); | 160 void UpdateBackgroundAnimateTicking(bool should_background_tick); |
157 void SetViewportDamage(gfx::Rect damage_rect); | 161 void SetViewportDamage(gfx::Rect damage_rect); |
158 | 162 |
159 void ManageTiles(); | 163 void ManageTiles(); |
160 | 164 |
161 // Returns false if problems occured preparing the frame, and we should try | 165 // Returns false if problems occured preparing the frame, and we should try |
162 // to avoid displaying the frame. If PrepareToDraw is called, DidDrawAllLayers | 166 // to avoid displaying the frame. If PrepareToDraw is called, DidDrawAllLayers |
163 // must also be called, regardless of whether DrawLayers is called between the | 167 // must also be called, regardless of whether DrawLayers is called between the |
164 // two. | 168 // two. |
165 virtual bool PrepareToDraw(FrameData* frame, | 169 virtual bool PrepareToDraw(FrameData* frame, |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 scoped_ptr<LayerTreeImpl> active_tree_; | 431 scoped_ptr<LayerTreeImpl> active_tree_; |
428 | 432 |
429 // In impl-side painting mode, tree with possibly incomplete rasterized | 433 // In impl-side painting mode, tree with possibly incomplete rasterized |
430 // content. May be promoted to active by ActivatePendingTreeIfNeeded(). | 434 // content. May be promoted to active by ActivatePendingTreeIfNeeded(). |
431 scoped_ptr<LayerTreeImpl> pending_tree_; | 435 scoped_ptr<LayerTreeImpl> pending_tree_; |
432 | 436 |
433 // In impl-side painting mode, inert tree with layers that can be recycled | 437 // In impl-side painting mode, inert tree with layers that can be recycled |
434 // by the next sync from the main thread. | 438 // by the next sync from the main thread. |
435 scoped_ptr<LayerTreeImpl> recycle_tree_; | 439 scoped_ptr<LayerTreeImpl> recycle_tree_; |
436 | 440 |
| 441 scoped_ptr<InputHandlerClient> input_handler_client_; |
437 bool did_lock_scrolling_layer_; | 442 bool did_lock_scrolling_layer_; |
438 bool should_bubble_scrolls_; | 443 bool should_bubble_scrolls_; |
439 bool wheel_scrolling_; | 444 bool wheel_scrolling_; |
440 // The optional delegate for the root layer scroll offset. | 445 // The optional delegate for the root layer scroll offset. |
441 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate_; | 446 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate_; |
442 LayerTreeSettings settings_; | 447 LayerTreeSettings settings_; |
443 LayerTreeDebugState debug_state_; | 448 LayerTreeDebugState debug_state_; |
444 gfx::Size device_viewport_size_; | 449 gfx::Size device_viewport_size_; |
445 float overdraw_bottom_height_; | 450 float overdraw_bottom_height_; |
446 float device_scale_factor_; | 451 float device_scale_factor_; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 scoped_ptr<AnimationRegistrar> animation_registrar_; | 489 scoped_ptr<AnimationRegistrar> animation_registrar_; |
485 | 490 |
486 RenderingStatsInstrumentation* rendering_stats_instrumentation_; | 491 RenderingStatsInstrumentation* rendering_stats_instrumentation_; |
487 | 492 |
488 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 493 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
489 }; | 494 }; |
490 | 495 |
491 } // namespace cc | 496 } // namespace cc |
492 | 497 |
493 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 498 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
OLD | NEW |