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

Side by Side Diff: cc/scheduler/scheduler_state_machine.h

Issue 1265023005: cc: Add SchedulerStateMachine::DidDraw and use for forced draws (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@WillDidAction0
Patch Set: Remove SetDrawResult and pass result as argument instead Created 5 years, 1 month 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
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_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ 5 #ifndef CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_
6 #define CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ 6 #define CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 static const char* ActionToString(Action action); 119 static const char* ActionToString(Action action);
120 120
121 scoped_refptr<base::trace_event::ConvertableToTraceFormat> AsValue() const; 121 scoped_refptr<base::trace_event::ConvertableToTraceFormat> AsValue() const;
122 void AsValueInto(base::trace_event::TracedValue* dict) const; 122 void AsValueInto(base::trace_event::TracedValue* dict) const;
123 123
124 Action NextAction() const; 124 Action NextAction() const;
125 void WillAnimate(); 125 void WillAnimate();
126 void WillSendBeginMainFrame(); 126 void WillSendBeginMainFrame();
127 void WillCommit(bool commit_had_no_updates); 127 void WillCommit(bool commit_had_no_updates);
128 void WillActivate(); 128 void WillActivate();
129 void WillDraw(bool did_request_swap); 129 void WillDraw();
130 void WillBeginOutputSurfaceCreation(); 130 void WillBeginOutputSurfaceCreation();
131 void WillPrepareTiles(); 131 void WillPrepareTiles();
132 void WillInvalidateOutputSurface(); 132 void WillInvalidateOutputSurface();
133 133
134 void DidDraw(bool did_request_swap, DrawResult draw_result);
135
134 // Indicates whether the impl thread needs a BeginImplFrame callback in order 136 // Indicates whether the impl thread needs a BeginImplFrame callback in order
135 // to make progress. 137 // to make progress.
136 bool BeginFrameNeeded() const; 138 bool BeginFrameNeeded() const;
137 139
138 // Indicates that the system has entered and left a BeginImplFrame callback. 140 // Indicates that the system has entered and left a BeginImplFrame callback.
139 // The scheduler will not draw more than once in a given BeginImplFrame 141 // The scheduler will not draw more than once in a given BeginImplFrame
140 // callback nor send more than one BeginMainFrame message. 142 // callback nor send more than one BeginMainFrame message.
141 void OnBeginImplFrame(); 143 void OnBeginImplFrame();
142 void OnBeginImplFrameDeadlinePending(); 144 void OnBeginImplFrameDeadlinePending();
143 // Indicates that the scheduler has entered the draw phase. The scheduler 145 // Indicates that the scheduler has entered the draw phase. The scheduler
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 193
192 int pending_swaps() const { return pending_swaps_; } 194 int pending_swaps() const { return pending_swaps_; }
193 195
194 // Indicates whether to prioritize impl thread latency (i.e., animation 196 // Indicates whether to prioritize impl thread latency (i.e., animation
195 // smoothness) over new content activation. 197 // smoothness) over new content activation.
196 void SetImplLatencyTakesPriority(bool impl_latency_takes_priority); 198 void SetImplLatencyTakesPriority(bool impl_latency_takes_priority);
197 bool impl_latency_takes_priority() const { 199 bool impl_latency_takes_priority() const {
198 return impl_latency_takes_priority_; 200 return impl_latency_takes_priority_;
199 } 201 }
200 202
201 // Indicates whether ACTION_DRAW_AND_SWAP_IF_POSSIBLE drew to the screen.
202 void DidDrawIfPossibleCompleted(DrawResult result);
203
204 // Indicates that a new begin main frame flow needs to be performed, either 203 // Indicates that a new begin main frame flow needs to be performed, either
205 // to pull updates from the main thread to the impl, or to push deltas from 204 // to pull updates from the main thread to the impl, or to push deltas from
206 // the impl thread to main. 205 // the impl thread to main.
207 void SetNeedsBeginMainFrame(); 206 void SetNeedsBeginMainFrame();
208 bool needs_begin_main_frame() const { return needs_begin_main_frame_; } 207 bool needs_begin_main_frame() const { return needs_begin_main_frame_; }
209 208
210 // Requests a single impl frame (after the current frame if there is one 209 // Requests a single impl frame (after the current frame if there is one
211 // active). 210 // active).
212 void SetNeedsOneBeginImplFrame(); 211 void SetNeedsOneBeginImplFrame();
213 212
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 bool did_request_swap_in_last_frame_; 343 bool did_request_swap_in_last_frame_;
345 bool did_perform_swap_in_last_draw_; 344 bool did_perform_swap_in_last_draw_;
346 345
347 private: 346 private:
348 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); 347 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine);
349 }; 348 };
350 349
351 } // namespace cc 350 } // namespace cc
352 351
353 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ 352 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698