| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 // Set only when SetNeedsCommit is called. | 65 // Set only when SetNeedsCommit is called. |
| 66 bool commit_requested; | 66 bool commit_requested; |
| 67 // Set by SetNeedsAnimate, SetNeedsUpdateLayers, and SetNeedsCommit. | 67 // Set by SetNeedsAnimate, SetNeedsUpdateLayers, and SetNeedsCommit. |
| 68 bool commit_request_sent_to_impl_thread; | 68 bool commit_request_sent_to_impl_thread; |
| 69 | 69 |
| 70 bool started; | 70 bool started; |
| 71 bool manage_tiles_pending; | 71 bool manage_tiles_pending; |
| 72 bool can_cancel_commit; | 72 bool can_cancel_commit; |
| 73 bool defer_commits; | 73 bool defer_commits; |
| 74 | 74 |
| 75 base::CancelableClosure output_surface_creation_callback; | |
| 76 RendererCapabilities renderer_capabilities_main_thread_copy; | 75 RendererCapabilities renderer_capabilities_main_thread_copy; |
| 77 | 76 |
| 78 scoped_ptr<BeginMainFrameAndCommitState> pending_deferred_commit; | 77 scoped_ptr<BeginMainFrameAndCommitState> pending_deferred_commit; |
| 79 base::WeakPtrFactory<ThreadProxy> weak_factory; | 78 base::WeakPtrFactory<ThreadProxy> weak_factory; |
| 80 }; | 79 }; |
| 81 | 80 |
| 82 // Accessed on the main thread, or when main thread is blocked. | 81 // Accessed on the main thread, or when main thread is blocked. |
| 83 struct MainThreadOrBlockedMainThread { | 82 struct MainThreadOrBlockedMainThread { |
| 84 explicit MainThreadOrBlockedMainThread(LayerTreeHost* host); | 83 explicit MainThreadOrBlockedMainThread(LayerTreeHost* host); |
| 85 ~MainThreadOrBlockedMainThread(); | 84 ~MainThreadOrBlockedMainThread(); |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 | 234 |
| 236 private: | 235 private: |
| 237 // Called on main thread. | 236 // Called on main thread. |
| 238 void SetRendererCapabilitiesMainThreadCopy( | 237 void SetRendererCapabilitiesMainThreadCopy( |
| 239 const RendererCapabilities& capabilities); | 238 const RendererCapabilities& capabilities); |
| 240 void BeginMainFrame( | 239 void BeginMainFrame( |
| 241 scoped_ptr<BeginMainFrameAndCommitState> begin_main_frame_state); | 240 scoped_ptr<BeginMainFrameAndCommitState> begin_main_frame_state); |
| 242 void DidCommitAndDrawFrame(); | 241 void DidCommitAndDrawFrame(); |
| 243 void DidCompleteSwapBuffers(); | 242 void DidCompleteSwapBuffers(); |
| 244 void SetAnimationEvents(scoped_ptr<AnimationEventsVector> queue); | 243 void SetAnimationEvents(scoped_ptr<AnimationEventsVector> queue); |
| 244 void DidLoseOutputSurface(); |
| 245 void CreateAndInitializeOutputSurface(); | 245 void CreateAndInitializeOutputSurface(); |
| 246 void DoCreateAndInitializeOutputSurface(); | 246 void DidInitializeOutputSurface(bool success, |
| 247 const RendererCapabilities& capabilities); |
| 247 void SendCommitRequestToImplThreadIfNeeded(); | 248 void SendCommitRequestToImplThreadIfNeeded(); |
| 248 | 249 |
| 249 // Called on impl thread. | 250 // Called on impl thread. |
| 250 struct CommitPendingRequest; | 251 struct CommitPendingRequest; |
| 251 struct SchedulerStateRequest; | 252 struct SchedulerStateRequest; |
| 252 | 253 |
| 253 void StartCommitOnImplThread(CompletionEvent* completion, | 254 void StartCommitOnImplThread(CompletionEvent* completion, |
| 254 ResourceUpdateQueue* queue); | 255 ResourceUpdateQueue* queue); |
| 255 void BeginMainFrameAbortedOnImplThread(bool did_handle); | 256 void BeginMainFrameAbortedOnImplThread(bool did_handle); |
| 256 void FinishAllRenderingOnImplThread(CompletionEvent* completion); | 257 void FinishAllRenderingOnImplThread(CompletionEvent* completion); |
| 257 void InitializeImplOnImplThread(CompletionEvent* completion); | 258 void InitializeImplOnImplThread(CompletionEvent* completion); |
| 258 void SetLayerTreeHostClientReadyOnImplThread(); | 259 void SetLayerTreeHostClientReadyOnImplThread(); |
| 259 void SetVisibleOnImplThread(CompletionEvent* completion, bool visible); | 260 void SetVisibleOnImplThread(CompletionEvent* completion, bool visible); |
| 260 void UpdateBackgroundAnimateTicking(); | 261 void UpdateBackgroundAnimateTicking(); |
| 261 void HasInitializedOutputSurfaceOnImplThread( | 262 void HasInitializedOutputSurfaceOnImplThread( |
| 262 CompletionEvent* completion, | 263 CompletionEvent* completion, |
| 263 bool* has_initialized_output_surface); | 264 bool* has_initialized_output_surface); |
| 264 virtual void InitializeOutputSurfaceOnImplThread( | 265 void DeleteContentsTexturesOnImplThread(CompletionEvent* completion); |
| 265 CompletionEvent* completion, | 266 void InitializeOutputSurfaceOnImplThread( |
| 266 scoped_ptr<OutputSurface> output_surface, | 267 scoped_ptr<OutputSurface> output_surface); |
| 267 bool* success, | |
| 268 RendererCapabilities* capabilities); | |
| 269 void FinishGLOnImplThread(CompletionEvent* completion); | 268 void FinishGLOnImplThread(CompletionEvent* completion); |
| 270 void LayerTreeHostClosedOnImplThread(CompletionEvent* completion); | 269 void LayerTreeHostClosedOnImplThread(CompletionEvent* completion); |
| 271 DrawResult DrawSwapInternal(bool forced_draw); | 270 DrawResult DrawSwapInternal(bool forced_draw); |
| 272 void ForceSerializeOnSwapBuffersOnImplThread(CompletionEvent* completion); | 271 void ForceSerializeOnSwapBuffersOnImplThread(CompletionEvent* completion); |
| 273 void CheckOutputSurfaceStatusOnImplThread(); | 272 void CheckOutputSurfaceStatusOnImplThread(); |
| 274 void CommitPendingOnImplThreadForTesting(CommitPendingRequest* request); | 273 void CommitPendingOnImplThreadForTesting(CommitPendingRequest* request); |
| 275 void SchedulerAsValueOnImplThreadForTesting(SchedulerStateRequest* request); | 274 void SchedulerAsValueOnImplThreadForTesting(SchedulerStateRequest* request); |
| 276 void AsValueOnImplThread(CompletionEvent* completion, | 275 void AsValueOnImplThread(CompletionEvent* completion, |
| 277 base::DictionaryValue* state) const; | 276 base::DictionaryValue* state) const; |
| 278 void SetSwapUsedIncompleteTileOnImplThread(bool used_incomplete_tile); | 277 void SetSwapUsedIncompleteTileOnImplThread(bool used_incomplete_tile); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 297 | 296 |
| 298 base::WeakPtr<ThreadProxy> main_thread_weak_ptr_; | 297 base::WeakPtr<ThreadProxy> main_thread_weak_ptr_; |
| 299 base::WeakPtr<ThreadProxy> impl_thread_weak_ptr_; | 298 base::WeakPtr<ThreadProxy> impl_thread_weak_ptr_; |
| 300 | 299 |
| 301 DISALLOW_COPY_AND_ASSIGN(ThreadProxy); | 300 DISALLOW_COPY_AND_ASSIGN(ThreadProxy); |
| 302 }; | 301 }; |
| 303 | 302 |
| 304 } // namespace cc | 303 } // namespace cc |
| 305 | 304 |
| 306 #endif // CC_TREES_THREAD_PROXY_H_ | 305 #endif // CC_TREES_THREAD_PROXY_H_ |
| OLD | NEW |