| 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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 scoped_ptr<LayerTreeImpl> active_tree_; | 430 scoped_ptr<LayerTreeImpl> active_tree_; |
| 427 | 431 |
| 428 // In impl-side painting mode, tree with possibly incomplete rasterized | 432 // In impl-side painting mode, tree with possibly incomplete rasterized |
| 429 // content. May be promoted to active by ActivatePendingTreeIfNeeded(). | 433 // content. May be promoted to active by ActivatePendingTreeIfNeeded(). |
| 430 scoped_ptr<LayerTreeImpl> pending_tree_; | 434 scoped_ptr<LayerTreeImpl> pending_tree_; |
| 431 | 435 |
| 432 // In impl-side painting mode, inert tree with layers that can be recycled | 436 // In impl-side painting mode, inert tree with layers that can be recycled |
| 433 // by the next sync from the main thread. | 437 // by the next sync from the main thread. |
| 434 scoped_ptr<LayerTreeImpl> recycle_tree_; | 438 scoped_ptr<LayerTreeImpl> recycle_tree_; |
| 435 | 439 |
| 440 InputHandlerClient* input_handler_client_; |
| 436 bool did_lock_scrolling_layer_; | 441 bool did_lock_scrolling_layer_; |
| 437 bool should_bubble_scrolls_; | 442 bool should_bubble_scrolls_; |
| 438 bool wheel_scrolling_; | 443 bool wheel_scrolling_; |
| 439 // The optional delegate for the root layer scroll offset. | 444 // The optional delegate for the root layer scroll offset. |
| 440 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate_; | 445 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate_; |
| 441 LayerTreeSettings settings_; | 446 LayerTreeSettings settings_; |
| 442 LayerTreeDebugState debug_state_; | 447 LayerTreeDebugState debug_state_; |
| 443 gfx::Size device_viewport_size_; | 448 gfx::Size device_viewport_size_; |
| 444 float overdraw_bottom_height_; | 449 float overdraw_bottom_height_; |
| 445 float device_scale_factor_; | 450 float device_scale_factor_; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 scoped_ptr<AnimationRegistrar> animation_registrar_; | 488 scoped_ptr<AnimationRegistrar> animation_registrar_; |
| 484 | 489 |
| 485 RenderingStatsInstrumentation* rendering_stats_instrumentation_; | 490 RenderingStatsInstrumentation* rendering_stats_instrumentation_; |
| 486 | 491 |
| 487 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 492 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
| 488 }; | 493 }; |
| 489 | 494 |
| 490 } // namespace cc | 495 } // namespace cc |
| 491 | 496 |
| 492 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 497 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
| OLD | NEW |