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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 | 495 |
496 // When a SwapPromiseMonitor is created on the impl thread, it calls | 496 // When a SwapPromiseMonitor is created on the impl thread, it calls |
497 // InsertSwapPromiseMonitor() to register itself with LayerTreeHostImpl. | 497 // InsertSwapPromiseMonitor() to register itself with LayerTreeHostImpl. |
498 // When the monitor is destroyed, it calls RemoveSwapPromiseMonitor() | 498 // When the monitor is destroyed, it calls RemoveSwapPromiseMonitor() |
499 // to unregister itself. | 499 // to unregister itself. |
500 void InsertSwapPromiseMonitor(SwapPromiseMonitor* monitor); | 500 void InsertSwapPromiseMonitor(SwapPromiseMonitor* monitor); |
501 void RemoveSwapPromiseMonitor(SwapPromiseMonitor* monitor); | 501 void RemoveSwapPromiseMonitor(SwapPromiseMonitor* monitor); |
502 | 502 |
503 // TODO(weiliangc): Replace RequiresHighResToDraw with scheduler waits for | 503 // TODO(weiliangc): Replace RequiresHighResToDraw with scheduler waits for |
504 // ReadyToDraw. crbug.com/469175 | 504 // ReadyToDraw. crbug.com/469175 |
505 void SetRequiresHighResToDraw() { requires_high_res_to_draw_ = true; } | 505 void SetRequiresHighResToDraw(bool required) { |
506 void ResetRequiresHighResToDraw() { requires_high_res_to_draw_ = false; } | 506 requires_high_res_to_draw_ = required; |
| 507 client_->SetRequiresHighResToDraw(required); |
| 508 } |
507 bool RequiresHighResToDraw() const { return requires_high_res_to_draw_; } | 509 bool RequiresHighResToDraw() const { return requires_high_res_to_draw_; } |
508 | 510 |
509 // Only valid for synchronous (non-scheduled) single-threaded case. | 511 // Only valid for synchronous (non-scheduled) single-threaded case. |
510 void SynchronouslyInitializeAllTiles(); | 512 void SynchronouslyInitializeAllTiles(); |
511 | 513 |
512 virtual void CreateResourceAndTileTaskWorkerPool( | 514 virtual void CreateResourceAndTileTaskWorkerPool( |
513 scoped_ptr<TileTaskWorkerPool>* tile_task_worker_pool, | 515 scoped_ptr<TileTaskWorkerPool>* tile_task_worker_pool, |
514 scoped_ptr<ResourcePool>* resource_pool, | 516 scoped_ptr<ResourcePool>* resource_pool, |
515 scoped_ptr<ResourcePool>* staging_resource_pool); | 517 scoped_ptr<ResourcePool>* staging_resource_pool); |
516 | 518 |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
766 scoped_ptr<FrameTimingTracker> frame_timing_tracker_; | 768 scoped_ptr<FrameTimingTracker> frame_timing_tracker_; |
767 | 769 |
768 scoped_ptr<Viewport> viewport_; | 770 scoped_ptr<Viewport> viewport_; |
769 | 771 |
770 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 772 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
771 }; | 773 }; |
772 | 774 |
773 } // namespace cc | 775 } // namespace cc |
774 | 776 |
775 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 777 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
OLD | NEW |