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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 virtual void DidLoseOutputSurfaceOnImplThread() = 0; | 91 virtual void DidLoseOutputSurfaceOnImplThread() = 0; |
92 virtual void CommitVSyncParameters(base::TimeTicks timebase, | 92 virtual void CommitVSyncParameters(base::TimeTicks timebase, |
93 base::TimeDelta interval) = 0; | 93 base::TimeDelta interval) = 0; |
94 virtual void SetEstimatedParentDrawTime(base::TimeDelta draw_time) = 0; | 94 virtual void SetEstimatedParentDrawTime(base::TimeDelta draw_time) = 0; |
95 virtual void SetMaxSwapsPendingOnImplThread(int max) = 0; | 95 virtual void SetMaxSwapsPendingOnImplThread(int max) = 0; |
96 virtual void DidSwapBuffersOnImplThread() = 0; | 96 virtual void DidSwapBuffersOnImplThread() = 0; |
97 virtual void DidSwapBuffersCompleteOnImplThread() = 0; | 97 virtual void DidSwapBuffersCompleteOnImplThread() = 0; |
98 virtual void OnCanDrawStateChanged(bool can_draw) = 0; | 98 virtual void OnCanDrawStateChanged(bool can_draw) = 0; |
99 virtual void NotifyReadyToActivate() = 0; | 99 virtual void NotifyReadyToActivate() = 0; |
100 virtual void NotifyReadyToDraw() = 0; | 100 virtual void NotifyReadyToDraw() = 0; |
| 101 virtual void SetRequiresHighResToDraw(bool required) = 0; |
101 // Please call these 3 functions through | 102 // Please call these 3 functions through |
102 // LayerTreeHostImpl's SetNeedsRedraw(), SetNeedsRedrawRect() and | 103 // LayerTreeHostImpl's SetNeedsRedraw(), SetNeedsRedrawRect() and |
103 // SetNeedsAnimate(). | 104 // SetNeedsAnimate(). |
104 virtual void SetNeedsRedrawOnImplThread() = 0; | 105 virtual void SetNeedsRedrawOnImplThread() = 0; |
105 virtual void SetNeedsRedrawRectOnImplThread(const gfx::Rect& damage_rect) = 0; | 106 virtual void SetNeedsRedrawRectOnImplThread(const gfx::Rect& damage_rect) = 0; |
106 virtual void SetNeedsAnimateOnImplThread() = 0; | 107 virtual void SetNeedsAnimateOnImplThread() = 0; |
107 virtual void SetNeedsCommitOnImplThread() = 0; | 108 virtual void SetNeedsCommitOnImplThread() = 0; |
108 virtual void SetNeedsPrepareTilesOnImplThread() = 0; | 109 virtual void SetNeedsPrepareTilesOnImplThread(bool for_commit) = 0; |
109 virtual void SetVideoNeedsBeginFrames(bool needs_begin_frames) = 0; | 110 virtual void SetVideoNeedsBeginFrames(bool needs_begin_frames) = 0; |
110 virtual void PostAnimationEventsToMainThreadOnImplThread( | 111 virtual void PostAnimationEventsToMainThreadOnImplThread( |
111 scoped_ptr<AnimationEventsVector> events) = 0; | 112 scoped_ptr<AnimationEventsVector> events) = 0; |
112 // Returns true if resources were deleted by this call. | 113 // Returns true if resources were deleted by this call. |
113 virtual bool ReduceContentsTextureMemoryOnImplThread( | 114 virtual bool ReduceContentsTextureMemoryOnImplThread( |
114 size_t limit_bytes, | 115 size_t limit_bytes, |
115 int priority_cutoff) = 0; | 116 int priority_cutoff) = 0; |
116 virtual bool IsInsideDraw() = 0; | 117 virtual bool IsInsideDraw() = 0; |
117 virtual void RenewTreePriority() = 0; | 118 virtual void RenewTreePriority() = 0; |
118 virtual void PostDelayedAnimationTaskOnImplThread(const base::Closure& task, | 119 virtual void PostDelayedAnimationTaskOnImplThread(const base::Closure& task, |
119 base::TimeDelta delay) = 0; | 120 base::TimeDelta delay) = 0; |
120 virtual void DidActivateSyncTree() = 0; | 121 virtual void DidActivateSyncTree() = 0; |
121 virtual void DidPrepareTiles() = 0; | |
122 | 122 |
123 // Called when page scale animation has completed on the impl thread. | 123 // Called when page scale animation has completed on the impl thread. |
124 virtual void DidCompletePageScaleAnimationOnImplThread() = 0; | 124 virtual void DidCompletePageScaleAnimationOnImplThread() = 0; |
125 | 125 |
126 // Called when output surface asks for a draw. | 126 // Called when output surface asks for a draw. |
127 virtual void OnDrawForOutputSurface() = 0; | 127 virtual void OnDrawForOutputSurface() = 0; |
128 | 128 |
129 protected: | 129 protected: |
130 virtual ~LayerTreeHostImplClient() {} | 130 virtual ~LayerTreeHostImplClient() {} |
131 }; | 131 }; |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 | 492 |
493 // When a SwapPromiseMonitor is created on the impl thread, it calls | 493 // When a SwapPromiseMonitor is created on the impl thread, it calls |
494 // InsertSwapPromiseMonitor() to register itself with LayerTreeHostImpl. | 494 // InsertSwapPromiseMonitor() to register itself with LayerTreeHostImpl. |
495 // When the monitor is destroyed, it calls RemoveSwapPromiseMonitor() | 495 // When the monitor is destroyed, it calls RemoveSwapPromiseMonitor() |
496 // to unregister itself. | 496 // to unregister itself. |
497 void InsertSwapPromiseMonitor(SwapPromiseMonitor* monitor); | 497 void InsertSwapPromiseMonitor(SwapPromiseMonitor* monitor); |
498 void RemoveSwapPromiseMonitor(SwapPromiseMonitor* monitor); | 498 void RemoveSwapPromiseMonitor(SwapPromiseMonitor* monitor); |
499 | 499 |
500 // TODO(weiliangc): Replace RequiresHighResToDraw with scheduler waits for | 500 // TODO(weiliangc): Replace RequiresHighResToDraw with scheduler waits for |
501 // ReadyToDraw. crbug.com/469175 | 501 // ReadyToDraw. crbug.com/469175 |
502 void SetRequiresHighResToDraw() { requires_high_res_to_draw_ = true; } | 502 void SetRequiresHighResToDraw(bool required) { |
503 void ResetRequiresHighResToDraw() { requires_high_res_to_draw_ = false; } | 503 requires_high_res_to_draw_ = required; |
| 504 client_->SetRequiresHighResToDraw(required); |
| 505 } |
504 bool RequiresHighResToDraw() const { return requires_high_res_to_draw_; } | 506 bool RequiresHighResToDraw() const { return requires_high_res_to_draw_; } |
505 | 507 |
506 // Only valid for synchronous (non-scheduled) single-threaded case. | 508 // Only valid for synchronous (non-scheduled) single-threaded case. |
507 void SynchronouslyInitializeAllTiles(); | 509 void SynchronouslyInitializeAllTiles(); |
508 | 510 |
509 virtual void CreateResourceAndTileTaskWorkerPool( | 511 virtual void CreateResourceAndTileTaskWorkerPool( |
510 scoped_ptr<TileTaskWorkerPool>* tile_task_worker_pool, | 512 scoped_ptr<TileTaskWorkerPool>* tile_task_worker_pool, |
511 scoped_ptr<ResourcePool>* resource_pool, | 513 scoped_ptr<ResourcePool>* resource_pool, |
512 scoped_ptr<ResourcePool>* staging_resource_pool); | 514 scoped_ptr<ResourcePool>* staging_resource_pool); |
513 | 515 |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 scoped_ptr<FrameTimingTracker> frame_timing_tracker_; | 762 scoped_ptr<FrameTimingTracker> frame_timing_tracker_; |
761 | 763 |
762 scoped_ptr<Viewport> viewport_; | 764 scoped_ptr<Viewport> viewport_; |
763 | 765 |
764 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 766 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
765 }; | 767 }; |
766 | 768 |
767 } // namespace cc | 769 } // namespace cc |
768 | 770 |
769 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 771 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
OLD | NEW |