Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Side by Side Diff: cc/trees/thread_proxy.h

Issue 19106007: cc: Allow the main thread to cancel commits (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 scoped_ptr<BeginFrameAndCommitState> begin_frame_state); 130 scoped_ptr<BeginFrameAndCommitState> begin_frame_state);
130 void DidCommitAndDrawFrame(); 131 void DidCommitAndDrawFrame();
131 void DidCompleteSwapBuffers(); 132 void DidCompleteSwapBuffers();
132 void SetAnimationEvents(scoped_ptr<AnimationEventsVector> queue, 133 void SetAnimationEvents(scoped_ptr<AnimationEventsVector> queue,
133 base::Time wall_clock_time); 134 base::Time wall_clock_time);
134 void DoCreateAndInitializeOutputSurface(); 135 void DoCreateAndInitializeOutputSurface();
135 // |capabilities| is set only when |success| is true. 136 // |capabilities| is set only when |success| is true.
136 void OnOutputSurfaceInitializeAttempted( 137 void OnOutputSurfaceInitializeAttempted(
137 bool success, 138 bool success,
138 const RendererCapabilities& capabilities); 139 const RendererCapabilities& capabilities);
140 void SendCommitRequestToImplThreadIfNeeded();
139 141
140 // Called on impl thread. 142 // Called on impl thread.
141 struct ReadbackRequest; 143 struct ReadbackRequest;
142 struct CommitPendingRequest; 144 struct CommitPendingRequest;
143 struct SchedulerStateRequest; 145 struct SchedulerStateRequest;
144 146
145 void ForceCommitOnImplThread(CompletionEvent* completion); 147 void ForceCommitOnImplThread(CompletionEvent* completion);
146 void StartCommitOnImplThread( 148 void StartCommitOnImplThread(
147 CompletionEvent* completion, 149 CompletionEvent* completion,
148 ResourceUpdateQueue* queue, 150 ResourceUpdateQueue* queue,
149 scoped_refptr<cc::ContextProvider> offscreen_context_provider); 151 scoped_refptr<cc::ContextProvider> offscreen_context_provider);
150 void BeginFrameAbortedByMainThreadOnImplThread(); 152 void BeginFrameAbortedByMainThreadOnImplThread(bool cancel_commit);
151 void RequestReadbackOnImplThread(ReadbackRequest* request); 153 void RequestReadbackOnImplThread(ReadbackRequest* request);
152 void FinishAllRenderingOnImplThread(CompletionEvent* completion); 154 void FinishAllRenderingOnImplThread(CompletionEvent* completion);
153 void InitializeImplOnImplThread(CompletionEvent* completion); 155 void InitializeImplOnImplThread(CompletionEvent* completion);
154 void SetLayerTreeHostClientReadyOnImplThread(); 156 void SetLayerTreeHostClientReadyOnImplThread();
155 void SetVisibleOnImplThread(CompletionEvent* completion, bool visible); 157 void SetVisibleOnImplThread(CompletionEvent* completion, bool visible);
156 void HasInitializedOutputSurfaceOnImplThread( 158 void HasInitializedOutputSurfaceOnImplThread(
157 CompletionEvent* completion, 159 CompletionEvent* completion,
158 bool* has_initialized_output_surface); 160 bool* has_initialized_output_surface);
159 void InitializeOutputSurfaceOnImplThread( 161 void InitializeOutputSurfaceOnImplThread(
160 CompletionEvent* completion, 162 CompletionEvent* completion,
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 // Set when the next draw should post DidCommitAndDrawFrame to the main 239 // Set when the next draw should post DidCommitAndDrawFrame to the main
238 // thread. 240 // thread.
239 bool next_frame_is_newly_committed_frame_on_impl_thread_; 241 bool next_frame_is_newly_committed_frame_on_impl_thread_;
240 242
241 bool throttle_frame_production_; 243 bool throttle_frame_production_;
242 bool begin_frame_scheduling_enabled_; 244 bool begin_frame_scheduling_enabled_;
243 bool using_synchronous_renderer_compositor_; 245 bool using_synchronous_renderer_compositor_;
244 246
245 bool inside_draw_; 247 bool inside_draw_;
246 248
249 bool can_cancel_commit_;
250
247 bool defer_commits_; 251 bool defer_commits_;
248 scoped_ptr<BeginFrameAndCommitState> pending_deferred_commit_; 252 scoped_ptr<BeginFrameAndCommitState> pending_deferred_commit_;
249 253
250 base::TimeTicks smoothness_takes_priority_expiration_time_; 254 base::TimeTicks smoothness_takes_priority_expiration_time_;
251 bool renew_tree_priority_on_impl_thread_pending_; 255 bool renew_tree_priority_on_impl_thread_pending_;
252 256
253 RollingTimeDeltaHistory draw_duration_history_; 257 RollingTimeDeltaHistory draw_duration_history_;
254 RollingTimeDeltaHistory begin_frame_to_commit_duration_history_; 258 RollingTimeDeltaHistory begin_frame_to_commit_duration_history_;
255 RollingTimeDeltaHistory commit_to_activate_duration_history_; 259 RollingTimeDeltaHistory commit_to_activate_duration_history_;
256 260
257 // Used for computing samples added to 261 // Used for computing samples added to
258 // begin_frame_to_commit_draw_duration_history_ and 262 // begin_frame_to_commit_draw_duration_history_ and
259 // activation_duration_history_. 263 // activation_duration_history_.
260 base::TimeTicks begin_frame_sent_to_main_thread_time_; 264 base::TimeTicks begin_frame_sent_to_main_thread_time_;
261 base::TimeTicks commit_complete_time_; 265 base::TimeTicks commit_complete_time_;
262 266
263 DISALLOW_COPY_AND_ASSIGN(ThreadProxy); 267 DISALLOW_COPY_AND_ASSIGN(ThreadProxy);
264 }; 268 };
265 269
266 } // namespace cc 270 } // namespace cc
267 271
268 #endif // CC_TREES_THREAD_PROXY_H_ 272 #endif // CC_TREES_THREAD_PROXY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698