| 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 BeginImplFrame(const BeginFrameArgs& args) OVERRIDE; | 78 virtual void BeginImplFrame(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 SetNeedsBeginImplFrame(bool enable) OVERRIDE; | 105 virtual void SetNeedsBeginImplFrame(bool enable) OVERRIDE; |
| 104 virtual void ScheduledActionSendBeginMainFrame() OVERRIDE; | 106 virtual void ScheduledActionSendBeginMainFrame() OVERRIDE; |
| 105 virtual DrawSwapReadbackResult ScheduledActionDrawAndSwapIfPossible() | 107 virtual DrawSwapReadbackResult ScheduledActionDrawAndSwapIfPossible() |
| 106 OVERRIDE; | 108 OVERRIDE; |
| 107 virtual DrawSwapReadbackResult ScheduledActionDrawAndSwapForced() OVERRIDE; | 109 virtual DrawSwapReadbackResult ScheduledActionDrawAndSwapForced() OVERRIDE; |
| 108 virtual DrawSwapReadbackResult ScheduledActionDrawAndReadback() OVERRIDE; | 110 virtual DrawSwapReadbackResult ScheduledActionDrawAndReadback() OVERRIDE; |
| 111 virtual void ScheduledActionAnimate() OVERRIDE; |
| 109 virtual void ScheduledActionCommit() OVERRIDE; | 112 virtual void ScheduledActionCommit() OVERRIDE; |
| 110 virtual void ScheduledActionUpdateVisibleTiles() OVERRIDE; | 113 virtual void ScheduledActionUpdateVisibleTiles() OVERRIDE; |
| 111 virtual void ScheduledActionActivatePendingTree() OVERRIDE; | 114 virtual void ScheduledActionActivatePendingTree() OVERRIDE; |
| 112 virtual void ScheduledActionBeginOutputSurfaceCreation() OVERRIDE; | 115 virtual void ScheduledActionBeginOutputSurfaceCreation() OVERRIDE; |
| 113 virtual void ScheduledActionAcquireLayerTexturesForMainThread() OVERRIDE; | 116 virtual void ScheduledActionAcquireLayerTexturesForMainThread() 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; |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 // Set when the next draw should post DidCommitAndDrawFrame to the main | 288 // Set when the next draw should post DidCommitAndDrawFrame to the main |
| 286 // thread. | 289 // thread. |
| 287 bool next_frame_is_newly_committed_frame; | 290 bool next_frame_is_newly_committed_frame; |
| 288 | 291 |
| 289 bool inside_draw; | 292 bool inside_draw; |
| 290 | 293 |
| 291 bool input_throttled_until_commit; | 294 bool input_throttled_until_commit; |
| 292 | 295 |
| 293 // Set when we freeze animations to avoid checkerboarding. | 296 // Set when we freeze animations to avoid checkerboarding. |
| 294 bool animations_frozen_until_next_draw; | 297 bool animations_frozen_until_next_draw; |
| 295 base::TimeTicks animation_freeze_time; | 298 base::TimeTicks animation_time; |
| 296 | 299 |
| 297 base::TimeTicks smoothness_takes_priority_expiration_time; | 300 base::TimeTicks smoothness_takes_priority_expiration_time; |
| 298 bool renew_tree_priority_pending; | 301 bool renew_tree_priority_pending; |
| 299 | 302 |
| 300 ProxyTimingHistory timing_history; | 303 ProxyTimingHistory timing_history; |
| 301 | 304 |
| 302 scoped_ptr<LayerTreeHostImpl> layer_tree_host_impl; | 305 scoped_ptr<LayerTreeHostImpl> layer_tree_host_impl; |
| 303 base::WeakPtrFactory<ThreadProxy> weak_factory; | 306 base::WeakPtrFactory<ThreadProxy> weak_factory; |
| 304 }; | 307 }; |
| 305 // Use accessors instead of this variable directly. | 308 // Use accessors instead of this variable directly. |
| 306 CompositorThreadOnly compositor_thread_vars_unsafe_; | 309 CompositorThreadOnly compositor_thread_vars_unsafe_; |
| 307 CompositorThreadOnly& impl(); | 310 CompositorThreadOnly& impl(); |
| 308 const CompositorThreadOnly& impl() const; | 311 const CompositorThreadOnly& impl() const; |
| 309 | 312 |
| 310 base::WeakPtr<ThreadProxy> main_thread_weak_ptr_; | 313 base::WeakPtr<ThreadProxy> main_thread_weak_ptr_; |
| 311 base::WeakPtr<ThreadProxy> impl_thread_weak_ptr_; | 314 base::WeakPtr<ThreadProxy> impl_thread_weak_ptr_; |
| 312 | 315 |
| 313 DISALLOW_COPY_AND_ASSIGN(ThreadProxy); | 316 DISALLOW_COPY_AND_ASSIGN(ThreadProxy); |
| 314 }; | 317 }; |
| 315 | 318 |
| 316 } // namespace cc | 319 } // namespace cc |
| 317 | 320 |
| 318 #endif // CC_TREES_THREAD_PROXY_H_ | 321 #endif // CC_TREES_THREAD_PROXY_H_ |
| OLD | NEW |