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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 // Proxy implementation | 43 // Proxy implementation |
44 virtual bool CompositeAndReadback(void* pixels, gfx::Rect rect) OVERRIDE; | 44 virtual bool CompositeAndReadback(void* pixels, gfx::Rect rect) OVERRIDE; |
45 virtual void FinishAllRendering() OVERRIDE; | 45 virtual void FinishAllRendering() OVERRIDE; |
46 virtual bool IsStarted() const OVERRIDE; | 46 virtual bool IsStarted() const OVERRIDE; |
47 virtual void SetLayerTreeHostClientReady() OVERRIDE; | 47 virtual void SetLayerTreeHostClientReady() OVERRIDE; |
48 virtual void SetVisible(bool visible) OVERRIDE; | 48 virtual void SetVisible(bool visible) OVERRIDE; |
49 virtual void CreateAndInitializeOutputSurface() OVERRIDE; | 49 virtual void CreateAndInitializeOutputSurface() OVERRIDE; |
50 virtual const RendererCapabilities& GetRendererCapabilities() const OVERRIDE; | 50 virtual const RendererCapabilities& GetRendererCapabilities() const OVERRIDE; |
51 virtual void SetNeedsAnimate() OVERRIDE; | 51 virtual void SetNeedsAnimate() OVERRIDE; |
| 52 virtual void SetNeedsUpdateLayers() OVERRIDE; |
52 virtual void SetNeedsCommit() OVERRIDE; | 53 virtual void SetNeedsCommit() OVERRIDE; |
53 virtual void SetNeedsRedraw(gfx::Rect damage_rect) OVERRIDE; | 54 virtual void SetNeedsRedraw(gfx::Rect damage_rect) OVERRIDE; |
54 virtual void SetDeferCommits(bool defer_commits) OVERRIDE; | 55 virtual void SetDeferCommits(bool defer_commits) OVERRIDE; |
55 virtual bool CommitRequested() const OVERRIDE; | 56 virtual bool CommitRequested() const OVERRIDE; |
56 virtual void MainThreadHasStoppedFlinging() OVERRIDE; | 57 virtual void MainThreadHasStoppedFlinging() OVERRIDE; |
57 virtual void Start(scoped_ptr<OutputSurface> first_output_surface) OVERRIDE; | 58 virtual void Start(scoped_ptr<OutputSurface> first_output_surface) OVERRIDE; |
58 virtual void Stop() OVERRIDE; | 59 virtual void Stop() OVERRIDE; |
59 virtual size_t MaxPartialTextureUpdates() const OVERRIDE; | 60 virtual size_t MaxPartialTextureUpdates() const OVERRIDE; |
60 virtual void AcquireLayerTextures() OVERRIDE; | 61 virtual void AcquireLayerTextures() OVERRIDE; |
61 virtual void ForceSerializeOnSwapBuffers() OVERRIDE; | 62 virtual void ForceSerializeOnSwapBuffers() OVERRIDE; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 scoped_ptr<BeginFrameAndCommitState> begin_frame_state); | 128 scoped_ptr<BeginFrameAndCommitState> begin_frame_state); |
128 void DidCommitAndDrawFrame(); | 129 void DidCommitAndDrawFrame(); |
129 void DidCompleteSwapBuffers(); | 130 void DidCompleteSwapBuffers(); |
130 void SetAnimationEvents(scoped_ptr<AnimationEventsVector> queue, | 131 void SetAnimationEvents(scoped_ptr<AnimationEventsVector> queue, |
131 base::Time wall_clock_time); | 132 base::Time wall_clock_time); |
132 void DoCreateAndInitializeOutputSurface(); | 133 void DoCreateAndInitializeOutputSurface(); |
133 // |capabilities| is set only when |success| is true. | 134 // |capabilities| is set only when |success| is true. |
134 void OnOutputSurfaceInitializeAttempted( | 135 void OnOutputSurfaceInitializeAttempted( |
135 bool success, | 136 bool success, |
136 const RendererCapabilities& capabilities); | 137 const RendererCapabilities& capabilities); |
| 138 void SendCommitRequestToImplThreadIfNeeded(); |
137 | 139 |
138 // Called on impl thread. | 140 // Called on impl thread. |
139 struct ReadbackRequest; | 141 struct ReadbackRequest; |
140 struct CommitPendingRequest; | 142 struct CommitPendingRequest; |
141 struct SchedulerStateRequest; | 143 struct SchedulerStateRequest; |
142 | 144 |
143 void ForceCommitOnImplThread(CompletionEvent* completion); | 145 void ForceCommitOnImplThread(CompletionEvent* completion); |
144 void StartCommitOnImplThread( | 146 void StartCommitOnImplThread( |
145 CompletionEvent* completion, | 147 CompletionEvent* completion, |
146 ResourceUpdateQueue* queue, | 148 ResourceUpdateQueue* queue, |
147 scoped_refptr<cc::ContextProvider> offscreen_context_provider); | 149 scoped_refptr<cc::ContextProvider> offscreen_context_provider); |
148 void BeginFrameAbortedByMainThreadOnImplThread(); | 150 void BeginFrameAbortedByMainThreadOnImplThread(bool cancel_commit); |
149 void RequestReadbackOnImplThread(ReadbackRequest* request); | 151 void RequestReadbackOnImplThread(ReadbackRequest* request); |
150 void FinishAllRenderingOnImplThread(CompletionEvent* completion); | 152 void FinishAllRenderingOnImplThread(CompletionEvent* completion); |
151 void InitializeImplOnImplThread(CompletionEvent* completion); | 153 void InitializeImplOnImplThread(CompletionEvent* completion); |
152 void SetLayerTreeHostClientReadyOnImplThread(); | 154 void SetLayerTreeHostClientReadyOnImplThread(); |
153 void SetVisibleOnImplThread(CompletionEvent* completion, bool visible); | 155 void SetVisibleOnImplThread(CompletionEvent* completion, bool visible); |
154 void HasInitializedOutputSurfaceOnImplThread( | 156 void HasInitializedOutputSurfaceOnImplThread( |
155 CompletionEvent* completion, | 157 CompletionEvent* completion, |
156 bool* has_initialized_output_surface); | 158 bool* has_initialized_output_surface); |
157 void InitializeOutputSurfaceOnImplThread( | 159 void InitializeOutputSurfaceOnImplThread( |
158 CompletionEvent* completion, | 160 CompletionEvent* completion, |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 // Set when the next draw should post DidCommitAndDrawFrame to the main | 237 // Set when the next draw should post DidCommitAndDrawFrame to the main |
236 // thread. | 238 // thread. |
237 bool next_frame_is_newly_committed_frame_on_impl_thread_; | 239 bool next_frame_is_newly_committed_frame_on_impl_thread_; |
238 | 240 |
239 bool throttle_frame_production_; | 241 bool throttle_frame_production_; |
240 bool begin_frame_scheduling_enabled_; | 242 bool begin_frame_scheduling_enabled_; |
241 bool using_synchronous_renderer_compositor_; | 243 bool using_synchronous_renderer_compositor_; |
242 | 244 |
243 bool inside_draw_; | 245 bool inside_draw_; |
244 | 246 |
| 247 bool can_cancel_commit_; |
| 248 |
245 bool defer_commits_; | 249 bool defer_commits_; |
246 scoped_ptr<BeginFrameAndCommitState> pending_deferred_commit_; | 250 scoped_ptr<BeginFrameAndCommitState> pending_deferred_commit_; |
247 | 251 |
248 base::TimeTicks smoothness_takes_priority_expiration_time_; | 252 base::TimeTicks smoothness_takes_priority_expiration_time_; |
249 bool renew_tree_priority_on_impl_thread_pending_; | 253 bool renew_tree_priority_on_impl_thread_pending_; |
250 | 254 |
251 RollingTimeDeltaHistory draw_duration_history_; | 255 RollingTimeDeltaHistory draw_duration_history_; |
252 | 256 |
253 DISALLOW_COPY_AND_ASSIGN(ThreadProxy); | 257 DISALLOW_COPY_AND_ASSIGN(ThreadProxy); |
254 }; | 258 }; |
255 | 259 |
256 } // namespace cc | 260 } // namespace cc |
257 | 261 |
258 #endif // CC_TREES_THREAD_PROXY_H_ | 262 #endif // CC_TREES_THREAD_PROXY_H_ |
OLD | NEW |