| 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 <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 // LayerTreeHost->Proxy callback interface. | 89 // LayerTreeHost->Proxy callback interface. |
| 90 class LayerTreeHostImplClient { | 90 class LayerTreeHostImplClient { |
| 91 public: | 91 public: |
| 92 virtual void UpdateRendererCapabilitiesOnImplThread() = 0; | 92 virtual void UpdateRendererCapabilitiesOnImplThread() = 0; |
| 93 virtual void DidLoseOutputSurfaceOnImplThread() = 0; | 93 virtual void DidLoseOutputSurfaceOnImplThread() = 0; |
| 94 virtual void CommitVSyncParameters(base::TimeTicks timebase, | 94 virtual void CommitVSyncParameters(base::TimeTicks timebase, |
| 95 base::TimeDelta interval) = 0; | 95 base::TimeDelta interval) = 0; |
| 96 virtual void SetEstimatedParentDrawTime(base::TimeDelta draw_time) = 0; | 96 virtual void SetEstimatedParentDrawTime(base::TimeDelta draw_time) = 0; |
| 97 virtual void DidSwapBuffersOnImplThread() = 0; | 97 virtual void DidSwapBuffersOnImplThread() = 0; |
| 98 virtual void DidSwapBuffersCompleteOnImplThread() = 0; | 98 virtual void DidSwapBuffersCompleteOnImplThread() = 0; |
| 99 virtual void OnResourcelessSoftareDrawStateChanged( | |
| 100 bool resourceless_draw) = 0; | |
| 101 virtual void OnCanDrawStateChanged(bool can_draw) = 0; | 99 virtual void OnCanDrawStateChanged(bool can_draw) = 0; |
| 102 virtual void NotifyReadyToActivate() = 0; | 100 virtual void NotifyReadyToActivate() = 0; |
| 103 virtual void NotifyReadyToDraw() = 0; | 101 virtual void NotifyReadyToDraw() = 0; |
| 104 // Please call these 3 functions through | 102 // Please call these 3 functions through |
| 105 // LayerTreeHostImpl's SetNeedsRedraw(), SetNeedsRedrawRect() and | 103 // LayerTreeHostImpl's SetNeedsRedraw(), SetNeedsRedrawRect() and |
| 106 // SetNeedsOneBeginImplFrame(). | 104 // SetNeedsOneBeginImplFrame(). |
| 107 virtual void SetNeedsRedrawOnImplThread() = 0; | 105 virtual void SetNeedsRedrawOnImplThread() = 0; |
| 108 virtual void SetNeedsRedrawRectOnImplThread(const gfx::Rect& damage_rect) = 0; | 106 virtual void SetNeedsRedrawRectOnImplThread(const gfx::Rect& damage_rect) = 0; |
| 109 virtual void SetNeedsOneBeginImplFrameOnImplThread() = 0; | 107 virtual void SetNeedsOneBeginImplFrameOnImplThread() = 0; |
| 110 virtual void SetNeedsCommitOnImplThread() = 0; | 108 virtual void SetNeedsCommitOnImplThread() = 0; |
| 111 virtual void SetNeedsPrepareTilesOnImplThread() = 0; | 109 virtual void SetNeedsPrepareTilesOnImplThread() = 0; |
| 112 virtual void SetVideoNeedsBeginFrames(bool needs_begin_frames) = 0; | 110 virtual void SetVideoNeedsBeginFrames(bool needs_begin_frames) = 0; |
| 113 virtual void PostAnimationEventsToMainThreadOnImplThread( | 111 virtual void PostAnimationEventsToMainThreadOnImplThread( |
| 114 scoped_ptr<AnimationEventsVector> events) = 0; | 112 scoped_ptr<AnimationEventsVector> events) = 0; |
| 115 virtual bool IsInsideDraw() = 0; | 113 virtual bool IsInsideDraw() = 0; |
| 116 virtual void RenewTreePriority() = 0; | 114 virtual void RenewTreePriority() = 0; |
| 117 virtual void PostDelayedAnimationTaskOnImplThread(const base::Closure& task, | 115 virtual void PostDelayedAnimationTaskOnImplThread(const base::Closure& task, |
| 118 base::TimeDelta delay) = 0; | 116 base::TimeDelta delay) = 0; |
| 119 virtual void DidActivateSyncTree() = 0; | 117 virtual void DidActivateSyncTree() = 0; |
| 120 virtual void WillPrepareTiles() = 0; | 118 virtual void WillPrepareTiles() = 0; |
| 121 virtual void DidPrepareTiles() = 0; | 119 virtual void DidPrepareTiles() = 0; |
| 122 | 120 |
| 123 // Called when page scale animation has completed on the impl thread. | 121 // Called when page scale animation has completed on the impl thread. |
| 124 virtual void DidCompletePageScaleAnimationOnImplThread() = 0; | 122 virtual void DidCompletePageScaleAnimationOnImplThread() = 0; |
| 125 | 123 |
| 126 // Called when output surface asks for a draw. | 124 // Called when output surface asks for a draw. |
| 127 virtual void OnDrawForOutputSurface() = 0; | 125 virtual void OnDrawForOutputSurface(bool resourceless_software_draw) = 0; |
| 128 | 126 |
| 129 virtual void PostFrameTimingEventsOnImplThread( | 127 virtual void PostFrameTimingEventsOnImplThread( |
| 130 scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, | 128 scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, |
| 131 scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) = 0; | 129 scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) = 0; |
| 132 | 130 |
| 133 protected: | 131 protected: |
| 134 virtual ~LayerTreeHostImplClient() {} | 132 virtual ~LayerTreeHostImplClient() {} |
| 135 }; | 133 }; |
| 136 | 134 |
| 137 // LayerTreeHostImpl owns the LayerImpl trees as well as associated rendering | 135 // LayerTreeHostImpl owns the LayerImpl trees as well as associated rendering |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 ScrollbarSet ScrollbarsFor(int scroll_layer_id) const override; | 340 ScrollbarSet ScrollbarsFor(int scroll_layer_id) const override; |
| 343 | 341 |
| 344 // VideoBeginFrameSource implementation. | 342 // VideoBeginFrameSource implementation. |
| 345 void AddVideoFrameController(VideoFrameController* controller) override; | 343 void AddVideoFrameController(VideoFrameController* controller) override; |
| 346 void RemoveVideoFrameController(VideoFrameController* controller) override; | 344 void RemoveVideoFrameController(VideoFrameController* controller) override; |
| 347 | 345 |
| 348 // OutputSurfaceClient implementation. | 346 // OutputSurfaceClient implementation. |
| 349 void CommitVSyncParameters(base::TimeTicks timebase, | 347 void CommitVSyncParameters(base::TimeTicks timebase, |
| 350 base::TimeDelta interval) override; | 348 base::TimeDelta interval) override; |
| 351 void SetNeedsRedrawRect(const gfx::Rect& rect) override; | 349 void SetNeedsRedrawRect(const gfx::Rect& rect) override; |
| 352 void SetExternalDrawConstraints( | 350 void SetExternalTilePriorityConstraints( |
| 353 const gfx::Transform& transform, | 351 const gfx::Rect& viewport_rect, |
| 354 const gfx::Rect& viewport, | 352 const gfx::Transform& transform) override; |
| 355 const gfx::Rect& clip, | |
| 356 const gfx::Rect& viewport_rect_for_tile_priority, | |
| 357 const gfx::Transform& transform_for_tile_priority, | |
| 358 bool resourceless_software_draw) override; | |
| 359 void DidLoseOutputSurface() override; | 353 void DidLoseOutputSurface() override; |
| 360 void DidSwapBuffers() override; | 354 void DidSwapBuffers() override; |
| 361 void DidSwapBuffersComplete() override; | 355 void DidSwapBuffersComplete() override; |
| 362 void ReclaimResources(const CompositorFrameAck* ack) override; | 356 void ReclaimResources(const CompositorFrameAck* ack) override; |
| 363 void SetMemoryPolicy(const ManagedMemoryPolicy& policy) override; | 357 void SetMemoryPolicy(const ManagedMemoryPolicy& policy) override; |
| 364 void SetTreeActivationCallback(const base::Closure& callback) override; | 358 void SetTreeActivationCallback(const base::Closure& callback) override; |
| 365 void OnDraw() override; | 359 void OnDraw(const gfx::Transform& transform, |
| 360 const gfx::Rect& viewport, |
| 361 const gfx::Rect& clip, |
| 362 bool resourceless_software_draw) override; |
| 366 | 363 |
| 367 // Called from LayerTreeImpl. | 364 // Called from LayerTreeImpl. |
| 368 void OnCanDrawStateChangedForTree(); | 365 void OnCanDrawStateChangedForTree(); |
| 369 | 366 |
| 370 // Implementation. | 367 // Implementation. |
| 371 int id() const { return id_; } | 368 int id() const { return id_; } |
| 372 bool CanDraw() const; | 369 bool CanDraw() const; |
| 373 OutputSurface* output_surface() const { return output_surface_; } | 370 OutputSurface* output_surface() const { return output_surface_; } |
| 374 void ReleaseOutputSurface(); | 371 void ReleaseOutputSurface(); |
| 375 | 372 |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 830 scoped_ptr<FrameTimingTracker> frame_timing_tracker_; | 827 scoped_ptr<FrameTimingTracker> frame_timing_tracker_; |
| 831 | 828 |
| 832 scoped_ptr<Viewport> viewport_; | 829 scoped_ptr<Viewport> viewport_; |
| 833 | 830 |
| 834 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 831 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
| 835 }; | 832 }; |
| 836 | 833 |
| 837 } // namespace cc | 834 } // namespace cc |
| 838 | 835 |
| 839 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 836 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
| OLD | NEW |