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

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: WIP: pulling FRC out of OS Created 6 years, 9 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 state_machine_.SetNeedsRedraw(); 72 state_machine_.SetNeedsRedraw();
73 ProcessScheduledActions(); 73 ProcessScheduledActions();
74 } 74 }
75 75
76 void Scheduler::SetNeedsManageTiles() { 76 void Scheduler::SetNeedsManageTiles() {
77 DCHECK(!IsInsideAction(SchedulerStateMachine::ACTION_MANAGE_TILES)); 77 DCHECK(!IsInsideAction(SchedulerStateMachine::ACTION_MANAGE_TILES));
78 state_machine_.SetNeedsManageTiles(); 78 state_machine_.SetNeedsManageTiles();
79 ProcessScheduledActions(); 79 ProcessScheduledActions();
80 } 80 }
81 81
82 void Scheduler::SetMaxSwapsPending(int max) {
83 state_machine_.SetMaxSwapsPending(max);
84 }
85
86 void Scheduler::DidSwapBuffers() { state_machine_.DidSwapBuffers(); }
87
82 void Scheduler::SetSwapUsedIncompleteTile(bool used_incomplete_tile) { 88 void Scheduler::SetSwapUsedIncompleteTile(bool used_incomplete_tile) {
83 state_machine_.SetSwapUsedIncompleteTile(used_incomplete_tile); 89 state_machine_.SetSwapUsedIncompleteTile(used_incomplete_tile);
84 ProcessScheduledActions(); 90 ProcessScheduledActions();
85 } 91 }
86 92
93 void Scheduler::OnSwapBuffersComplete() {
94 state_machine_.OnSwapBuffersComplete();
95 ProcessScheduledActions();
96 }
97
87 void Scheduler::SetSmoothnessTakesPriority(bool smoothness_takes_priority) { 98 void Scheduler::SetSmoothnessTakesPriority(bool smoothness_takes_priority) {
88 state_machine_.SetSmoothnessTakesPriority(smoothness_takes_priority); 99 state_machine_.SetSmoothnessTakesPriority(smoothness_takes_priority);
89 ProcessScheduledActions(); 100 ProcessScheduledActions();
90 } 101 }
91 102
92 void Scheduler::SetMainThreadNeedsLayerTextures() { 103 void Scheduler::SetMainThreadNeedsLayerTextures() {
93 state_machine_.SetMainThreadNeedsLayerTextures(); 104 state_machine_.SetMainThreadNeedsLayerTextures();
94 ProcessScheduledActions(); 105 ProcessScheduledActions();
95 } 106 }
96 107
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 } 452 }
442 453
443 bool Scheduler::IsBeginMainFrameSentOrStarted() const { 454 bool Scheduler::IsBeginMainFrameSentOrStarted() const {
444 return (state_machine_.commit_state() == 455 return (state_machine_.commit_state() ==
445 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || 456 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT ||
446 state_machine_.commit_state() == 457 state_machine_.commit_state() ==
447 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); 458 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED);
448 } 459 }
449 460
450 } // namespace cc 461 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698