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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 class TopControlsManager; | 41 class TopControlsManager; |
42 struct RendererCapabilities; | 42 struct RendererCapabilities; |
43 | 43 |
44 // LayerTreeHost->Proxy callback interface. | 44 // LayerTreeHost->Proxy callback interface. |
45 class LayerTreeHostImplClient { | 45 class LayerTreeHostImplClient { |
46 public: | 46 public: |
47 virtual void DidLoseOutputSurfaceOnImplThread() = 0; | 47 virtual void DidLoseOutputSurfaceOnImplThread() = 0; |
48 virtual void OnSwapBuffersCompleteOnImplThread() = 0; | 48 virtual void OnSwapBuffersCompleteOnImplThread() = 0; |
49 virtual void OnVSyncParametersChanged(base::TimeTicks timebase, | 49 virtual void OnVSyncParametersChanged(base::TimeTicks timebase, |
50 base::TimeDelta interval) = 0; | 50 base::TimeDelta interval) = 0; |
| 51 virtual void DidVSync(base::TimeTicks frame_time) = 0; |
51 virtual void OnCanDrawStateChanged(bool can_draw) = 0; | 52 virtual void OnCanDrawStateChanged(bool can_draw) = 0; |
52 virtual void OnHasPendingTreeStateChanged(bool has_pending_tree) = 0; | 53 virtual void OnHasPendingTreeStateChanged(bool has_pending_tree) = 0; |
53 virtual void SetNeedsRedrawOnImplThread() = 0; | 54 virtual void SetNeedsRedrawOnImplThread() = 0; |
54 virtual void DidInitializeVisibleTileOnImplThread() = 0; | 55 virtual void DidInitializeVisibleTileOnImplThread() = 0; |
55 virtual void SetNeedsCommitOnImplThread() = 0; | 56 virtual void SetNeedsCommitOnImplThread() = 0; |
56 virtual void SetNeedsManageTilesOnImplThread() = 0; | 57 virtual void SetNeedsManageTilesOnImplThread() = 0; |
57 virtual void PostAnimationEventsToMainThreadOnImplThread( | 58 virtual void PostAnimationEventsToMainThreadOnImplThread( |
58 scoped_ptr<AnimationEventsVector> events, | 59 scoped_ptr<AnimationEventsVector> events, |
59 base::Time wall_clock_time) = 0; | 60 base::Time wall_clock_time) = 0; |
60 // Returns true if resources were deleted by this call. | 61 // Returns true if resources were deleted by this call. |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 virtual bool ShouldClearRootRenderPass() const OVERRIDE; | 167 virtual bool ShouldClearRootRenderPass() const OVERRIDE; |
167 virtual CompositorFrameMetadata MakeCompositorFrameMetadata() const OVERRIDE; | 168 virtual CompositorFrameMetadata MakeCompositorFrameMetadata() const OVERRIDE; |
168 | 169 |
169 // TileManagerClient implementation. | 170 // TileManagerClient implementation. |
170 virtual void ScheduleManageTiles() OVERRIDE; | 171 virtual void ScheduleManageTiles() OVERRIDE; |
171 virtual void DidInitializeVisibleTile() OVERRIDE; | 172 virtual void DidInitializeVisibleTile() OVERRIDE; |
172 | 173 |
173 // OutputSurfaceClient implementation. | 174 // OutputSurfaceClient implementation. |
174 virtual void OnVSyncParametersChanged(base::TimeTicks timebase, | 175 virtual void OnVSyncParametersChanged(base::TimeTicks timebase, |
175 base::TimeDelta interval) OVERRIDE; | 176 base::TimeDelta interval) OVERRIDE; |
| 177 virtual void DidVSync(base::TimeTicks frame_time) OVERRIDE; |
176 virtual void OnSendFrameToParentCompositorAck(const CompositorFrameAck& ack) | 178 virtual void OnSendFrameToParentCompositorAck(const CompositorFrameAck& ack) |
177 OVERRIDE; | 179 OVERRIDE; |
178 | 180 |
179 // Called from LayerTreeImpl. | 181 // Called from LayerTreeImpl. |
180 void OnCanDrawStateChangedForTree(); | 182 void OnCanDrawStateChangedForTree(); |
181 | 183 |
182 // Implementation | 184 // Implementation |
183 bool CanDraw(); | 185 bool CanDraw(); |
184 OutputSurface* output_surface() const { return output_surface_.get(); } | 186 OutputSurface* output_surface() const { return output_surface_.get(); } |
185 | 187 |
186 std::string LayerTreeAsText() const; | 188 std::string LayerTreeAsText() const; |
187 std::string LayerTreeAsJson() const; | 189 std::string LayerTreeAsJson() const; |
188 | 190 |
189 void FinishAllRendering(); | 191 void FinishAllRendering(); |
190 int SourceAnimationFrameNumber() const; | 192 int SourceAnimationFrameNumber() const; |
191 | 193 |
192 virtual bool InitializeRenderer(scoped_ptr<OutputSurface> output_surface); | 194 virtual bool InitializeRenderer(scoped_ptr<OutputSurface> output_surface); |
193 bool IsContextLost(); | 195 bool IsContextLost(); |
194 TileManager* tile_manager() { return tile_manager_.get(); } | 196 TileManager* tile_manager() { return tile_manager_.get(); } |
195 Renderer* renderer() { return renderer_.get(); } | 197 Renderer* renderer() { return renderer_.get(); } |
196 const RendererCapabilities& GetRendererCapabilities() const; | 198 const RendererCapabilities& GetRendererCapabilities() const; |
197 | 199 |
198 virtual bool SwapBuffers(); | 200 virtual bool SwapBuffers(); |
| 201 void EnableVSyncNotification(bool enable); |
199 | 202 |
200 void Readback(void* pixels, gfx::Rect rect_in_device_viewport); | 203 void Readback(void* pixels, gfx::Rect rect_in_device_viewport); |
201 | 204 |
202 LayerTreeImpl* active_tree() { return active_tree_.get(); } | 205 LayerTreeImpl* active_tree() { return active_tree_.get(); } |
203 const LayerTreeImpl* active_tree() const { return active_tree_.get(); } | 206 const LayerTreeImpl* active_tree() const { return active_tree_.get(); } |
204 LayerTreeImpl* pending_tree() { return pending_tree_.get(); } | 207 LayerTreeImpl* pending_tree() { return pending_tree_.get(); } |
205 const LayerTreeImpl* pending_tree() const { return pending_tree_.get(); } | 208 const LayerTreeImpl* pending_tree() const { return pending_tree_.get(); } |
206 const LayerTreeImpl* recycle_tree() const { return recycle_tree_.get(); } | 209 const LayerTreeImpl* recycle_tree() const { return recycle_tree_.get(); } |
207 void CreatePendingTree(); | 210 void CreatePendingTree(); |
208 void CheckForCompletedTileUploads(); | 211 void CheckForCompletedTileUploads(); |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 scoped_ptr<AnimationRegistrar> animation_registrar_; | 453 scoped_ptr<AnimationRegistrar> animation_registrar_; |
451 | 454 |
452 RenderingStatsInstrumentation* rendering_stats_instrumentation_; | 455 RenderingStatsInstrumentation* rendering_stats_instrumentation_; |
453 | 456 |
454 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 457 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
455 }; | 458 }; |
456 | 459 |
457 } // namespace cc | 460 } // namespace cc |
458 | 461 |
459 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 462 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
OLD | NEW |