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

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

Issue 17587014: cc: Fix infinite BeginFrame that Scheduler causes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch to land Created 7 years, 6 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
« no previous file with comments | « cc/scheduler/scheduler_settings.cc ('k') | cc/trees/thread_proxy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_state_machine.h" 5 #include "cc/scheduler/scheduler_state_machine.h"
6 6
7 #include "base/format_macros.h" 7 #include "base/format_macros.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 10
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 return true; 357 return true;
358 358
359 if (visible_ && swap_used_incomplete_tile_) 359 if (visible_ && swap_used_incomplete_tile_)
360 return true; 360 return true;
361 361
362 return needs_redraw_ && visible_ && 362 return needs_redraw_ && visible_ &&
363 output_surface_state_ == OUTPUT_SURFACE_ACTIVE; 363 output_surface_state_ == OUTPUT_SURFACE_ACTIVE;
364 } 364 }
365 365
366 bool SchedulerStateMachine::ProactiveBeginFrameWantedByImplThread() const { 366 bool SchedulerStateMachine::ProactiveBeginFrameWantedByImplThread() const {
367 // Do not be proactive when invisible.
368 if (!visible_ || output_surface_state_ != OUTPUT_SURFACE_ACTIVE)
369 return false;
370
367 // We should proactively request a BeginFrame if a commit is pending. 371 // We should proactively request a BeginFrame if a commit is pending.
368 if (needs_commit_ || needs_forced_commit_ || 372 return (needs_commit_ || needs_forced_commit_ ||
369 commit_state_ != COMMIT_STATE_IDLE) 373 commit_state_ != COMMIT_STATE_IDLE);
370 return true;
371
372 return false;
373 } 374 }
374 375
375 void SchedulerStateMachine::DidEnterBeginFrame(const BeginFrameArgs& args) { 376 void SchedulerStateMachine::DidEnterBeginFrame(const BeginFrameArgs& args) {
376 inside_begin_frame_ = true; 377 inside_begin_frame_ = true;
377 last_begin_frame_args_ = args; 378 last_begin_frame_args_ = args;
378 } 379 }
379 380
380 void SchedulerStateMachine::DidLeaveBeginFrame() { 381 void SchedulerStateMachine::DidLeaveBeginFrame() {
381 current_frame_number_++; 382 current_frame_number_++;
382 inside_begin_frame_ = false; 383 inside_begin_frame_ = false;
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 bool SchedulerStateMachine::HasInitializedOutputSurface() const { 471 bool SchedulerStateMachine::HasInitializedOutputSurface() const {
471 return output_surface_state_ == OUTPUT_SURFACE_ACTIVE; 472 return output_surface_state_ == OUTPUT_SURFACE_ACTIVE;
472 } 473 }
473 474
474 void SchedulerStateMachine::SetMaximumNumberOfFailedDrawsBeforeDrawIsForced( 475 void SchedulerStateMachine::SetMaximumNumberOfFailedDrawsBeforeDrawIsForced(
475 int num_draws) { 476 int num_draws) {
476 maximum_number_of_failed_draws_before_draw_is_forced_ = num_draws; 477 maximum_number_of_failed_draws_before_draw_is_forced_ = num_draws;
477 } 478 }
478 479
479 } // namespace cc 480 } // namespace cc
OLDNEW
« no previous file with comments | « cc/scheduler/scheduler_settings.cc ('k') | cc/trees/thread_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698