| 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 25 matching lines...) Expand all Loading... |
| 36 SchedulerClient, | 36 SchedulerClient, |
| 37 ResourceUpdateControllerClient { | 37 ResourceUpdateControllerClient { |
| 38 public: | 38 public: |
| 39 static scoped_ptr<Proxy> Create( | 39 static scoped_ptr<Proxy> Create( |
| 40 LayerTreeHost* layer_tree_host, | 40 LayerTreeHost* layer_tree_host, |
| 41 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); | 41 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); |
| 42 | 42 |
| 43 virtual ~ThreadProxy(); | 43 virtual ~ThreadProxy(); |
| 44 | 44 |
| 45 // Proxy implementation | 45 // Proxy implementation |
| 46 virtual bool CompositeAndReadback(void* pixels, | |
| 47 const gfx::Rect& rect) OVERRIDE; | |
| 48 virtual void FinishAllRendering() OVERRIDE; | 46 virtual void FinishAllRendering() OVERRIDE; |
| 49 virtual bool IsStarted() const OVERRIDE; | 47 virtual bool IsStarted() const OVERRIDE; |
| 50 virtual void SetLayerTreeHostClientReady() OVERRIDE; | 48 virtual void SetLayerTreeHostClientReady() OVERRIDE; |
| 51 virtual void SetVisible(bool visible) OVERRIDE; | 49 virtual void SetVisible(bool visible) OVERRIDE; |
| 52 virtual void CreateAndInitializeOutputSurface() OVERRIDE; | 50 virtual void CreateAndInitializeOutputSurface() OVERRIDE; |
| 53 virtual const RendererCapabilities& GetRendererCapabilities() const OVERRIDE; | 51 virtual const RendererCapabilities& GetRendererCapabilities() const OVERRIDE; |
| 54 virtual void SetNeedsAnimate() OVERRIDE; | 52 virtual void SetNeedsAnimate() OVERRIDE; |
| 55 virtual void SetNeedsUpdateLayers() OVERRIDE; | 53 virtual void SetNeedsUpdateLayers() OVERRIDE; |
| 56 virtual void SetNeedsCommit() OVERRIDE; | 54 virtual void SetNeedsCommit() OVERRIDE; |
| 57 virtual void SetNeedsRedraw(const gfx::Rect& damage_rect) OVERRIDE; | 55 virtual void SetNeedsRedraw(const gfx::Rect& damage_rect) OVERRIDE; |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 const RendererCapabilities& capabilities); | 147 const RendererCapabilities& capabilities); |
| 150 void BeginMainFrame( | 148 void BeginMainFrame( |
| 151 scoped_ptr<BeginMainFrameAndCommitState> begin_main_frame_state); | 149 scoped_ptr<BeginMainFrameAndCommitState> begin_main_frame_state); |
| 152 void DidCommitAndDrawFrame(); | 150 void DidCommitAndDrawFrame(); |
| 153 void DidCompleteSwapBuffers(); | 151 void DidCompleteSwapBuffers(); |
| 154 void SetAnimationEvents(scoped_ptr<AnimationEventsVector> queue); | 152 void SetAnimationEvents(scoped_ptr<AnimationEventsVector> queue); |
| 155 void DoCreateAndInitializeOutputSurface(); | 153 void DoCreateAndInitializeOutputSurface(); |
| 156 void SendCommitRequestToImplThreadIfNeeded(); | 154 void SendCommitRequestToImplThreadIfNeeded(); |
| 157 | 155 |
| 158 // Called on impl thread. | 156 // Called on impl thread. |
| 159 struct ReadbackRequest; | |
| 160 struct CommitPendingRequest; | 157 struct CommitPendingRequest; |
| 161 struct SchedulerStateRequest; | 158 struct SchedulerStateRequest; |
| 162 | 159 |
| 163 void ForceCommitForReadbackOnImplThread( | |
| 164 CompletionEvent* begin_main_frame_sent_completion, | |
| 165 ReadbackRequest* request); | |
| 166 void StartCommitOnImplThread(CompletionEvent* completion, | 160 void StartCommitOnImplThread(CompletionEvent* completion, |
| 167 ResourceUpdateQueue* queue); | 161 ResourceUpdateQueue* queue); |
| 168 void BeginMainFrameAbortedOnImplThread(bool did_handle); | 162 void BeginMainFrameAbortedOnImplThread(bool did_handle); |
| 169 void RequestReadbackOnImplThread(ReadbackRequest* request); | |
| 170 void FinishAllRenderingOnImplThread(CompletionEvent* completion); | 163 void FinishAllRenderingOnImplThread(CompletionEvent* completion); |
| 171 void InitializeImplOnImplThread(CompletionEvent* completion); | 164 void InitializeImplOnImplThread(CompletionEvent* completion); |
| 172 void SetLayerTreeHostClientReadyOnImplThread(); | 165 void SetLayerTreeHostClientReadyOnImplThread(); |
| 173 void SetVisibleOnImplThread(CompletionEvent* completion, bool visible); | 166 void SetVisibleOnImplThread(CompletionEvent* completion, bool visible); |
| 174 void UpdateBackgroundAnimateTicking(); | 167 void UpdateBackgroundAnimateTicking(); |
| 175 void HasInitializedOutputSurfaceOnImplThread( | 168 void HasInitializedOutputSurfaceOnImplThread( |
| 176 CompletionEvent* completion, | 169 CompletionEvent* completion, |
| 177 bool* has_initialized_output_surface); | 170 bool* has_initialized_output_surface); |
| 178 void InitializeOutputSurfaceOnImplThread( | 171 void InitializeOutputSurfaceOnImplThread( |
| 179 CompletionEvent* completion, | 172 CompletionEvent* completion, |
| 180 scoped_ptr<OutputSurface> output_surface, | 173 scoped_ptr<OutputSurface> output_surface, |
| 181 bool* success, | 174 bool* success, |
| 182 RendererCapabilities* capabilities); | 175 RendererCapabilities* capabilities); |
| 183 void FinishGLOnImplThread(CompletionEvent* completion); | 176 void FinishGLOnImplThread(CompletionEvent* completion); |
| 184 void LayerTreeHostClosedOnImplThread(CompletionEvent* completion); | 177 void LayerTreeHostClosedOnImplThread(CompletionEvent* completion); |
| 185 DrawSwapReadbackResult DrawSwapReadbackInternal(bool forced_draw, | 178 DrawSwapReadbackResult DrawSwapInternal(bool forced_draw); |
| 186 bool swap_requested, | |
| 187 bool readback_requested); | |
| 188 void ForceSerializeOnSwapBuffersOnImplThread(CompletionEvent* completion); | 179 void ForceSerializeOnSwapBuffersOnImplThread(CompletionEvent* completion); |
| 189 void CheckOutputSurfaceStatusOnImplThread(); | 180 void CheckOutputSurfaceStatusOnImplThread(); |
| 190 void CommitPendingOnImplThreadForTesting(CommitPendingRequest* request); | 181 void CommitPendingOnImplThreadForTesting(CommitPendingRequest* request); |
| 191 void SchedulerStateAsValueOnImplThreadForTesting( | 182 void SchedulerStateAsValueOnImplThreadForTesting( |
| 192 SchedulerStateRequest* request); | 183 SchedulerStateRequest* request); |
| 193 void AsValueOnImplThread(CompletionEvent* completion, | 184 void AsValueOnImplThread(CompletionEvent* completion, |
| 194 base::DictionaryValue* state) const; | 185 base::DictionaryValue* state) const; |
| 195 void RenewTreePriorityOnImplThread(); | 186 void RenewTreePriorityOnImplThread(); |
| 196 void SetSwapUsedIncompleteTileOnImplThread(bool used_incomplete_tile); | 187 void SetSwapUsedIncompleteTileOnImplThread(bool used_incomplete_tile); |
| 197 void MainThreadHasStoppedFlingingOnImplThread(); | 188 void MainThreadHasStoppedFlingingOnImplThread(); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 208 const int layer_tree_host_id; | 199 const int layer_tree_host_id; |
| 209 | 200 |
| 210 // Set only when SetNeedsAnimate is called. | 201 // Set only when SetNeedsAnimate is called. |
| 211 bool animate_requested; | 202 bool animate_requested; |
| 212 // Set only when SetNeedsCommit is called. | 203 // Set only when SetNeedsCommit is called. |
| 213 bool commit_requested; | 204 bool commit_requested; |
| 214 // Set by SetNeedsAnimate, SetNeedsUpdateLayers, and SetNeedsCommit. | 205 // Set by SetNeedsAnimate, SetNeedsUpdateLayers, and SetNeedsCommit. |
| 215 bool commit_request_sent_to_impl_thread; | 206 bool commit_request_sent_to_impl_thread; |
| 216 | 207 |
| 217 bool started; | 208 bool started; |
| 218 bool in_composite_and_readback; | |
| 219 bool manage_tiles_pending; | 209 bool manage_tiles_pending; |
| 220 bool can_cancel_commit; | 210 bool can_cancel_commit; |
| 221 bool defer_commits; | 211 bool defer_commits; |
| 222 | 212 |
| 223 base::CancelableClosure output_surface_creation_callback; | 213 base::CancelableClosure output_surface_creation_callback; |
| 224 RendererCapabilities renderer_capabilities_main_thread_copy; | 214 RendererCapabilities renderer_capabilities_main_thread_copy; |
| 225 | 215 |
| 226 scoped_ptr<BeginMainFrameAndCommitState> pending_deferred_commit; | 216 scoped_ptr<BeginMainFrameAndCommitState> pending_deferred_commit; |
| 227 base::WeakPtrFactory<ThreadProxy> weak_factory; | 217 base::WeakPtrFactory<ThreadProxy> weak_factory; |
| 228 }; | 218 }; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 258 // Copy of the main thread side contents texture manager for work | 248 // Copy of the main thread side contents texture manager for work |
| 259 // that needs to be done on the compositor thread. | 249 // that needs to be done on the compositor thread. |
| 260 PrioritizedResourceManager* contents_texture_manager; | 250 PrioritizedResourceManager* contents_texture_manager; |
| 261 | 251 |
| 262 scoped_ptr<Scheduler> scheduler; | 252 scoped_ptr<Scheduler> scheduler; |
| 263 | 253 |
| 264 // Set when the main thread is waiting on a | 254 // Set when the main thread is waiting on a |
| 265 // ScheduledActionSendBeginMainFrame to be issued. | 255 // ScheduledActionSendBeginMainFrame to be issued. |
| 266 CompletionEvent* begin_main_frame_sent_completion_event; | 256 CompletionEvent* begin_main_frame_sent_completion_event; |
| 267 | 257 |
| 268 // Set when the main thread is waiting on a readback. | |
| 269 ReadbackRequest* readback_request; | |
| 270 | |
| 271 // Set when the main thread is waiting on a commit to complete. | 258 // Set when the main thread is waiting on a commit to complete. |
| 272 CompletionEvent* commit_completion_event; | 259 CompletionEvent* commit_completion_event; |
| 273 | 260 |
| 274 // Set when the main thread is waiting on a pending tree activation. | 261 // Set when the main thread is waiting on a pending tree activation. |
| 275 CompletionEvent* completion_event_for_commit_held_on_tree_activation; | 262 CompletionEvent* completion_event_for_commit_held_on_tree_activation; |
| 276 | 263 |
| 277 scoped_ptr<ResourceUpdateController> current_resource_update_controller; | 264 scoped_ptr<ResourceUpdateController> current_resource_update_controller; |
| 278 | 265 |
| 279 // Set when the next draw should post DidCommitAndDrawFrame to the main | 266 // Set when the next draw should post DidCommitAndDrawFrame to the main |
| 280 // thread. | 267 // thread. |
| (...skipping 26 matching lines...) Expand all Loading... |
| 307 | 294 |
| 308 base::WeakPtr<ThreadProxy> main_thread_weak_ptr_; | 295 base::WeakPtr<ThreadProxy> main_thread_weak_ptr_; |
| 309 base::WeakPtr<ThreadProxy> impl_thread_weak_ptr_; | 296 base::WeakPtr<ThreadProxy> impl_thread_weak_ptr_; |
| 310 | 297 |
| 311 DISALLOW_COPY_AND_ASSIGN(ThreadProxy); | 298 DISALLOW_COPY_AND_ASSIGN(ThreadProxy); |
| 312 }; | 299 }; |
| 313 | 300 |
| 314 } // namespace cc | 301 } // namespace cc |
| 315 | 302 |
| 316 #endif // CC_TREES_THREAD_PROXY_H_ | 303 #endif // CC_TREES_THREAD_PROXY_H_ |
| OLD | NEW |