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