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

Unified Diff: cc/scheduler/scheduler_state_machine.h

Issue 199523002: cc: Throttle swaps in Scheduler instead of OutputSurface (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Actually, unittests need CC_EXPORT. Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/scheduler/scheduler.cc ('k') | cc/scheduler/scheduler_state_machine.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/scheduler/scheduler_state_machine.h
diff --git a/cc/scheduler/scheduler_state_machine.h b/cc/scheduler/scheduler_state_machine.h
index c8d68fc429dbc2b4aa1b02211a4d8394e5f5cf5d..277926471a3feaa4b4f6c7c7e1833ddcce5c0bd8 100644
--- a/cc/scheduler/scheduler_state_machine.h
+++ b/cc/scheduler/scheduler_state_machine.h
@@ -168,10 +168,21 @@ class CC_EXPORT SchedulerStateMachine {
// ManageTiles will occur shortly (even if no redraw is required).
void SetNeedsManageTiles();
+ // Sets how many swaps can be pending to the OutputSurface.
+ void SetMaxSwapsPending(int max);
+
+ // If the scheduler attempted to draw and swap, this provides feedback
+ // regarding whether or not the swap actually occured. We might skip the
+ // swap when there is not damage, for example.
+ void DidSwapBuffers();
+
// Indicates whether a redraw is required because we are currently rendering
// with a low resolution or checkerboarded tile.
void SetSwapUsedIncompleteTile(bool used_incomplete_tile);
+ // Notification from the OutputSurface that a swap has been consumed.
+ void DidSwapBuffersComplete();
+
// Indicates whether to prioritize animation smoothness over new content
// activation.
void SetSmoothnessTakesPriority(bool smoothness_takes_priority);
@@ -260,7 +271,7 @@ class CC_EXPORT SchedulerStateMachine {
void UpdateStateOnCommit(bool commit_was_aborted);
void UpdateStateOnActivation();
- void UpdateStateOnDraw(bool did_swap);
+ void UpdateStateOnDraw(bool did_request_swap);
void UpdateStateOnManageTiles();
const SchedulerSettings settings_;
@@ -285,6 +296,8 @@ class CC_EXPORT SchedulerStateMachine {
// ManageTile per BeginImplFrame.
int manage_tiles_funnel_;
int consecutive_checkerboard_animations_;
+ int max_pending_swaps_;
+ int pending_swaps_;
bool needs_redraw_;
bool needs_manage_tiles_;
bool swap_used_incomplete_tile_;
« no previous file with comments | « cc/scheduler/scheduler.cc ('k') | cc/scheduler/scheduler_state_machine.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698