Chromium Code Reviews| 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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 // We should proactively request a BeginFrame if a commit is pending. | 367 // We should proactively request a BeginFrame if a commit is pending. |
| 368 if (needs_commit_ || needs_forced_commit_ || | 368 // However, it is not needed to be proactive inside a BeginFrame |
| 369 commit_state_ != COMMIT_STATE_IDLE) | 369 // because a commit is performed now. |
| 370 return true; | 370 return (needs_commit_ || needs_forced_commit_ || |
| 371 | 371 commit_state_ != COMMIT_STATE_IDLE) && |
| 372 return false; | 372 !inside_begin_frame_; |
|
brianderson
2013/06/24 20:12:31
Can you see if this works instead? I would test it
| |
| 373 } | 373 } |
| 374 | 374 |
| 375 void SchedulerStateMachine::DidEnterBeginFrame(const BeginFrameArgs& args) { | 375 void SchedulerStateMachine::DidEnterBeginFrame(const BeginFrameArgs& args) { |
| 376 inside_begin_frame_ = true; | 376 inside_begin_frame_ = true; |
| 377 last_begin_frame_args_ = args; | 377 last_begin_frame_args_ = args; |
| 378 } | 378 } |
| 379 | 379 |
| 380 void SchedulerStateMachine::DidLeaveBeginFrame() { | 380 void SchedulerStateMachine::DidLeaveBeginFrame() { |
| 381 current_frame_number_++; | 381 current_frame_number_++; |
| 382 inside_begin_frame_ = false; | 382 inside_begin_frame_ = false; |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 470 bool SchedulerStateMachine::HasInitializedOutputSurface() const { | 470 bool SchedulerStateMachine::HasInitializedOutputSurface() const { |
| 471 return output_surface_state_ == OUTPUT_SURFACE_ACTIVE; | 471 return output_surface_state_ == OUTPUT_SURFACE_ACTIVE; |
| 472 } | 472 } |
| 473 | 473 |
| 474 void SchedulerStateMachine::SetMaximumNumberOfFailedDrawsBeforeDrawIsForced( | 474 void SchedulerStateMachine::SetMaximumNumberOfFailedDrawsBeforeDrawIsForced( |
| 475 int num_draws) { | 475 int num_draws) { |
| 476 maximum_number_of_failed_draws_before_draw_is_forced_ = num_draws; | 476 maximum_number_of_failed_draws_before_draw_is_forced_ = num_draws; |
| 477 } | 477 } |
| 478 | 478 |
| 479 } // namespace cc | 479 } // namespace cc |
| OLD | NEW |