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

Side by Side 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: rebase 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 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 #include "cc/scheduler/scheduler.h" 5 #include "cc/scheduler/scheduler.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include "base/auto_reset.h" 8 #include "base/auto_reset.h"
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 state_machine_.SetNeedsRedraw(); 85 state_machine_.SetNeedsRedraw();
86 ProcessScheduledActions(); 86 ProcessScheduledActions();
87 } 87 }
88 88
89 void Scheduler::SetNeedsManageTiles() { 89 void Scheduler::SetNeedsManageTiles() {
90 DCHECK(!IsInsideAction(SchedulerStateMachine::ACTION_MANAGE_TILES)); 90 DCHECK(!IsInsideAction(SchedulerStateMachine::ACTION_MANAGE_TILES));
91 state_machine_.SetNeedsManageTiles(); 91 state_machine_.SetNeedsManageTiles();
92 ProcessScheduledActions(); 92 ProcessScheduledActions();
93 } 93 }
94 94
95 void Scheduler::SetMaxSwapsPending(int max) {
96 state_machine_.SetMaxSwapsPending(max);
97 }
98
99 void Scheduler::DidSwapBuffers() { state_machine_.DidSwapBuffers(); }
100
95 void Scheduler::SetSwapUsedIncompleteTile(bool used_incomplete_tile) { 101 void Scheduler::SetSwapUsedIncompleteTile(bool used_incomplete_tile) {
96 state_machine_.SetSwapUsedIncompleteTile(used_incomplete_tile); 102 state_machine_.SetSwapUsedIncompleteTile(used_incomplete_tile);
97 ProcessScheduledActions(); 103 ProcessScheduledActions();
98 } 104 }
99 105
106 void Scheduler::OnSwapBuffersComplete() {
107 state_machine_.OnSwapBuffersComplete();
108 ProcessScheduledActions();
109 }
110
100 void Scheduler::SetSmoothnessTakesPriority(bool smoothness_takes_priority) { 111 void Scheduler::SetSmoothnessTakesPriority(bool smoothness_takes_priority) {
101 state_machine_.SetSmoothnessTakesPriority(smoothness_takes_priority); 112 state_machine_.SetSmoothnessTakesPriority(smoothness_takes_priority);
102 ProcessScheduledActions(); 113 ProcessScheduledActions();
103 } 114 }
104 115
105 void Scheduler::SetMainThreadNeedsLayerTextures() { 116 void Scheduler::SetMainThreadNeedsLayerTextures() {
106 state_machine_.SetMainThreadNeedsLayerTextures(); 117 state_machine_.SetMainThreadNeedsLayerTextures();
107 ProcessScheduledActions(); 118 ProcessScheduledActions();
108 } 119 }
109 120
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 } 546 }
536 547
537 bool Scheduler::IsBeginMainFrameSentOrStarted() const { 548 bool Scheduler::IsBeginMainFrameSentOrStarted() const {
538 return (state_machine_.commit_state() == 549 return (state_machine_.commit_state() ==
539 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || 550 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT ||
540 state_machine_.commit_state() == 551 state_machine_.commit_state() ==
541 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); 552 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED);
542 } 553 }
543 554
544 } // namespace cc 555 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698