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

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

Issue 246753008: cc: Unify use of DidSwapBuffers() and did_request_swap (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Introduce HasSentDrawRequestThisFrame() Created 6 years, 7 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_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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 182
183 // Notification from the OutputSurface that a swap has been consumed. 183 // Notification from the OutputSurface that a swap has been consumed.
184 void DidSwapBuffersComplete(); 184 void DidSwapBuffersComplete();
185 185
186 // Indicates whether to prioritize animation smoothness over new content 186 // Indicates whether to prioritize animation smoothness over new content
187 // activation. 187 // activation.
188 void SetSmoothnessTakesPriority(bool smoothness_takes_priority); 188 void SetSmoothnessTakesPriority(bool smoothness_takes_priority);
189 bool smoothness_takes_priority() const { return smoothness_takes_priority_; } 189 bool smoothness_takes_priority() const { return smoothness_takes_priority_; }
190 190
191 // Indicates whether ACTION_DRAW_AND_SWAP_IF_POSSIBLE drew to the screen. 191 // Indicates whether ACTION_DRAW_AND_SWAP_IF_POSSIBLE drew to the screen.
192 void DidDrawIfPossibleCompleted(DrawSwapReadbackResult::DrawResult result); 192 void DidDrawIfPossibleCompleted(DrawResult result);
193 193
194 // Indicates that a new commit flow needs to be performed, either to pull 194 // Indicates that a new commit flow needs to be performed, either to pull
195 // updates from the main thread to the impl, or to push deltas from the impl 195 // updates from the main thread to the impl, or to push deltas from the impl
196 // thread to main. 196 // thread to main.
197 void SetNeedsCommit(); 197 void SetNeedsCommit();
198 198
199 // As SetNeedsCommit(), but ensures the BeginMainFrame will be sent even 199 // As SetNeedsCommit(), but ensures the BeginMainFrame will be sent even
200 // if we are not visible. After this call we expect to go through 200 // if we are not visible. After this call we expect to go through
201 // the forced commit flow and then return to waiting for a non-forced 201 // the forced commit flow and then return to waiting for a non-forced
202 // BeginMainFrame to finish. 202 // BeginMainFrame to finish.
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 bool ShouldDrawForced() const; 258 bool ShouldDrawForced() const;
259 bool ShouldDraw() const; 259 bool ShouldDraw() const;
260 bool ShouldActivatePendingTree() const; 260 bool ShouldActivatePendingTree() const;
261 bool ShouldUpdateVisibleTiles() const; 261 bool ShouldUpdateVisibleTiles() const;
262 bool ShouldSendBeginMainFrame() const; 262 bool ShouldSendBeginMainFrame() const;
263 bool ShouldCommit() const; 263 bool ShouldCommit() const;
264 bool ShouldManageTiles() const; 264 bool ShouldManageTiles() const;
265 265
266 void AdvanceCurrentFrameNumber(); 266 void AdvanceCurrentFrameNumber();
267 bool HasSentBeginMainFrameThisFrame() const; 267 bool HasSentBeginMainFrameThisFrame() const;
268 bool HasSentDrawRequestThisFrame() const;
268 bool HasScheduledManageTilesThisFrame() const; 269 bool HasScheduledManageTilesThisFrame() const;
269 bool HasUpdatedVisibleTilesThisFrame() const; 270 bool HasUpdatedVisibleTilesThisFrame() const;
270 bool HasSwappedThisFrame() const; 271 bool HasSwappedThisFrame() const;
271 272
272 void UpdateStateOnCommit(bool commit_was_aborted); 273 void UpdateStateOnCommit(bool commit_was_aborted);
273 void UpdateStateOnActivation(); 274 void UpdateStateOnActivation();
274 void UpdateStateOnDraw(bool did_request_swap); 275 void UpdateStateOnDraw();
275 void UpdateStateOnManageTiles(); 276 void UpdateStateOnManageTiles();
276 277
277 const SchedulerSettings settings_; 278 const SchedulerSettings settings_;
278 279
279 OutputSurfaceState output_surface_state_; 280 OutputSurfaceState output_surface_state_;
280 BeginImplFrameState begin_impl_frame_state_; 281 BeginImplFrameState begin_impl_frame_state_;
281 CommitState commit_state_; 282 CommitState commit_state_;
282 ForcedRedrawOnTimeoutState forced_redraw_state_; 283 ForcedRedrawOnTimeoutState forced_redraw_state_;
283 SynchronousReadbackState readback_state_; 284 SynchronousReadbackState readback_state_;
284 285
285 BeginFrameArgs begin_impl_frame_args_; 286 BeginFrameArgs begin_impl_frame_args_;
286 287
287 int commit_count_; 288 int commit_count_;
288 int current_frame_number_; 289 int current_frame_number_;
289 int last_frame_number_swap_performed_; 290 int last_frame_number_swap_performed_;
290 int last_frame_number_begin_main_frame_sent_; 291 int last_frame_number_begin_main_frame_sent_;
292 int last_frame_number_draw_request_sent_;
291 int last_frame_number_update_visible_tiles_was_called_; 293 int last_frame_number_update_visible_tiles_was_called_;
292 294
293 // manage_tiles_funnel_ is "filled" each time ManageTiles is called 295 // manage_tiles_funnel_ is "filled" each time ManageTiles is called
294 // and "drained" on each BeginImplFrame. If the funnel gets too full, 296 // and "drained" on each BeginImplFrame. If the funnel gets too full,
295 // we start throttling ACTION_MANAGE_TILES such that we average one 297 // we start throttling ACTION_MANAGE_TILES such that we average one
296 // ManageTile per BeginImplFrame. 298 // ManageTile per BeginImplFrame.
297 int manage_tiles_funnel_; 299 int manage_tiles_funnel_;
298 int consecutive_checkerboard_animations_; 300 int consecutive_checkerboard_animations_;
299 int max_pending_swaps_; 301 int max_pending_swaps_;
300 int pending_swaps_; 302 int pending_swaps_;
(...skipping 16 matching lines...) Expand all
317 bool continuous_painting_; 319 bool continuous_painting_;
318 bool needs_back_to_back_readback_; 320 bool needs_back_to_back_readback_;
319 321
320 private: 322 private:
321 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); 323 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine);
322 }; 324 };
323 325
324 } // namespace cc 326 } // namespace cc
325 327
326 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ 328 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698