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

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: Add more comments Created 7 years, 4 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
« no previous file with comments | « cc/trees/single_thread_proxy.cc ('k') | cc/trees/thread_proxy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 scoped_ptr<BeginFrameAndCommitState> begin_frame_state); 129 scoped_ptr<BeginFrameAndCommitState> begin_frame_state);
129 void DidCommitAndDrawFrame(); 130 void DidCommitAndDrawFrame();
130 void DidCompleteSwapBuffers(); 131 void DidCompleteSwapBuffers();
131 void SetAnimationEvents(scoped_ptr<AnimationEventsVector> queue, 132 void SetAnimationEvents(scoped_ptr<AnimationEventsVector> queue,
132 base::Time wall_clock_time); 133 base::Time wall_clock_time);
133 void DoCreateAndInitializeOutputSurface(); 134 void DoCreateAndInitializeOutputSurface();
134 // |capabilities| is set only when |success| is true. 135 // |capabilities| is set only when |success| is true.
135 void OnOutputSurfaceInitializeAttempted( 136 void OnOutputSurfaceInitializeAttempted(
136 bool success, 137 bool success,
137 const RendererCapabilities& capabilities); 138 const RendererCapabilities& capabilities);
139 void SendCommitRequestToImplThreadIfNeeded();
138 140
139 // Called on impl thread. 141 // Called on impl thread.
140 struct ReadbackRequest; 142 struct ReadbackRequest;
141 struct CommitPendingRequest; 143 struct CommitPendingRequest;
142 struct SchedulerStateRequest; 144 struct SchedulerStateRequest;
143 145
144 void ForceCommitOnImplThread(CompletionEvent* completion); 146 void ForceCommitOnImplThread(CompletionEvent* completion);
145 void StartCommitOnImplThread( 147 void StartCommitOnImplThread(
146 CompletionEvent* completion, 148 CompletionEvent* completion,
147 ResourceUpdateQueue* queue, 149 ResourceUpdateQueue* queue,
148 scoped_refptr<cc::ContextProvider> offscreen_context_provider); 150 scoped_refptr<cc::ContextProvider> offscreen_context_provider);
149 void BeginFrameAbortedByMainThreadOnImplThread(); 151 void BeginFrameAbortedByMainThreadOnImplThread(bool did_handle);
150 void RequestReadbackOnImplThread(ReadbackRequest* request); 152 void RequestReadbackOnImplThread(ReadbackRequest* request);
151 void FinishAllRenderingOnImplThread(CompletionEvent* completion); 153 void FinishAllRenderingOnImplThread(CompletionEvent* completion);
152 void InitializeImplOnImplThread(CompletionEvent* completion); 154 void InitializeImplOnImplThread(CompletionEvent* completion);
153 void SetLayerTreeHostClientReadyOnImplThread(); 155 void SetLayerTreeHostClientReadyOnImplThread();
154 void SetVisibleOnImplThread(CompletionEvent* completion, bool visible); 156 void SetVisibleOnImplThread(CompletionEvent* completion, bool visible);
155 void HasInitializedOutputSurfaceOnImplThread( 157 void HasInitializedOutputSurfaceOnImplThread(
156 CompletionEvent* completion, 158 CompletionEvent* completion,
157 bool* has_initialized_output_surface); 159 bool* has_initialized_output_surface);
158 void InitializeOutputSurfaceOnImplThread( 160 void InitializeOutputSurfaceOnImplThread(
159 CompletionEvent* completion, 161 CompletionEvent* completion,
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 // Set when the next draw should post DidCommitAndDrawFrame to the main 236 // Set when the next draw should post DidCommitAndDrawFrame to the main
235 // thread. 237 // thread.
236 bool next_frame_is_newly_committed_frame_on_impl_thread_; 238 bool next_frame_is_newly_committed_frame_on_impl_thread_;
237 239
238 bool throttle_frame_production_; 240 bool throttle_frame_production_;
239 bool begin_frame_scheduling_enabled_; 241 bool begin_frame_scheduling_enabled_;
240 bool using_synchronous_renderer_compositor_; 242 bool using_synchronous_renderer_compositor_;
241 243
242 bool inside_draw_; 244 bool inside_draw_;
243 245
246 bool can_cancel_commit_;
247
244 bool defer_commits_; 248 bool defer_commits_;
245 scoped_ptr<BeginFrameAndCommitState> pending_deferred_commit_; 249 scoped_ptr<BeginFrameAndCommitState> pending_deferred_commit_;
246 250
247 base::TimeTicks smoothness_takes_priority_expiration_time_; 251 base::TimeTicks smoothness_takes_priority_expiration_time_;
248 bool renew_tree_priority_on_impl_thread_pending_; 252 bool renew_tree_priority_on_impl_thread_pending_;
249 253
250 RollingTimeDeltaHistory draw_duration_history_; 254 RollingTimeDeltaHistory draw_duration_history_;
251 RollingTimeDeltaHistory begin_frame_to_commit_duration_history_; 255 RollingTimeDeltaHistory begin_frame_to_commit_duration_history_;
252 RollingTimeDeltaHistory commit_to_activate_duration_history_; 256 RollingTimeDeltaHistory commit_to_activate_duration_history_;
253 257
254 // Used for computing samples added to 258 // Used for computing samples added to
255 // begin_frame_to_commit_draw_duration_history_ and 259 // begin_frame_to_commit_draw_duration_history_ and
256 // activation_duration_history_. 260 // activation_duration_history_.
257 base::TimeTicks begin_frame_sent_to_main_thread_time_; 261 base::TimeTicks begin_frame_sent_to_main_thread_time_;
258 base::TimeTicks commit_complete_time_; 262 base::TimeTicks commit_complete_time_;
259 263
260 DISALLOW_COPY_AND_ASSIGN(ThreadProxy); 264 DISALLOW_COPY_AND_ASSIGN(ThreadProxy);
261 }; 265 };
262 266
263 } // namespace cc 267 } // namespace cc
264 268
265 #endif // CC_TREES_THREAD_PROXY_H_ 269 #endif // CC_TREES_THREAD_PROXY_H_
OLDNEW
« no previous file with comments | « cc/trees/single_thread_proxy.cc ('k') | cc/trees/thread_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698