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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 virtual void Start() OVERRIDE; | 64 virtual void Start() OVERRIDE; |
65 virtual void Stop() OVERRIDE; | 65 virtual void Stop() OVERRIDE; |
66 virtual size_t MaxPartialTextureUpdates() const OVERRIDE; | 66 virtual size_t MaxPartialTextureUpdates() const OVERRIDE; |
67 virtual void AcquireLayerTextures() OVERRIDE; | 67 virtual void AcquireLayerTextures() OVERRIDE; |
68 virtual void ForceSerializeOnSwapBuffers() OVERRIDE; | 68 virtual void ForceSerializeOnSwapBuffers() OVERRIDE; |
69 virtual scoped_ptr<base::Value> AsValue() const OVERRIDE; | 69 virtual scoped_ptr<base::Value> AsValue() const OVERRIDE; |
70 virtual bool CommitPendingForTesting() OVERRIDE; | 70 virtual bool CommitPendingForTesting() OVERRIDE; |
71 virtual scoped_ptr<base::Value> SchedulerStateAsValueForTesting() OVERRIDE; | 71 virtual scoped_ptr<base::Value> SchedulerStateAsValueForTesting() OVERRIDE; |
72 | 72 |
73 // LayerTreeHostImplClient implementation | 73 // LayerTreeHostImplClient implementation |
| 74 virtual void UpdateRendererCapabilitiesOnImplThread() OVERRIDE; |
74 virtual void DidLoseOutputSurfaceOnImplThread() OVERRIDE; | 75 virtual void DidLoseOutputSurfaceOnImplThread() OVERRIDE; |
75 virtual void DidSwapBuffersOnImplThread() OVERRIDE {} | 76 virtual void DidSwapBuffersOnImplThread() OVERRIDE {} |
76 virtual void OnSwapBuffersCompleteOnImplThread() OVERRIDE; | 77 virtual void OnSwapBuffersCompleteOnImplThread() OVERRIDE; |
77 virtual void BeginImplFrame(const BeginFrameArgs& args) OVERRIDE; | 78 virtual void BeginImplFrame(const BeginFrameArgs& args) OVERRIDE; |
78 virtual void OnCanDrawStateChanged(bool can_draw) OVERRIDE; | 79 virtual void OnCanDrawStateChanged(bool can_draw) OVERRIDE; |
79 virtual void NotifyReadyToActivate() OVERRIDE; | 80 virtual void NotifyReadyToActivate() OVERRIDE; |
80 // Please call these 2 functions through | 81 // Please call these 2 functions through |
81 // LayerTreeHostImpl's SetNeedsRedraw() and SetNeedsRedrawRect(). | 82 // LayerTreeHostImpl's SetNeedsRedraw() and SetNeedsRedrawRect(). |
82 virtual void SetNeedsRedrawOnImplThread() OVERRIDE; | 83 virtual void SetNeedsRedrawOnImplThread() OVERRIDE; |
83 virtual void SetNeedsRedrawRectOnImplThread(const gfx::Rect& dirty_rect) | 84 virtual void SetNeedsRedrawRectOnImplThread(const gfx::Rect& dirty_rect) |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 ~BeginMainFrameAndCommitState(); | 133 ~BeginMainFrameAndCommitState(); |
133 | 134 |
134 base::TimeTicks monotonic_frame_begin_time; | 135 base::TimeTicks monotonic_frame_begin_time; |
135 scoped_ptr<ScrollAndScaleSet> scroll_info; | 136 scoped_ptr<ScrollAndScaleSet> scroll_info; |
136 size_t memory_allocation_limit_bytes; | 137 size_t memory_allocation_limit_bytes; |
137 int memory_allocation_priority_cutoff; | 138 int memory_allocation_priority_cutoff; |
138 bool evicted_ui_resources; | 139 bool evicted_ui_resources; |
139 }; | 140 }; |
140 | 141 |
141 // Called on main thread. | 142 // Called on main thread. |
| 143 void SetRendererCapabilitiesMainThreadCopy( |
| 144 const RendererCapabilities& capabilities); |
142 void BeginMainFrame( | 145 void BeginMainFrame( |
143 scoped_ptr<BeginMainFrameAndCommitState> begin_main_frame_state); | 146 scoped_ptr<BeginMainFrameAndCommitState> begin_main_frame_state); |
144 void DidCommitAndDrawFrame(); | 147 void DidCommitAndDrawFrame(); |
145 void DidCompleteSwapBuffers(); | 148 void DidCompleteSwapBuffers(); |
146 void SetAnimationEvents(scoped_ptr<AnimationEventsVector> queue, | 149 void SetAnimationEvents(scoped_ptr<AnimationEventsVector> queue, |
147 base::Time wall_clock_time); | 150 base::Time wall_clock_time); |
148 void DoCreateAndInitializeOutputSurface(); | 151 void DoCreateAndInitializeOutputSurface(); |
149 // |capabilities| is set only when |success| is true. | 152 // |capabilities| is set only when |success| is true. |
150 void OnOutputSurfaceInitializeAttempted( | 153 void OnOutputSurfaceInitializeAttempted( |
151 bool success, | 154 bool success, |
152 const RendererCapabilities& capabilities); | 155 const RendererCapabilities& capabilities); |
153 void SendCommitRequestToImplThreadIfNeeded(); | 156 void SendCommitRequestToImplThreadIfNeeded(); |
154 | 157 |
155 // Called on impl thread. | 158 // Called on impl thread. |
156 struct ReadbackRequest; | 159 struct ReadbackRequest; |
157 struct CommitPendingRequest; | 160 struct CommitPendingRequest; |
158 struct SchedulerStateRequest; | 161 struct SchedulerStateRequest; |
159 | 162 |
160 void ForceCommitForReadbackOnImplThread( | 163 void ForceCommitForReadbackOnImplThread( |
161 CompletionEvent* begin_main_frame_sent_completion, | 164 CompletionEvent* begin_main_frame_sent_completion, |
162 ReadbackRequest* request); | 165 ReadbackRequest* request); |
163 void StartCommitOnImplThread( | 166 void StartCommitOnImplThread( |
164 CompletionEvent* completion, | 167 CompletionEvent* completion, |
165 ResourceUpdateQueue* queue, | 168 ResourceUpdateQueue* queue, |
166 scoped_refptr<ContextProvider> offscreen_context_provider); | 169 scoped_refptr<ContextProvider> offscreen_context_provider, |
| 170 const RendererCapabilities& main_frame_renderer_caps); |
167 void BeginMainFrameAbortedOnImplThread(bool did_handle); | 171 void BeginMainFrameAbortedOnImplThread(bool did_handle); |
168 void RequestReadbackOnImplThread(ReadbackRequest* request); | 172 void RequestReadbackOnImplThread(ReadbackRequest* request); |
169 void FinishAllRenderingOnImplThread(CompletionEvent* completion); | 173 void FinishAllRenderingOnImplThread(CompletionEvent* completion); |
170 void InitializeImplOnImplThread(CompletionEvent* completion); | 174 void InitializeImplOnImplThread(CompletionEvent* completion); |
171 void SetLayerTreeHostClientReadyOnImplThread(); | 175 void SetLayerTreeHostClientReadyOnImplThread(); |
172 void SetVisibleOnImplThread(CompletionEvent* completion, bool visible); | 176 void SetVisibleOnImplThread(CompletionEvent* completion, bool visible); |
173 void UpdateBackgroundAnimateTicking(); | 177 void UpdateBackgroundAnimateTicking(); |
174 void HasInitializedOutputSurfaceOnImplThread( | 178 void HasInitializedOutputSurfaceOnImplThread( |
175 CompletionEvent* completion, | 179 CompletionEvent* completion, |
176 bool* has_initialized_output_surface); | 180 bool* has_initialized_output_surface); |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 // Set when the main thread is waiting on a | 272 // Set when the main thread is waiting on a |
269 // ScheduledActionSendBeginMainFrame to be issued. | 273 // ScheduledActionSendBeginMainFrame to be issued. |
270 CompletionEvent* begin_main_frame_sent_completion_event; | 274 CompletionEvent* begin_main_frame_sent_completion_event; |
271 | 275 |
272 // Set when the main thread is waiting on a readback. | 276 // Set when the main thread is waiting on a readback. |
273 ReadbackRequest* readback_request; | 277 ReadbackRequest* readback_request; |
274 | 278 |
275 // Set when the main thread is waiting on a commit to complete. | 279 // Set when the main thread is waiting on a commit to complete. |
276 CompletionEvent* commit_completion_event; | 280 CompletionEvent* commit_completion_event; |
277 | 281 |
| 282 // The main renderer capabilities used for this commit. used to check |
| 283 // for renderer capability staleness. |
| 284 RendererCapabilities renderer_capabilities_for_commit; |
| 285 |
278 // Set when the main thread is waiting on a pending tree activation. | 286 // Set when the main thread is waiting on a pending tree activation. |
279 CompletionEvent* completion_event_for_commit_held_on_tree_activation; | 287 CompletionEvent* completion_event_for_commit_held_on_tree_activation; |
280 | 288 |
281 // Set when the main thread is waiting on layers to be drawn. | 289 // Set when the main thread is waiting on layers to be drawn. |
282 CompletionEvent* texture_acquisition_completion_event; | 290 CompletionEvent* texture_acquisition_completion_event; |
283 | 291 |
284 scoped_ptr<ResourceUpdateController> current_resource_update_controller; | 292 scoped_ptr<ResourceUpdateController> current_resource_update_controller; |
285 | 293 |
286 // Set when the next draw should post DidCommitAndDrawFrame to the main | 294 // Set when the next draw should post DidCommitAndDrawFrame to the main |
287 // thread. | 295 // thread. |
(...skipping 30 matching lines...) Expand all Loading... |
318 | 326 |
319 base::WeakPtr<ThreadProxy> main_thread_weak_ptr_; | 327 base::WeakPtr<ThreadProxy> main_thread_weak_ptr_; |
320 base::WeakPtr<ThreadProxy> impl_thread_weak_ptr_; | 328 base::WeakPtr<ThreadProxy> impl_thread_weak_ptr_; |
321 | 329 |
322 DISALLOW_COPY_AND_ASSIGN(ThreadProxy); | 330 DISALLOW_COPY_AND_ASSIGN(ThreadProxy); |
323 }; | 331 }; |
324 | 332 |
325 } // namespace cc | 333 } // namespace cc |
326 | 334 |
327 #endif // CC_TREES_THREAD_PROXY_H_ | 335 #endif // CC_TREES_THREAD_PROXY_H_ |
OLD | NEW |