| 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" |
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 13 #include "cc/animation/animation_events.h" | 13 #include "cc/animation/animation_events.h" |
| 14 #include "cc/base/completion_event.h" | 14 #include "cc/base/completion_event.h" |
| 15 #include "cc/base/delayed_unique_notifier.h" | 15 #include "cc/base/delayed_unique_notifier.h" |
| 16 #include "cc/resources/resource_update_controller.h" | 16 #include "cc/resources/resource_update_controller.h" |
| 17 #include "cc/scheduler/commit_earlyout_reason.h" | 17 #include "cc/scheduler/commit_earlyout_reason.h" |
| 18 #include "cc/scheduler/scheduler.h" | 18 #include "cc/scheduler/scheduler.h" |
| 19 #include "cc/trees/layer_tree_host_impl.h" | 19 #include "cc/trees/layer_tree_host_impl.h" |
| 20 #include "cc/trees/proxy.h" | 20 #include "cc/trees/proxy.h" |
| 21 #include "cc/trees/proxy_timing_history.h" | |
| 22 | 21 |
| 23 namespace base { | 22 namespace base { |
| 24 class SingleThreadTaskRunner; | 23 class SingleThreadTaskRunner; |
| 25 } | 24 } |
| 26 | 25 |
| 27 namespace cc { | 26 namespace cc { |
| 28 | 27 |
| 29 class BeginFrameSource; | 28 class BeginFrameSource; |
| 30 class ContextProvider; | 29 class ContextProvider; |
| 31 class InputHandlerClient; | 30 class InputHandlerClient; |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 bool input_throttled_until_commit; | 131 bool input_throttled_until_commit; |
| 133 | 132 |
| 134 base::TimeTicks animation_time; | 133 base::TimeTicks animation_time; |
| 135 | 134 |
| 136 // Whether a commit has been completed since the last time animations were | 135 // Whether a commit has been completed since the last time animations were |
| 137 // ticked. If this happens, we need to animate again. | 136 // ticked. If this happens, we need to animate again. |
| 138 bool did_commit_after_animating; | 137 bool did_commit_after_animating; |
| 139 | 138 |
| 140 DelayedUniqueNotifier smoothness_priority_expiration_notifier; | 139 DelayedUniqueNotifier smoothness_priority_expiration_notifier; |
| 141 | 140 |
| 142 ProxyTimingHistory timing_history; | 141 scoped_ptr<BeginFrameSource> external_begin_frame_source; |
| 143 | 142 |
| 144 scoped_ptr<BeginFrameSource> external_begin_frame_source; | 143 RenderingStatsInstrumentation* rendering_stats_instrumentation; |
| 145 | 144 |
| 146 // Values used to keep track of frame durations. Used only in frame timing. | 145 // Values used to keep track of frame durations. Used only in frame timing. |
| 147 BeginFrameArgs last_begin_main_frame_args; | 146 BeginFrameArgs last_begin_main_frame_args; |
| 148 BeginFrameArgs last_processed_begin_main_frame_args; | 147 BeginFrameArgs last_processed_begin_main_frame_args; |
| 149 | 148 |
| 150 scoped_ptr<LayerTreeHostImpl> layer_tree_host_impl; | 149 scoped_ptr<LayerTreeHostImpl> layer_tree_host_impl; |
| 151 base::WeakPtrFactory<ThreadProxy> weak_factory; | 150 base::WeakPtrFactory<ThreadProxy> weak_factory; |
| 152 }; | 151 }; |
| 153 | 152 |
| 154 const MainThreadOnly& main() const; | 153 const MainThreadOnly& main() const; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 void SetVideoNeedsBeginFrames(bool needs_begin_frames) override; | 206 void SetVideoNeedsBeginFrames(bool needs_begin_frames) override; |
| 208 void PostAnimationEventsToMainThreadOnImplThread( | 207 void PostAnimationEventsToMainThreadOnImplThread( |
| 209 scoped_ptr<AnimationEventsVector> queue) override; | 208 scoped_ptr<AnimationEventsVector> queue) override; |
| 210 bool ReduceContentsTextureMemoryOnImplThread(size_t limit_bytes, | 209 bool ReduceContentsTextureMemoryOnImplThread(size_t limit_bytes, |
| 211 int priority_cutoff) override; | 210 int priority_cutoff) override; |
| 212 bool IsInsideDraw() override; | 211 bool IsInsideDraw() override; |
| 213 void RenewTreePriority() override; | 212 void RenewTreePriority() override; |
| 214 void PostDelayedAnimationTaskOnImplThread(const base::Closure& task, | 213 void PostDelayedAnimationTaskOnImplThread(const base::Closure& task, |
| 215 base::TimeDelta delay) override; | 214 base::TimeDelta delay) override; |
| 216 void DidActivateSyncTree() override; | 215 void DidActivateSyncTree() override; |
| 216 void WillPrepareTiles() override; |
| 217 void DidPrepareTiles() override; | 217 void DidPrepareTiles() override; |
| 218 void DidCompletePageScaleAnimationOnImplThread() override; | 218 void DidCompletePageScaleAnimationOnImplThread() override; |
| 219 void OnDrawForOutputSurface() override; | 219 void OnDrawForOutputSurface() override; |
| 220 // This should only be called by LayerTreeHostImpl::PostFrameTimingEvents. | 220 // This should only be called by LayerTreeHostImpl::PostFrameTimingEvents. |
| 221 void PostFrameTimingEventsOnImplThread( | 221 void PostFrameTimingEventsOnImplThread( |
| 222 scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, | 222 scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, |
| 223 scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) | 223 scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) |
| 224 override; | 224 override; |
| 225 | 225 |
| 226 // SchedulerClient implementation | 226 // SchedulerClient implementation |
| 227 void WillBeginImplFrame(const BeginFrameArgs& args) override; | 227 void WillBeginImplFrame(const BeginFrameArgs& args) override; |
| 228 void DidFinishImplFrame() override; | 228 void DidFinishImplFrame() override; |
| 229 void ScheduledActionSendBeginMainFrame() override; | 229 void ScheduledActionSendBeginMainFrame() override; |
| 230 DrawResult ScheduledActionDrawAndSwapIfPossible() override; | 230 DrawResult ScheduledActionDrawAndSwapIfPossible() override; |
| 231 DrawResult ScheduledActionDrawAndSwapForced() override; | 231 DrawResult ScheduledActionDrawAndSwapForced() override; |
| 232 void ScheduledActionAnimate() override; | 232 void ScheduledActionAnimate() override; |
| 233 void ScheduledActionCommit() override; | 233 void ScheduledActionCommit() override; |
| 234 void ScheduledActionActivateSyncTree() override; | 234 void ScheduledActionActivateSyncTree() override; |
| 235 void ScheduledActionBeginOutputSurfaceCreation() override; | 235 void ScheduledActionBeginOutputSurfaceCreation() override; |
| 236 void ScheduledActionPrepareTiles() override; | 236 void ScheduledActionPrepareTiles() override; |
| 237 void ScheduledActionInvalidateOutputSurface() override; | 237 void ScheduledActionInvalidateOutputSurface() override; |
| 238 void DidAnticipatedDrawTimeChange(base::TimeTicks time) override; | 238 void DidAnticipatedDrawTimeChange(base::TimeTicks time) override; |
| 239 base::TimeDelta DrawDurationEstimate() override; | |
| 240 base::TimeDelta BeginMainFrameToCommitDurationEstimate() override; | |
| 241 base::TimeDelta CommitToActivateDurationEstimate() override; | |
| 242 void SendBeginFramesToChildren(const BeginFrameArgs& args) override; | 239 void SendBeginFramesToChildren(const BeginFrameArgs& args) override; |
| 243 void SendBeginMainFrameNotExpectedSoon() override; | 240 void SendBeginMainFrameNotExpectedSoon() override; |
| 244 | 241 |
| 245 // ResourceUpdateControllerClient implementation | 242 // ResourceUpdateControllerClient implementation |
| 246 void ReadyToFinalizeTextureUpdates() override; | 243 void ReadyToFinalizeTextureUpdates() override; |
| 247 | 244 |
| 248 protected: | 245 protected: |
| 249 ThreadProxy( | 246 ThreadProxy( |
| 250 LayerTreeHost* layer_tree_host, | 247 LayerTreeHost* layer_tree_host, |
| 251 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 248 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 | 315 |
| 319 base::WeakPtr<ThreadProxy> main_thread_weak_ptr_; | 316 base::WeakPtr<ThreadProxy> main_thread_weak_ptr_; |
| 320 base::WeakPtr<ThreadProxy> impl_thread_weak_ptr_; | 317 base::WeakPtr<ThreadProxy> impl_thread_weak_ptr_; |
| 321 | 318 |
| 322 DISALLOW_COPY_AND_ASSIGN(ThreadProxy); | 319 DISALLOW_COPY_AND_ASSIGN(ThreadProxy); |
| 323 }; | 320 }; |
| 324 | 321 |
| 325 } // namespace cc | 322 } // namespace cc |
| 326 | 323 |
| 327 #endif // CC_TREES_THREAD_PROXY_H_ | 324 #endif // CC_TREES_THREAD_PROXY_H_ |
| OLD | NEW |