| 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_THREAD_PROXY_H_ | 5 #ifndef CC_TREES_THREAD_PROXY_H_ |
| 6 #define CC_TREES_THREAD_PROXY_H_ | 6 #define CC_TREES_THREAD_PROXY_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 virtual scoped_ptr<base::Value> SchedulerStateAsValueForTesting() OVERRIDE; | 71 virtual scoped_ptr<base::Value> SchedulerStateAsValueForTesting() OVERRIDE; |
| 72 | 72 |
| 73 // LayerTreeHostImplClient implementation | 73 // LayerTreeHostImplClient implementation |
| 74 virtual void UpdateRendererCapabilitiesOnImplThread() OVERRIDE; | 74 virtual void UpdateRendererCapabilitiesOnImplThread() OVERRIDE; |
| 75 virtual void DidLoseOutputSurfaceOnImplThread() OVERRIDE; | 75 virtual void DidLoseOutputSurfaceOnImplThread() OVERRIDE; |
| 76 virtual void DidSwapBuffersOnImplThread() OVERRIDE {} | 76 virtual void DidSwapBuffersOnImplThread() OVERRIDE {} |
| 77 virtual void OnSwapBuffersCompleteOnImplThread() OVERRIDE; | 77 virtual void OnSwapBuffersCompleteOnImplThread() OVERRIDE; |
| 78 virtual void BeginFrame(const BeginFrameArgs& args) OVERRIDE; | 78 virtual void BeginFrame(const BeginFrameArgs& args) OVERRIDE; |
| 79 virtual void OnCanDrawStateChanged(bool can_draw) OVERRIDE; | 79 virtual void OnCanDrawStateChanged(bool can_draw) OVERRIDE; |
| 80 virtual void NotifyReadyToActivate() OVERRIDE; | 80 virtual void NotifyReadyToActivate() OVERRIDE; |
| 81 // Please call these 2 functions through | 81 // Please call these 3 functions through |
| 82 // LayerTreeHostImpl's SetNeedsRedraw() and SetNeedsRedrawRect(). | 82 // LayerTreeHostImpl's SetNeedsRedraw(), SetNeedsRedrawRect() and |
| 83 // SetNeedsAnimate(). |
| 83 virtual void SetNeedsRedrawOnImplThread() OVERRIDE; | 84 virtual void SetNeedsRedrawOnImplThread() OVERRIDE; |
| 84 virtual void SetNeedsRedrawRectOnImplThread(const gfx::Rect& dirty_rect) | 85 virtual void SetNeedsRedrawRectOnImplThread(const gfx::Rect& dirty_rect) |
| 85 OVERRIDE; | 86 OVERRIDE; |
| 87 virtual void SetNeedsAnimateOnImplThread() OVERRIDE; |
| 86 virtual void SetNeedsManageTilesOnImplThread() OVERRIDE; | 88 virtual void SetNeedsManageTilesOnImplThread() OVERRIDE; |
| 87 virtual void DidInitializeVisibleTileOnImplThread() OVERRIDE; | 89 virtual void DidInitializeVisibleTileOnImplThread() OVERRIDE; |
| 88 virtual void SetNeedsCommitOnImplThread() OVERRIDE; | 90 virtual void SetNeedsCommitOnImplThread() OVERRIDE; |
| 89 virtual void PostAnimationEventsToMainThreadOnImplThread( | 91 virtual void PostAnimationEventsToMainThreadOnImplThread( |
| 90 scoped_ptr<AnimationEventsVector> queue) OVERRIDE; | 92 scoped_ptr<AnimationEventsVector> queue) OVERRIDE; |
| 91 virtual bool ReduceContentsTextureMemoryOnImplThread(size_t limit_bytes, | 93 virtual bool ReduceContentsTextureMemoryOnImplThread(size_t limit_bytes, |
| 92 int priority_cutoff) | 94 int priority_cutoff) |
| 93 OVERRIDE; | 95 OVERRIDE; |
| 94 virtual void SendManagedMemoryStats() OVERRIDE; | 96 virtual void SendManagedMemoryStats() OVERRIDE; |
| 95 virtual bool IsInsideDraw() OVERRIDE; | 97 virtual bool IsInsideDraw() OVERRIDE; |
| 96 virtual void RenewTreePriority() OVERRIDE; | 98 virtual void RenewTreePriority() OVERRIDE; |
| 97 virtual void RequestScrollbarAnimationOnImplThread(base::TimeDelta delay) | 99 virtual void RequestScrollbarAnimationOnImplThread(base::TimeDelta delay) |
| 98 OVERRIDE; | 100 OVERRIDE; |
| 99 virtual void DidActivatePendingTree() OVERRIDE; | 101 virtual void DidActivatePendingTree() OVERRIDE; |
| 100 virtual void DidManageTiles() OVERRIDE; | 102 virtual void DidManageTiles() OVERRIDE; |
| 101 | 103 |
| 102 // SchedulerClient implementation | 104 // SchedulerClient implementation |
| 103 virtual void SetNeedsBeginFrame(bool enable) OVERRIDE; | 105 virtual void SetNeedsBeginFrame(bool enable) OVERRIDE; |
| 104 virtual void WillBeginImplFrame(const BeginFrameArgs& args) OVERRIDE; | 106 virtual void WillBeginImplFrame(const BeginFrameArgs& args) OVERRIDE; |
| 105 virtual void ScheduledActionSendBeginMainFrame() OVERRIDE; | 107 virtual void ScheduledActionSendBeginMainFrame() OVERRIDE; |
| 106 virtual DrawSwapReadbackResult ScheduledActionDrawAndSwapIfPossible() | 108 virtual DrawSwapReadbackResult ScheduledActionDrawAndSwapIfPossible() |
| 107 OVERRIDE; | 109 OVERRIDE; |
| 108 virtual DrawSwapReadbackResult ScheduledActionDrawAndSwapForced() OVERRIDE; | 110 virtual DrawSwapReadbackResult ScheduledActionDrawAndSwapForced() OVERRIDE; |
| 109 virtual DrawSwapReadbackResult ScheduledActionDrawAndReadback() OVERRIDE; | 111 virtual DrawSwapReadbackResult ScheduledActionDrawAndReadback() OVERRIDE; |
| 112 virtual void ScheduledActionAnimate() OVERRIDE; |
| 110 virtual void ScheduledActionCommit() OVERRIDE; | 113 virtual void ScheduledActionCommit() OVERRIDE; |
| 111 virtual void ScheduledActionUpdateVisibleTiles() OVERRIDE; | 114 virtual void ScheduledActionUpdateVisibleTiles() OVERRIDE; |
| 112 virtual void ScheduledActionActivatePendingTree() OVERRIDE; | 115 virtual void ScheduledActionActivatePendingTree() OVERRIDE; |
| 113 virtual void ScheduledActionBeginOutputSurfaceCreation() OVERRIDE; | 116 virtual void ScheduledActionBeginOutputSurfaceCreation() OVERRIDE; |
| 114 virtual void ScheduledActionManageTiles() OVERRIDE; | 117 virtual void ScheduledActionManageTiles() OVERRIDE; |
| 115 virtual void DidAnticipatedDrawTimeChange(base::TimeTicks time) OVERRIDE; | 118 virtual void DidAnticipatedDrawTimeChange(base::TimeTicks time) OVERRIDE; |
| 116 virtual base::TimeDelta DrawDurationEstimate() OVERRIDE; | 119 virtual base::TimeDelta DrawDurationEstimate() OVERRIDE; |
| 117 virtual base::TimeDelta BeginMainFrameToCommitDurationEstimate() OVERRIDE; | 120 virtual base::TimeDelta BeginMainFrameToCommitDurationEstimate() OVERRIDE; |
| 118 virtual base::TimeDelta CommitToActivateDurationEstimate() OVERRIDE; | 121 virtual base::TimeDelta CommitToActivateDurationEstimate() OVERRIDE; |
| 119 virtual void DidBeginImplFrameDeadline() OVERRIDE; | 122 virtual void DidBeginImplFrameDeadline() OVERRIDE; |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 // Set when the next draw should post DidCommitAndDrawFrame to the main | 284 // Set when the next draw should post DidCommitAndDrawFrame to the main |
| 282 // thread. | 285 // thread. |
| 283 bool next_frame_is_newly_committed_frame; | 286 bool next_frame_is_newly_committed_frame; |
| 284 | 287 |
| 285 bool inside_draw; | 288 bool inside_draw; |
| 286 | 289 |
| 287 bool input_throttled_until_commit; | 290 bool input_throttled_until_commit; |
| 288 | 291 |
| 289 // Set when we freeze animations to avoid checkerboarding. | 292 // Set when we freeze animations to avoid checkerboarding. |
| 290 bool animations_frozen_until_next_draw; | 293 bool animations_frozen_until_next_draw; |
| 291 base::TimeTicks animation_freeze_time; | 294 base::TimeTicks animation_time; |
| 292 | 295 |
| 293 base::TimeTicks smoothness_takes_priority_expiration_time; | 296 base::TimeTicks smoothness_takes_priority_expiration_time; |
| 294 bool renew_tree_priority_pending; | 297 bool renew_tree_priority_pending; |
| 295 | 298 |
| 296 ProxyTimingHistory timing_history; | 299 ProxyTimingHistory timing_history; |
| 297 | 300 |
| 298 scoped_ptr<LayerTreeHostImpl> layer_tree_host_impl; | 301 scoped_ptr<LayerTreeHostImpl> layer_tree_host_impl; |
| 299 base::WeakPtrFactory<ThreadProxy> weak_factory; | 302 base::WeakPtrFactory<ThreadProxy> weak_factory; |
| 300 }; | 303 }; |
| 301 // Use accessors instead of this variable directly. | 304 // Use accessors instead of this variable directly. |
| 302 CompositorThreadOnly compositor_thread_vars_unsafe_; | 305 CompositorThreadOnly compositor_thread_vars_unsafe_; |
| 303 CompositorThreadOnly& impl(); | 306 CompositorThreadOnly& impl(); |
| 304 const CompositorThreadOnly& impl() const; | 307 const CompositorThreadOnly& impl() const; |
| 305 | 308 |
| 306 base::WeakPtr<ThreadProxy> main_thread_weak_ptr_; | 309 base::WeakPtr<ThreadProxy> main_thread_weak_ptr_; |
| 307 base::WeakPtr<ThreadProxy> impl_thread_weak_ptr_; | 310 base::WeakPtr<ThreadProxy> impl_thread_weak_ptr_; |
| 308 | 311 |
| 309 DISALLOW_COPY_AND_ASSIGN(ThreadProxy); | 312 DISALLOW_COPY_AND_ASSIGN(ThreadProxy); |
| 310 }; | 313 }; |
| 311 | 314 |
| 312 } // namespace cc | 315 } // namespace cc |
| 313 | 316 |
| 314 #endif // CC_TREES_THREAD_PROXY_H_ | 317 #endif // CC_TREES_THREAD_PROXY_H_ |
| OLD | NEW |