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/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
| 9 | 9 |
| 10 namespace cc { | 10 namespace cc { |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 325 } | 325 } |
| 326 } | 326 } |
| 327 | 327 |
| 328 void SchedulerStateMachine::SetMainThreadNeedsLayerTextures() { | 328 void SchedulerStateMachine::SetMainThreadNeedsLayerTextures() { |
| 329 DCHECK(!main_thread_needs_layer_textures_); | 329 DCHECK(!main_thread_needs_layer_textures_); |
| 330 DCHECK_NE(texture_state_, LAYER_TEXTURE_STATE_ACQUIRED_BY_MAIN_THREAD); | 330 DCHECK_NE(texture_state_, LAYER_TEXTURE_STATE_ACQUIRED_BY_MAIN_THREAD); |
| 331 main_thread_needs_layer_textures_ = true; | 331 main_thread_needs_layer_textures_ = true; |
| 332 } | 332 } |
| 333 | 333 |
| 334 bool SchedulerStateMachine::BeginFrameNeededByImplThread() const { | 334 bool SchedulerStateMachine::BeginFrameNeededByImplThread() const { |
| 335 // We should proactively request a BeginFrame if a commit is pending. | |
|
brianderson
2013/06/01 04:30:29
I would get hangs without this.
| |
| 336 if (commit_state_ != COMMIT_STATE_IDLE) | |
| 337 return true; | |
| 338 | |
| 335 // If we have a pending tree, need to keep getting notifications until | 339 // If we have a pending tree, need to keep getting notifications until |
| 336 // the tree is ready to be swapped. | 340 // the tree is ready to be swapped. |
| 337 if (has_pending_tree_) | 341 if (has_pending_tree_) |
| 338 return true; | 342 return true; |
| 339 | 343 |
| 340 // If we can't draw, don't tick until we are notified that we can draw again. | 344 // If we can't draw, don't tick until we are notified that we can draw again. |
| 341 if (!can_draw_) | 345 if (!can_draw_) |
| 342 return false; | 346 return false; |
| 343 | 347 |
| 344 if (needs_forced_redraw_) | 348 if (needs_forced_redraw_) |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 448 bool SchedulerStateMachine::HasInitializedOutputSurface() const { | 452 bool SchedulerStateMachine::HasInitializedOutputSurface() const { |
| 449 return output_surface_state_ == OUTPUT_SURFACE_ACTIVE; | 453 return output_surface_state_ == OUTPUT_SURFACE_ACTIVE; |
| 450 } | 454 } |
| 451 | 455 |
| 452 void SchedulerStateMachine::SetMaximumNumberOfFailedDrawsBeforeDrawIsForced( | 456 void SchedulerStateMachine::SetMaximumNumberOfFailedDrawsBeforeDrawIsForced( |
| 453 int num_draws) { | 457 int num_draws) { |
| 454 maximum_number_of_failed_draws_before_draw_is_forced_ = num_draws; | 458 maximum_number_of_failed_draws_before_draw_is_forced_ = num_draws; |
| 455 } | 459 } |
| 456 | 460 |
| 457 } // namespace cc | 461 } // namespace cc |
| OLD | NEW |