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