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

Side by Side Diff: cc/scheduler/scheduler.cc

Issue 131683005: cc: Make PrepareToDraw return an enum for why it aborts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: DRAW_SUCCESS; assert CanDraw Created 6 years, 10 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 | Annotate | Revision Log
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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 TRACE_EVENT0("cc", "Scheduler::PollForAnticipatedDrawTriggers"); 293 TRACE_EVENT0("cc", "Scheduler::PollForAnticipatedDrawTriggers");
294 poll_for_draw_triggers_closure_.Cancel(); 294 poll_for_draw_triggers_closure_.Cancel();
295 state_machine_.DidEnterPollForAnticipatedDrawTriggers(); 295 state_machine_.DidEnterPollForAnticipatedDrawTriggers();
296 ProcessScheduledActions(); 296 ProcessScheduledActions();
297 state_machine_.DidLeavePollForAnticipatedDrawTriggers(); 297 state_machine_.DidLeavePollForAnticipatedDrawTriggers();
298 } 298 }
299 299
300 void Scheduler::DrawAndSwapIfPossible() { 300 void Scheduler::DrawAndSwapIfPossible() {
301 DrawSwapReadbackResult result = 301 DrawSwapReadbackResult result =
302 client_->ScheduledActionDrawAndSwapIfPossible(); 302 client_->ScheduledActionDrawAndSwapIfPossible();
303 state_machine_.DidDrawIfPossibleCompleted(result.did_draw); 303 state_machine_.DidDrawIfPossibleCompleted(result.draw_result);
304 } 304 }
305 305
306 void Scheduler::DrawAndSwapForced() { 306 void Scheduler::DrawAndSwapForced() {
307 client_->ScheduledActionDrawAndSwapForced(); 307 client_->ScheduledActionDrawAndSwapForced();
308 } 308 }
309 309
310 void Scheduler::DrawAndReadback() { 310 void Scheduler::DrawAndReadback() {
311 DrawSwapReadbackResult result = client_->ScheduledActionDrawAndReadback(); 311 DrawSwapReadbackResult result = client_->ScheduledActionDrawAndReadback();
312 DCHECK(!result.did_swap); 312 DCHECK(!result.did_swap);
313 } 313 }
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 // impl thread's deadline. 387 // impl thread's deadline.
388 base::TimeTicks estimated_draw_time = 388 base::TimeTicks estimated_draw_time =
389 last_begin_impl_frame_args_.frame_time + 389 last_begin_impl_frame_args_.frame_time +
390 client_->BeginMainFrameToCommitDurationEstimate() + 390 client_->BeginMainFrameToCommitDurationEstimate() +
391 client_->CommitToActivateDurationEstimate(); 391 client_->CommitToActivateDurationEstimate();
392 392
393 return estimated_draw_time < last_begin_impl_frame_args_.deadline; 393 return estimated_draw_time < last_begin_impl_frame_args_.deadline;
394 } 394 }
395 395
396 } // namespace cc 396 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698