| 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_SINGLE_THREAD_PROXY_H_ | 5 #ifndef CC_TREES_SINGLE_THREAD_PROXY_H_ |
| 6 #define CC_TREES_SINGLE_THREAD_PROXY_H_ | 6 #define CC_TREES_SINGLE_THREAD_PROXY_H_ |
| 7 | 7 |
| 8 #include <limits> | 8 #include <limits> |
| 9 | 9 |
| 10 #include "base/cancelable_callback.h" | 10 #include "base/cancelable_callback.h" |
| 11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
| 12 #include "cc/animation/animation_events.h" | 12 #include "cc/animation/animation_events.h" |
| 13 #include "cc/output/begin_frame_args.h" | 13 #include "cc/output/begin_frame_args.h" |
| 14 #include "cc/scheduler/scheduler.h" | 14 #include "cc/scheduler/scheduler.h" |
| 15 #include "cc/trees/blocking_task_runner.h" | 15 #include "cc/trees/blocking_task_runner.h" |
| 16 #include "cc/trees/layer_tree_host_impl.h" | 16 #include "cc/trees/layer_tree_host_impl.h" |
| 17 #include "cc/trees/proxy.h" | 17 #include "cc/trees/proxy.h" |
| 18 #include "cc/trees/proxy_timing_history.h" | |
| 19 | 18 |
| 20 namespace cc { | 19 namespace cc { |
| 21 | 20 |
| 22 class BeginFrameSource; | 21 class BeginFrameSource; |
| 23 class ContextProvider; | 22 class ContextProvider; |
| 24 class LayerTreeHost; | 23 class LayerTreeHost; |
| 25 class LayerTreeHostSingleThreadClient; | 24 class LayerTreeHostSingleThreadClient; |
| 26 class ResourceUpdateQueue; | 25 class ResourceUpdateQueue; |
| 27 | 26 |
| 28 class CC_EXPORT SingleThreadProxy : public Proxy, | 27 class CC_EXPORT SingleThreadProxy : public Proxy, |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 void ScheduledActionSendBeginMainFrame() override; | 69 void ScheduledActionSendBeginMainFrame() override; |
| 71 DrawResult ScheduledActionDrawAndSwapIfPossible() override; | 70 DrawResult ScheduledActionDrawAndSwapIfPossible() override; |
| 72 DrawResult ScheduledActionDrawAndSwapForced() override; | 71 DrawResult ScheduledActionDrawAndSwapForced() override; |
| 73 void ScheduledActionCommit() override; | 72 void ScheduledActionCommit() override; |
| 74 void ScheduledActionAnimate() override; | 73 void ScheduledActionAnimate() override; |
| 75 void ScheduledActionActivateSyncTree() override; | 74 void ScheduledActionActivateSyncTree() override; |
| 76 void ScheduledActionBeginOutputSurfaceCreation() override; | 75 void ScheduledActionBeginOutputSurfaceCreation() override; |
| 77 void ScheduledActionPrepareTiles() override; | 76 void ScheduledActionPrepareTiles() override; |
| 78 void ScheduledActionInvalidateOutputSurface() override; | 77 void ScheduledActionInvalidateOutputSurface() override; |
| 79 void DidAnticipatedDrawTimeChange(base::TimeTicks time) override; | 78 void DidAnticipatedDrawTimeChange(base::TimeTicks time) override; |
| 80 base::TimeDelta DrawDurationEstimate() override; | |
| 81 base::TimeDelta BeginMainFrameToCommitDurationEstimate() override; | |
| 82 base::TimeDelta CommitToActivateDurationEstimate() override; | |
| 83 void SendBeginFramesToChildren(const BeginFrameArgs& args) override; | 79 void SendBeginFramesToChildren(const BeginFrameArgs& args) override; |
| 84 void SendBeginMainFrameNotExpectedSoon() override; | 80 void SendBeginMainFrameNotExpectedSoon() override; |
| 85 | 81 |
| 86 // LayerTreeHostImplClient implementation | 82 // LayerTreeHostImplClient implementation |
| 87 void UpdateRendererCapabilitiesOnImplThread() override; | 83 void UpdateRendererCapabilitiesOnImplThread() override; |
| 88 void DidLoseOutputSurfaceOnImplThread() override; | 84 void DidLoseOutputSurfaceOnImplThread() override; |
| 89 void CommitVSyncParameters(base::TimeTicks timebase, | 85 void CommitVSyncParameters(base::TimeTicks timebase, |
| 90 base::TimeDelta interval) override; | 86 base::TimeDelta interval) override; |
| 91 void SetEstimatedParentDrawTime(base::TimeDelta draw_time) override; | 87 void SetEstimatedParentDrawTime(base::TimeDelta draw_time) override; |
| 92 void SetMaxSwapsPendingOnImplThread(int max) override; | 88 void SetMaxSwapsPendingOnImplThread(int max) override; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 103 void SetVideoNeedsBeginFrames(bool needs_begin_frames) override; | 99 void SetVideoNeedsBeginFrames(bool needs_begin_frames) override; |
| 104 void PostAnimationEventsToMainThreadOnImplThread( | 100 void PostAnimationEventsToMainThreadOnImplThread( |
| 105 scoped_ptr<AnimationEventsVector> events) override; | 101 scoped_ptr<AnimationEventsVector> events) override; |
| 106 bool ReduceContentsTextureMemoryOnImplThread(size_t limit_bytes, | 102 bool ReduceContentsTextureMemoryOnImplThread(size_t limit_bytes, |
| 107 int priority_cutoff) override; | 103 int priority_cutoff) override; |
| 108 bool IsInsideDraw() override; | 104 bool IsInsideDraw() override; |
| 109 void RenewTreePriority() override {} | 105 void RenewTreePriority() override {} |
| 110 void PostDelayedAnimationTaskOnImplThread(const base::Closure& task, | 106 void PostDelayedAnimationTaskOnImplThread(const base::Closure& task, |
| 111 base::TimeDelta delay) override {} | 107 base::TimeDelta delay) override {} |
| 112 void DidActivateSyncTree() override; | 108 void DidActivateSyncTree() override; |
| 109 void WillPrepareTiles() override; |
| 113 void DidPrepareTiles() override; | 110 void DidPrepareTiles() override; |
| 114 void DidCompletePageScaleAnimationOnImplThread() override; | 111 void DidCompletePageScaleAnimationOnImplThread() override; |
| 115 void OnDrawForOutputSurface() override; | 112 void OnDrawForOutputSurface() override; |
| 116 void PostFrameTimingEventsOnImplThread( | 113 void PostFrameTimingEventsOnImplThread( |
| 117 scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, | 114 scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, |
| 118 scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) | 115 scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) |
| 119 override; | 116 override; |
| 120 | 117 |
| 121 void SetDebugState(const LayerTreeDebugState& debug_state) override {} | 118 void SetDebugState(const LayerTreeDebugState& debug_state) override {} |
| 122 | 119 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 150 LayerTreeHost* layer_tree_host_; | 147 LayerTreeHost* layer_tree_host_; |
| 151 LayerTreeHostSingleThreadClient* client_; | 148 LayerTreeHostSingleThreadClient* client_; |
| 152 | 149 |
| 153 // Used on the Thread, but checked on main thread during | 150 // Used on the Thread, but checked on main thread during |
| 154 // initialization/shutdown. | 151 // initialization/shutdown. |
| 155 scoped_ptr<LayerTreeHostImpl> layer_tree_host_impl_; | 152 scoped_ptr<LayerTreeHostImpl> layer_tree_host_impl_; |
| 156 RendererCapabilities renderer_capabilities_for_main_thread_; | 153 RendererCapabilities renderer_capabilities_for_main_thread_; |
| 157 | 154 |
| 158 // Accessed from both threads. | 155 // Accessed from both threads. |
| 159 scoped_ptr<Scheduler> scheduler_on_impl_thread_; | 156 scoped_ptr<Scheduler> scheduler_on_impl_thread_; |
| 160 ProxyTimingHistory timing_history_; | |
| 161 | 157 |
| 162 scoped_ptr<BlockingTaskRunner::CapturePostTasks> commit_blocking_task_runner_; | 158 scoped_ptr<BlockingTaskRunner::CapturePostTasks> commit_blocking_task_runner_; |
| 163 scoped_ptr<ResourceUpdateQueue> queue_for_commit_; | 159 scoped_ptr<ResourceUpdateQueue> queue_for_commit_; |
| 164 bool next_frame_is_newly_committed_frame_; | 160 bool next_frame_is_newly_committed_frame_; |
| 165 | 161 |
| 166 #if DCHECK_IS_ON() | 162 #if DCHECK_IS_ON() |
| 167 bool inside_impl_frame_; | 163 bool inside_impl_frame_; |
| 168 #endif | 164 #endif |
| 169 bool inside_draw_; | 165 bool inside_draw_; |
| 170 bool defer_commits_; | 166 bool defer_commits_; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 private: | 237 private: |
| 242 DebugScopedSetImplThread impl_thread_; | 238 DebugScopedSetImplThread impl_thread_; |
| 243 DebugScopedSetMainThreadBlocked main_thread_blocked_; | 239 DebugScopedSetMainThreadBlocked main_thread_blocked_; |
| 244 | 240 |
| 245 DISALLOW_COPY_AND_ASSIGN(DebugScopedSetImplThreadAndMainThreadBlocked); | 241 DISALLOW_COPY_AND_ASSIGN(DebugScopedSetImplThreadAndMainThreadBlocked); |
| 246 }; | 242 }; |
| 247 | 243 |
| 248 } // namespace cc | 244 } // namespace cc |
| 249 | 245 |
| 250 #endif // CC_TREES_SINGLE_THREAD_PROXY_H_ | 246 #endif // CC_TREES_SINGLE_THREAD_PROXY_H_ |
| OLD | NEW |