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

Unified Diff: cc/scheduler/scheduler.cc

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, 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
Index: cc/scheduler/scheduler.cc
diff --git a/cc/scheduler/scheduler.cc b/cc/scheduler/scheduler.cc
index df7f166fd11e831edf504855773a38670e6f6b0d..bc34d4676bfdf0c8396097342006bb0d4f314b03 100644
--- a/cc/scheduler/scheduler.cc
+++ b/cc/scheduler/scheduler.cc
@@ -186,6 +186,10 @@ void Scheduler::SetMaxSwapsPending(int max) {
void Scheduler::DidSwapBuffers() {
state_machine_.DidSwapBuffers();
+
+ // Swap should not occur by readback operation.
Sami 2014/05/01 10:21:44 s/by/inside/?
simonhong 2014/05/08 01:14:57 Done.
+ DCHECK(!IsInsideAction(SchedulerStateMachine::ACTION_DRAW_AND_READBACK));
+
// There is no need to call ProcessScheduledActions here because
// swapping should not trigger any new actions.
if (!inside_process_scheduled_actions_) {
@@ -594,9 +598,8 @@ bool Scheduler::IsBeginMainFrameSent() const {
}
void Scheduler::DrawAndSwapIfPossible() {
- DrawSwapReadbackResult result =
- client_->ScheduledActionDrawAndSwapIfPossible();
- state_machine_.DidDrawIfPossibleCompleted(result.draw_result);
+ DrawResult result = client_->ScheduledActionDrawAndSwapIfPossible();
+ state_machine_.DidDrawIfPossibleCompleted(result);
}
void Scheduler::DrawAndSwapForced() {
Sami 2014/05/01 10:21:44 Looks like this and the next function could be rem
simonhong 2014/05/08 01:14:57 Yep. Both are removed.
@@ -604,8 +607,7 @@ void Scheduler::DrawAndSwapForced() {
}
void Scheduler::DrawAndReadback() {
- DrawSwapReadbackResult result = client_->ScheduledActionDrawAndReadback();
- DCHECK(!result.did_request_swap);
+ client_->ScheduledActionDrawAndReadback();
}
void Scheduler::ProcessScheduledActions() {

Powered by Google App Engine
This is Rietveld 408576698