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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
61 ~MainThreadOnly(); | 61 ~MainThreadOnly(); |
62 | 62 |
63 const int layer_tree_host_id; | 63 const int layer_tree_host_id; |
64 | 64 |
65 // Set only when SetNeedsAnimate is called. | 65 // Set only when SetNeedsAnimate is called. |
66 bool animate_requested; | 66 bool animate_requested; |
67 // Set only when SetNeedsCommit is called. | 67 // Set only when SetNeedsCommit is called. |
68 bool commit_requested; | 68 bool commit_requested; |
69 // Set by SetNeedsAnimate, SetNeedsUpdateLayers, and SetNeedsCommit. | 69 // Set by SetNeedsAnimate, SetNeedsUpdateLayers, and SetNeedsCommit. |
70 bool commit_request_sent_to_impl_thread; | 70 bool commit_request_sent_to_impl_thread; |
71 // Set by BeginFrameRequested, SendBeginFrameOnMainThread. | |
72 bool begin_frame_requested; | |
brianderson
2014/08/21 00:14:00
ThreadProxy shouldn't have to cache this.
simonhong
2014/08/26 08:24:48
Removed.
| |
71 | 73 |
72 bool started; | 74 bool started; |
73 bool manage_tiles_pending; | 75 bool manage_tiles_pending; |
74 bool can_cancel_commit; | 76 bool can_cancel_commit; |
75 bool defer_commits; | 77 bool defer_commits; |
76 | 78 |
77 RendererCapabilities renderer_capabilities_main_thread_copy; | 79 RendererCapabilities renderer_capabilities_main_thread_copy; |
78 | 80 |
79 scoped_ptr<BeginMainFrameAndCommitState> pending_deferred_commit; | 81 scoped_ptr<BeginMainFrameAndCommitState> pending_deferred_commit; |
80 base::WeakPtrFactory<ThreadProxy> weak_factory; | 82 base::WeakPtrFactory<ThreadProxy> weak_factory; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
166 virtual bool BeginMainFrameRequested() const OVERRIDE; | 168 virtual bool BeginMainFrameRequested() const OVERRIDE; |
167 virtual void MainThreadHasStoppedFlinging() OVERRIDE; | 169 virtual void MainThreadHasStoppedFlinging() OVERRIDE; |
168 virtual void Start() OVERRIDE; | 170 virtual void Start() OVERRIDE; |
169 virtual void Stop() OVERRIDE; | 171 virtual void Stop() OVERRIDE; |
170 virtual size_t MaxPartialTextureUpdates() const OVERRIDE; | 172 virtual size_t MaxPartialTextureUpdates() const OVERRIDE; |
171 virtual void ForceSerializeOnSwapBuffers() OVERRIDE; | 173 virtual void ForceSerializeOnSwapBuffers() OVERRIDE; |
172 virtual bool SupportsImplScrolling() const OVERRIDE; | 174 virtual bool SupportsImplScrolling() const OVERRIDE; |
173 virtual void SetDebugState(const LayerTreeDebugState& debug_state) OVERRIDE; | 175 virtual void SetDebugState(const LayerTreeDebugState& debug_state) OVERRIDE; |
174 virtual void AsValueInto(base::debug::TracedValue* value) const OVERRIDE; | 176 virtual void AsValueInto(base::debug::TracedValue* value) const OVERRIDE; |
175 virtual bool CommitPendingForTesting() OVERRIDE; | 177 virtual bool CommitPendingForTesting() OVERRIDE; |
178 virtual void BeginFrameRequested() OVERRIDE; | |
176 | 179 |
177 // LayerTreeHostImplClient implementation | 180 // LayerTreeHostImplClient implementation |
178 virtual void UpdateRendererCapabilitiesOnImplThread() OVERRIDE; | 181 virtual void UpdateRendererCapabilitiesOnImplThread() OVERRIDE; |
179 virtual void DidLoseOutputSurfaceOnImplThread() OVERRIDE; | 182 virtual void DidLoseOutputSurfaceOnImplThread() OVERRIDE; |
180 virtual void CommitVSyncParameters(base::TimeTicks timebase, | 183 virtual void CommitVSyncParameters(base::TimeTicks timebase, |
181 base::TimeDelta interval) OVERRIDE; | 184 base::TimeDelta interval) OVERRIDE; |
182 virtual void SetEstimatedParentDrawTime(base::TimeDelta draw_time) OVERRIDE; | 185 virtual void SetEstimatedParentDrawTime(base::TimeDelta draw_time) OVERRIDE; |
183 virtual void BeginFrame(const BeginFrameArgs& args) OVERRIDE; | 186 virtual void BeginFrame(const BeginFrameArgs& args) OVERRIDE; |
184 virtual void SetMaxSwapsPendingOnImplThread(int max) OVERRIDE; | 187 virtual void SetMaxSwapsPendingOnImplThread(int max) OVERRIDE; |
185 virtual void DidSwapBuffersOnImplThread() OVERRIDE; | 188 virtual void DidSwapBuffersOnImplThread() OVERRIDE; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
219 virtual void ScheduledActionCommit() OVERRIDE; | 222 virtual void ScheduledActionCommit() OVERRIDE; |
220 virtual void ScheduledActionUpdateVisibleTiles() OVERRIDE; | 223 virtual void ScheduledActionUpdateVisibleTiles() OVERRIDE; |
221 virtual void ScheduledActionActivateSyncTree() OVERRIDE; | 224 virtual void ScheduledActionActivateSyncTree() OVERRIDE; |
222 virtual void ScheduledActionBeginOutputSurfaceCreation() OVERRIDE; | 225 virtual void ScheduledActionBeginOutputSurfaceCreation() OVERRIDE; |
223 virtual void ScheduledActionManageTiles() OVERRIDE; | 226 virtual void ScheduledActionManageTiles() OVERRIDE; |
224 virtual void DidAnticipatedDrawTimeChange(base::TimeTicks time) OVERRIDE; | 227 virtual void DidAnticipatedDrawTimeChange(base::TimeTicks time) OVERRIDE; |
225 virtual base::TimeDelta DrawDurationEstimate() OVERRIDE; | 228 virtual base::TimeDelta DrawDurationEstimate() OVERRIDE; |
226 virtual base::TimeDelta BeginMainFrameToCommitDurationEstimate() OVERRIDE; | 229 virtual base::TimeDelta BeginMainFrameToCommitDurationEstimate() OVERRIDE; |
227 virtual base::TimeDelta CommitToActivateDurationEstimate() OVERRIDE; | 230 virtual base::TimeDelta CommitToActivateDurationEstimate() OVERRIDE; |
228 virtual void DidBeginImplFrameDeadline() OVERRIDE; | 231 virtual void DidBeginImplFrameDeadline() OVERRIDE; |
232 virtual void SendBeginFrame(const BeginFrameArgs& args) OVERRIDE; | |
229 | 233 |
230 // ResourceUpdateControllerClient implementation | 234 // ResourceUpdateControllerClient implementation |
231 virtual void ReadyToFinalizeTextureUpdates() OVERRIDE; | 235 virtual void ReadyToFinalizeTextureUpdates() OVERRIDE; |
232 | 236 |
233 protected: | 237 protected: |
234 ThreadProxy(LayerTreeHost* layer_tree_host, | 238 ThreadProxy(LayerTreeHost* layer_tree_host, |
235 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 239 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
236 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); | 240 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); |
237 | 241 |
238 private: | 242 private: |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
273 DrawResult DrawSwapInternal(bool forced_draw); | 277 DrawResult DrawSwapInternal(bool forced_draw); |
274 void ForceSerializeOnSwapBuffersOnImplThread(CompletionEvent* completion); | 278 void ForceSerializeOnSwapBuffersOnImplThread(CompletionEvent* completion); |
275 void CheckOutputSurfaceStatusOnImplThread(); | 279 void CheckOutputSurfaceStatusOnImplThread(); |
276 void CommitPendingOnImplThreadForTesting(CommitPendingRequest* request); | 280 void CommitPendingOnImplThreadForTesting(CommitPendingRequest* request); |
277 void AsValueOnImplThread(CompletionEvent* completion, | 281 void AsValueOnImplThread(CompletionEvent* completion, |
278 base::debug::TracedValue* state) const; | 282 base::debug::TracedValue* state) const; |
279 void SetSwapUsedIncompleteTileOnImplThread(bool used_incomplete_tile); | 283 void SetSwapUsedIncompleteTileOnImplThread(bool used_incomplete_tile); |
280 void MainThreadHasStoppedFlingingOnImplThread(); | 284 void MainThreadHasStoppedFlingingOnImplThread(); |
281 void SetInputThrottledUntilCommitOnImplThread(bool is_throttled); | 285 void SetInputThrottledUntilCommitOnImplThread(bool is_throttled); |
282 void SetDebugStateOnImplThread(const LayerTreeDebugState& debug_state); | 286 void SetDebugStateOnImplThread(const LayerTreeDebugState& debug_state); |
287 void SendBeginFrameOnMainThread(const BeginFrameArgs& args); | |
288 void BeginFrameRequestedOnImplThread() const; | |
283 | 289 |
284 LayerTreeHost* layer_tree_host(); | 290 LayerTreeHost* layer_tree_host(); |
285 const LayerTreeHost* layer_tree_host() const; | 291 const LayerTreeHost* layer_tree_host() const; |
286 | 292 |
287 // Use accessors instead of this variable directly. | 293 // Use accessors instead of this variable directly. |
288 MainThreadOnly main_thread_only_vars_unsafe_; | 294 MainThreadOnly main_thread_only_vars_unsafe_; |
289 MainThreadOnly& main(); | 295 MainThreadOnly& main(); |
290 | 296 |
291 // Use accessors instead of this variable directly. | 297 // Use accessors instead of this variable directly. |
292 MainThreadOrBlockedMainThread main_thread_or_blocked_vars_unsafe_; | 298 MainThreadOrBlockedMainThread main_thread_or_blocked_vars_unsafe_; |
293 MainThreadOrBlockedMainThread& blocked_main(); | 299 MainThreadOrBlockedMainThread& blocked_main(); |
294 | 300 |
295 // Use accessors instead of this variable directly. | 301 // Use accessors instead of this variable directly. |
296 CompositorThreadOnly compositor_thread_vars_unsafe_; | 302 CompositorThreadOnly compositor_thread_vars_unsafe_; |
297 CompositorThreadOnly& impl(); | 303 CompositorThreadOnly& impl(); |
298 | 304 |
299 base::WeakPtr<ThreadProxy> main_thread_weak_ptr_; | 305 base::WeakPtr<ThreadProxy> main_thread_weak_ptr_; |
300 base::WeakPtr<ThreadProxy> impl_thread_weak_ptr_; | 306 base::WeakPtr<ThreadProxy> impl_thread_weak_ptr_; |
301 | 307 |
302 DISALLOW_COPY_AND_ASSIGN(ThreadProxy); | 308 DISALLOW_COPY_AND_ASSIGN(ThreadProxy); |
303 }; | 309 }; |
304 | 310 |
305 } // namespace cc | 311 } // namespace cc |
306 | 312 |
307 #endif // CC_TREES_THREAD_PROXY_H_ | 313 #endif // CC_TREES_THREAD_PROXY_H_ |
OLD | NEW |