Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Side by Side Diff: cc/trees/layer_tree_host_impl.h

Issue 12674030: cc: Hook vsync time source to output surface (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Review tweaks. Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/test/fake_output_surface.cc ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 virtual bool ShouldClearRootRenderPass() const OVERRIDE; 170 virtual bool ShouldClearRootRenderPass() const OVERRIDE;
170 virtual CompositorFrameMetadata MakeCompositorFrameMetadata() const OVERRIDE; 171 virtual CompositorFrameMetadata MakeCompositorFrameMetadata() const OVERRIDE;
171 172
172 // TileManagerClient implementation. 173 // TileManagerClient implementation.
173 virtual void ScheduleManageTiles() OVERRIDE; 174 virtual void ScheduleManageTiles() OVERRIDE;
174 virtual void DidInitializeVisibleTile() OVERRIDE; 175 virtual void DidInitializeVisibleTile() OVERRIDE;
175 176
176 // OutputSurfaceClient implementation. 177 // OutputSurfaceClient implementation.
177 virtual void OnVSyncParametersChanged(base::TimeTicks timebase, 178 virtual void OnVSyncParametersChanged(base::TimeTicks timebase,
178 base::TimeDelta interval) OVERRIDE; 179 base::TimeDelta interval) OVERRIDE;
180 virtual void DidVSync(base::TimeTicks frame_time) OVERRIDE;
179 virtual void OnSendFrameToParentCompositorAck(const CompositorFrameAck& ack) 181 virtual void OnSendFrameToParentCompositorAck(const CompositorFrameAck& ack)
180 OVERRIDE; 182 OVERRIDE;
181 183
182 // Called from LayerTreeImpl. 184 // Called from LayerTreeImpl.
183 void OnCanDrawStateChangedForTree(); 185 void OnCanDrawStateChangedForTree();
184 186
185 // Implementation 187 // Implementation
186 bool CanDraw(); 188 bool CanDraw();
187 OutputSurface* output_surface() const { return output_surface_.get(); } 189 OutputSurface* output_surface() const { return output_surface_.get(); }
188 190
189 std::string LayerTreeAsText() const; 191 std::string LayerTreeAsText() const;
190 std::string LayerTreeAsJson() const; 192 std::string LayerTreeAsJson() const;
191 193
192 void FinishAllRendering(); 194 void FinishAllRendering();
193 int SourceAnimationFrameNumber() const; 195 int SourceAnimationFrameNumber() const;
194 196
195 virtual bool InitializeRenderer(scoped_ptr<OutputSurface> output_surface); 197 virtual bool InitializeRenderer(scoped_ptr<OutputSurface> output_surface);
196 bool IsContextLost(); 198 bool IsContextLost();
197 TileManager* tile_manager() { return tile_manager_.get(); } 199 TileManager* tile_manager() { return tile_manager_.get(); }
198 Renderer* renderer() { return renderer_.get(); } 200 Renderer* renderer() { return renderer_.get(); }
199 const RendererCapabilities& GetRendererCapabilities() const; 201 const RendererCapabilities& GetRendererCapabilities() const;
200 202
201 virtual bool SwapBuffers(); 203 virtual bool SwapBuffers();
204 void EnableVSyncNotification(bool enable);
202 205
203 void Readback(void* pixels, gfx::Rect rect_in_device_viewport); 206 void Readback(void* pixels, gfx::Rect rect_in_device_viewport);
204 207
205 LayerTreeImpl* active_tree() { return active_tree_.get(); } 208 LayerTreeImpl* active_tree() { return active_tree_.get(); }
206 const LayerTreeImpl* active_tree() const { return active_tree_.get(); } 209 const LayerTreeImpl* active_tree() const { return active_tree_.get(); }
207 LayerTreeImpl* pending_tree() { return pending_tree_.get(); } 210 LayerTreeImpl* pending_tree() { return pending_tree_.get(); }
208 const LayerTreeImpl* pending_tree() const { return pending_tree_.get(); } 211 const LayerTreeImpl* pending_tree() const { return pending_tree_.get(); }
209 const LayerTreeImpl* recycle_tree() const { return recycle_tree_.get(); } 212 const LayerTreeImpl* recycle_tree() const { return recycle_tree_.get(); }
210 void CreatePendingTree(); 213 void CreatePendingTree();
211 void CheckForCompletedTileUploads(); 214 void CheckForCompletedTileUploads();
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 scoped_ptr<AnimationRegistrar> animation_registrar_; 462 scoped_ptr<AnimationRegistrar> animation_registrar_;
460 463
461 RenderingStatsInstrumentation* rendering_stats_instrumentation_; 464 RenderingStatsInstrumentation* rendering_stats_instrumentation_;
462 465
463 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); 466 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl);
464 }; 467 };
465 468
466 } // namespace cc 469 } // namespace cc
467 470
468 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ 471 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_
OLDNEW
« no previous file with comments | « cc/test/fake_output_surface.cc ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698