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

Unified Diff: cc/scheduler/scheduler.cc

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.h ('k') | cc/scheduler/scheduler_state_machine.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/scheduler/scheduler.cc
diff --git a/cc/scheduler/scheduler.cc b/cc/scheduler/scheduler.cc
index 5d7001065f01dcdf1dbe0f1f9884e0544bfe8a22..592cbf10dee350e459dd2e0ab24a32967b1d62f4 100644
--- a/cc/scheduler/scheduler.cc
+++ b/cc/scheduler/scheduler.cc
@@ -92,11 +92,29 @@ void Scheduler::SetNeedsManageTiles() {
ProcessScheduledActions();
}
+void Scheduler::SetMaxSwapsPending(int max) {
+ state_machine_.SetMaxSwapsPending(max);
+}
+
+void Scheduler::DidSwapBuffers() {
+ state_machine_.DidSwapBuffers();
+ // There is no need to call ProcessScheduledActions here because
+ // swapping should not trigger any new actions.
+ if (!inside_process_scheduled_actions_) {
+ DCHECK_EQ(state_machine_.NextAction(), SchedulerStateMachine::ACTION_NONE);
+ }
+}
+
void Scheduler::SetSwapUsedIncompleteTile(bool used_incomplete_tile) {
state_machine_.SetSwapUsedIncompleteTile(used_incomplete_tile);
ProcessScheduledActions();
}
+void Scheduler::DidSwapBuffersComplete() {
+ state_machine_.DidSwapBuffersComplete();
+ ProcessScheduledActions();
+}
+
void Scheduler::SetSmoothnessTakesPriority(bool smoothness_takes_priority) {
state_machine_.SetSmoothnessTakesPriority(smoothness_takes_priority);
ProcessScheduledActions();
@@ -433,7 +451,7 @@ void Scheduler::DrawAndSwapForced() {
void Scheduler::DrawAndReadback() {
DrawSwapReadbackResult result = client_->ScheduledActionDrawAndReadback();
- DCHECK(!result.did_swap);
+ DCHECK(!result.did_request_swap);
}
void Scheduler::ProcessScheduledActions() {
« no previous file with comments | « cc/scheduler/scheduler.h ('k') | cc/scheduler/scheduler_state_machine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698