OLD | NEW |
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 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 void SchedulerStateMachine::OnBeginFrame(const BeginFrameArgs& args) { | 455 void SchedulerStateMachine::OnBeginFrame(const BeginFrameArgs& args) { |
456 begin_frame_count_++; | 456 begin_frame_count_++; |
457 draw_attempt_count_++; | 457 draw_attempt_count_++; |
458 last_begin_frame_args_ = args; | 458 last_begin_frame_args_ = args; |
459 begin_frame_state_ = BEGIN_FRAME_STATE_INSIDE_BEGIN_FRAME; | 459 begin_frame_state_ = BEGIN_FRAME_STATE_INSIDE_BEGIN_FRAME; |
460 } | 460 } |
461 | 461 |
462 bool SchedulerStateMachine::ShouldTriggerBeginFrameDeadlineEarly() const { | 462 bool SchedulerStateMachine::ShouldTriggerBeginFrameDeadlineEarly() const { |
463 // TODO(brianderson): This should take into account multiple commit sources. | 463 // TODO(brianderson): This should take into account multiple commit sources. |
464 return begin_frame_state_ == BEGIN_FRAME_STATE_DEADLINE_PENDING && | 464 return begin_frame_state_ == BEGIN_FRAME_STATE_DEADLINE_PENDING && |
465 WillDrawNewTree(); | 465 WillDrawNewTree() && !settings_.using_synchronous_renderer_compositor; |
466 } | 466 } |
467 | 467 |
468 bool SchedulerStateMachine::InsideBeginFrame() const { | 468 bool SchedulerStateMachine::InsideBeginFrame() const { |
469 return begin_frame_state_ != BEGIN_FRAME_STATE_IDLE; | 469 return begin_frame_state_ != BEGIN_FRAME_STATE_IDLE; |
470 } | 470 } |
471 | 471 |
472 bool SchedulerStateMachine::WillDrawNewTree() const { | 472 bool SchedulerStateMachine::WillDrawNewTree() const { |
473 if (settings_.impl_side_painting) | 473 if (settings_.impl_side_painting) |
474 return !active_tree_has_been_drawn_; | 474 return !active_tree_has_been_drawn_; |
475 else | 475 else |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 bool SchedulerStateMachine::HasInitializedOutputSurface() const { | 587 bool SchedulerStateMachine::HasInitializedOutputSurface() const { |
588 return output_surface_state_ == OUTPUT_SURFACE_ACTIVE; | 588 return output_surface_state_ == OUTPUT_SURFACE_ACTIVE; |
589 } | 589 } |
590 | 590 |
591 void SchedulerStateMachine::SetMaximumNumberOfFailedDrawsBeforeDrawIsForced( | 591 void SchedulerStateMachine::SetMaximumNumberOfFailedDrawsBeforeDrawIsForced( |
592 int num_draws) { | 592 int num_draws) { |
593 maximum_number_of_failed_draws_before_draw_is_forced_ = num_draws; | 593 maximum_number_of_failed_draws_before_draw_is_forced_ = num_draws; |
594 } | 594 } |
595 | 595 |
596 } // namespace cc | 596 } // namespace cc |
OLD | NEW |