| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 virtual void DidActivatePendingTree() = 0; | 78 virtual void DidActivatePendingTree() = 0; |
| 79 | 79 |
| 80 protected: | 80 protected: |
| 81 virtual ~LayerTreeHostImplClient() {} | 81 virtual ~LayerTreeHostImplClient() {} |
| 82 }; | 82 }; |
| 83 | 83 |
| 84 // LayerTreeHostImpl owns the LayerImpl trees as well as associated rendering | 84 // LayerTreeHostImpl owns the LayerImpl trees as well as associated rendering |
| 85 // state. | 85 // state. |
| 86 class CC_EXPORT LayerTreeHostImpl : public InputHandler, | 86 class CC_EXPORT LayerTreeHostImpl |
| 87 public RendererClient, | 87 : public InputHandler, |
| 88 public TileManagerClient, | 88 public RendererClient, |
| 89 public OutputSurfaceClient, | 89 public TileManagerClient, |
| 90 public TopControlsManagerClient { | 90 public OutputSurfaceClient, |
| 91 public TopControlsManagerClient, |
| 92 public base::SupportsWeakPtr<LayerTreeHostImpl> { |
| 91 public: | 93 public: |
| 92 static scoped_ptr<LayerTreeHostImpl> Create( | 94 static scoped_ptr<LayerTreeHostImpl> Create( |
| 93 const LayerTreeSettings& settings, | 95 const LayerTreeSettings& settings, |
| 94 LayerTreeHostImplClient* client, | 96 LayerTreeHostImplClient* client, |
| 95 Proxy* proxy, | 97 Proxy* proxy, |
| 96 RenderingStatsInstrumentation* rendering_stats_instrumentation); | 98 RenderingStatsInstrumentation* rendering_stats_instrumentation); |
| 97 virtual ~LayerTreeHostImpl(); | 99 virtual ~LayerTreeHostImpl(); |
| 98 | 100 |
| 99 // InputHandler implementation | 101 // InputHandler implementation |
| 102 virtual void BindToClient(InputHandlerClient* client) OVERRIDE; |
| 100 virtual InputHandler::ScrollStatus ScrollBegin( | 103 virtual InputHandler::ScrollStatus ScrollBegin( |
| 101 gfx::Point viewport_point, | 104 gfx::Point viewport_point, |
| 102 InputHandler::ScrollInputType type) OVERRIDE; | 105 InputHandler::ScrollInputType type) OVERRIDE; |
| 103 virtual bool ScrollBy(gfx::Point viewport_point, | 106 virtual bool ScrollBy(gfx::Point viewport_point, |
| 104 gfx::Vector2dF scroll_delta) OVERRIDE; | 107 gfx::Vector2dF scroll_delta) OVERRIDE; |
| 105 virtual bool ScrollVerticallyByPage( | 108 virtual bool ScrollVerticallyByPage( |
| 106 gfx::Point viewport_point, | 109 gfx::Point viewport_point, |
| 107 WebKit::WebScrollbar::ScrollDirection direction) OVERRIDE; | 110 WebKit::WebScrollbar::ScrollDirection direction) OVERRIDE; |
| 108 virtual void SetRootLayerScrollOffsetDelegate( | 111 virtual void SetRootLayerScrollOffsetDelegate( |
| 109 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate) OVERRIDE; | 112 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate) OVERRIDE; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 | 150 |
| 148 // RenderPassSink implementation. | 151 // RenderPassSink implementation. |
| 149 virtual void AppendRenderPass(scoped_ptr<RenderPass> render_pass) OVERRIDE; | 152 virtual void AppendRenderPass(scoped_ptr<RenderPass> render_pass) OVERRIDE; |
| 150 }; | 153 }; |
| 151 | 154 |
| 152 virtual void BeginCommit(); | 155 virtual void BeginCommit(); |
| 153 virtual void CommitComplete(); | 156 virtual void CommitComplete(); |
| 154 virtual void Animate(base::TimeTicks monotonic_time, | 157 virtual void Animate(base::TimeTicks monotonic_time, |
| 155 base::Time wall_clock_time); | 158 base::Time wall_clock_time); |
| 156 virtual void UpdateAnimationState(bool start_ready_animations); | 159 virtual void UpdateAnimationState(bool start_ready_animations); |
| 160 void MainThreadHasStoppedFlinging(); |
| 157 void UpdateBackgroundAnimateTicking(bool should_background_tick); | 161 void UpdateBackgroundAnimateTicking(bool should_background_tick); |
| 158 void SetViewportDamage(gfx::Rect damage_rect); | 162 void SetViewportDamage(gfx::Rect damage_rect); |
| 159 | 163 |
| 160 void ManageTiles(); | 164 void ManageTiles(); |
| 161 | 165 |
| 162 // Returns false if problems occured preparing the frame, and we should try | 166 // Returns false if problems occured preparing the frame, and we should try |
| 163 // to avoid displaying the frame. If PrepareToDraw is called, DidDrawAllLayers | 167 // to avoid displaying the frame. If PrepareToDraw is called, DidDrawAllLayers |
| 164 // must also be called, regardless of whether DrawLayers is called between the | 168 // must also be called, regardless of whether DrawLayers is called between the |
| 165 // two. | 169 // two. |
| 166 virtual bool PrepareToDraw(FrameData* frame, | 170 virtual bool PrepareToDraw(FrameData* frame, |
| (...skipping 260 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 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 |