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 class LayerTreeHostImplClient { | 89 class LayerTreeHostImplClient { |
90 public: | 90 public: |
91 virtual void UpdateRendererCapabilitiesOnImplThread() = 0; | 91 virtual void UpdateRendererCapabilitiesOnImplThread() = 0; |
92 virtual void DidLoseOutputSurfaceOnImplThread() = 0; | 92 virtual void DidLoseOutputSurfaceOnImplThread() = 0; |
93 virtual void CommitVSyncParameters(base::TimeTicks timebase, | 93 virtual void CommitVSyncParameters(base::TimeTicks timebase, |
94 base::TimeDelta interval) = 0; | 94 base::TimeDelta interval) = 0; |
95 virtual void SetEstimatedParentDrawTime(base::TimeDelta draw_time) = 0; | 95 virtual void SetEstimatedParentDrawTime(base::TimeDelta draw_time) = 0; |
96 virtual void SetMaxSwapsPendingOnImplThread(int max) = 0; | 96 virtual void SetMaxSwapsPendingOnImplThread(int max) = 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( | |
danakj
2015/11/24 21:17:31
Softare :D
| |
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 // SetNeedsAnimate(). | 104 // SetNeedsAnimate(). |
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 SetNeedsAnimateOnImplThread() = 0; | 107 virtual void SetNeedsAnimateOnImplThread() = 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
293 | 291 |
294 // When blocking, this prevents client_->NotifyReadyToActivate() from being | 292 // When blocking, this prevents client_->NotifyReadyToActivate() from being |
295 // called. When disabled, it calls client_->NotifyReadyToActivate() | 293 // called. When disabled, it calls client_->NotifyReadyToActivate() |
296 // immediately if any notifications had been blocked while blocking. | 294 // immediately if any notifications had been blocked while blocking. |
297 virtual void BlockNotifyReadyToActivateForTesting(bool block); | 295 virtual void BlockNotifyReadyToActivateForTesting(bool block); |
298 | 296 |
299 // Resets all of the trees to an empty state. | 297 // Resets all of the trees to an empty state. |
300 void ResetTreesForTesting(); | 298 void ResetTreesForTesting(); |
301 | 299 |
302 size_t SourceAnimationFrameNumberForTesting() const; | 300 size_t SourceAnimationFrameNumberForTesting() const; |
301 void SetExternalViewporForTesting(const gfx::Rect& external_viewport); | |
danakj
2015/11/24 21:17:31
"Viewport"
boliu
2015/11/24 23:27:38
Done.
| |
302 void SetResourcelessSoftwareDrawForTesting(bool resourceless_software_draw); | |
303 | 303 |
304 void RegisterScrollbarAnimationController(int scroll_layer_id); | 304 void RegisterScrollbarAnimationController(int scroll_layer_id); |
305 void UnregisterScrollbarAnimationController(int scroll_layer_id); | 305 void UnregisterScrollbarAnimationController(int scroll_layer_id); |
306 ScrollbarAnimationController* ScrollbarAnimationControllerForId( | 306 ScrollbarAnimationController* ScrollbarAnimationControllerForId( |
307 int scroll_layer_id) const; | 307 int scroll_layer_id) const; |
308 | 308 |
309 DrawMode GetDrawMode() const; | 309 DrawMode GetDrawMode() const; |
310 | 310 |
311 // Viewport size in draw space: this size is in physical pixels and is used | 311 // Viewport size in draw space: this size is in physical pixels and is used |
312 // for draw properties, tilings, quads and render passes. | 312 // for draw properties, tilings, quads and render passes. |
(...skipping 25 matching lines...) Expand all Loading... | |
338 ScrollbarSet ScrollbarsFor(int scroll_layer_id) const override; | 338 ScrollbarSet ScrollbarsFor(int scroll_layer_id) const override; |
339 | 339 |
340 // VideoBeginFrameSource implementation. | 340 // VideoBeginFrameSource implementation. |
341 void AddVideoFrameController(VideoFrameController* controller) override; | 341 void AddVideoFrameController(VideoFrameController* controller) override; |
342 void RemoveVideoFrameController(VideoFrameController* controller) override; | 342 void RemoveVideoFrameController(VideoFrameController* controller) override; |
343 | 343 |
344 // OutputSurfaceClient implementation. | 344 // OutputSurfaceClient implementation. |
345 void CommitVSyncParameters(base::TimeTicks timebase, | 345 void CommitVSyncParameters(base::TimeTicks timebase, |
346 base::TimeDelta interval) override; | 346 base::TimeDelta interval) override; |
347 void SetNeedsRedrawRect(const gfx::Rect& rect) override; | 347 void SetNeedsRedrawRect(const gfx::Rect& rect) override; |
348 void SetExternalDrawConstraints( | 348 void SetExternalDrawConstraints( |
danakj
2015/11/24 21:17:31
Now more like SetExternalTilePriority...Constraint
boliu
2015/11/24 23:27:38
Done
Also dropped the _for_tile_priority part fro
| |
349 const gfx::Transform& transform, | |
350 const gfx::Rect& viewport, | |
351 const gfx::Rect& clip, | |
352 const gfx::Rect& viewport_rect_for_tile_priority, | 349 const gfx::Rect& viewport_rect_for_tile_priority, |
353 const gfx::Transform& transform_for_tile_priority, | 350 const gfx::Transform& transform_for_tile_priority) override; |
354 bool resourceless_software_draw) override; | |
355 void DidLoseOutputSurface() override; | 351 void DidLoseOutputSurface() override; |
356 void DidSwapBuffers() override; | 352 void DidSwapBuffers() override; |
357 void DidSwapBuffersComplete() override; | 353 void DidSwapBuffersComplete() override; |
358 void ReclaimResources(const CompositorFrameAck* ack) override; | 354 void ReclaimResources(const CompositorFrameAck* ack) override; |
359 void SetMemoryPolicy(const ManagedMemoryPolicy& policy) override; | 355 void SetMemoryPolicy(const ManagedMemoryPolicy& policy) override; |
360 void SetTreeActivationCallback(const base::Closure& callback) override; | 356 void SetTreeActivationCallback(const base::Closure& callback) override; |
361 void OnDraw() override; | 357 void OnDraw(const gfx::Transform& transform, |
358 const gfx::Rect& viewport, | |
359 const gfx::Rect& clip, | |
360 bool resourceless_software_draw) override; | |
362 | 361 |
363 // Called from LayerTreeImpl. | 362 // Called from LayerTreeImpl. |
364 void OnCanDrawStateChangedForTree(); | 363 void OnCanDrawStateChangedForTree(); |
365 | 364 |
366 // Implementation. | 365 // Implementation. |
367 int id() const { return id_; } | 366 int id() const { return id_; } |
368 bool CanDraw() const; | 367 bool CanDraw() const; |
369 OutputSurface* output_surface() const { return output_surface_; } | 368 OutputSurface* output_surface() const { return output_surface_; } |
370 void ReleaseOutputSurface(); | 369 void ReleaseOutputSurface(); |
371 | 370 |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
823 scoped_ptr<FrameTimingTracker> frame_timing_tracker_; | 822 scoped_ptr<FrameTimingTracker> frame_timing_tracker_; |
824 | 823 |
825 scoped_ptr<Viewport> viewport_; | 824 scoped_ptr<Viewport> viewport_; |
826 | 825 |
827 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 826 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
828 }; | 827 }; |
829 | 828 |
830 } // namespace cc | 829 } // namespace cc |
831 | 830 |
832 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 831 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
OLD | NEW |