| 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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 | 323 |
| 324 case ACTION_BEGIN_OUTPUT_SURFACE_CREATION: | 324 case ACTION_BEGIN_OUTPUT_SURFACE_CREATION: |
| 325 DCHECK_EQ(commit_state_, COMMIT_STATE_IDLE); | 325 DCHECK_EQ(commit_state_, COMMIT_STATE_IDLE); |
| 326 DCHECK_EQ(output_surface_state_, OUTPUT_SURFACE_LOST); | 326 DCHECK_EQ(output_surface_state_, OUTPUT_SURFACE_LOST); |
| 327 output_surface_state_ = OUTPUT_SURFACE_CREATING; | 327 output_surface_state_ = OUTPUT_SURFACE_CREATING; |
| 328 return; | 328 return; |
| 329 | 329 |
| 330 case ACTION_ACQUIRE_LAYER_TEXTURES_FOR_MAIN_THREAD: | 330 case ACTION_ACQUIRE_LAYER_TEXTURES_FOR_MAIN_THREAD: |
| 331 texture_state_ = LAYER_TEXTURE_STATE_ACQUIRED_BY_MAIN_THREAD; | 331 texture_state_ = LAYER_TEXTURE_STATE_ACQUIRED_BY_MAIN_THREAD; |
| 332 main_thread_needs_layer_textures_ = false; | 332 main_thread_needs_layer_textures_ = false; |
| 333 if (commit_state_ != COMMIT_STATE_FRAME_IN_PROGRESS) | |
| 334 needs_commit_ = true; | |
| 335 return; | 333 return; |
| 336 } | 334 } |
| 337 } | 335 } |
| 338 | 336 |
| 339 void SchedulerStateMachine::SetMainThreadNeedsLayerTextures() { | 337 void SchedulerStateMachine::SetMainThreadNeedsLayerTextures() { |
| 340 DCHECK(!main_thread_needs_layer_textures_); | 338 DCHECK(!main_thread_needs_layer_textures_); |
| 341 DCHECK_NE(texture_state_, LAYER_TEXTURE_STATE_ACQUIRED_BY_MAIN_THREAD); | 339 DCHECK_NE(texture_state_, LAYER_TEXTURE_STATE_ACQUIRED_BY_MAIN_THREAD); |
| 342 main_thread_needs_layer_textures_ = true; | 340 main_thread_needs_layer_textures_ = true; |
| 343 } | 341 } |
| 344 | 342 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 bool SchedulerStateMachine::HasInitializedOutputSurface() const { | 464 bool SchedulerStateMachine::HasInitializedOutputSurface() const { |
| 467 return output_surface_state_ == OUTPUT_SURFACE_ACTIVE; | 465 return output_surface_state_ == OUTPUT_SURFACE_ACTIVE; |
| 468 } | 466 } |
| 469 | 467 |
| 470 void SchedulerStateMachine::SetMaximumNumberOfFailedDrawsBeforeDrawIsForced( | 468 void SchedulerStateMachine::SetMaximumNumberOfFailedDrawsBeforeDrawIsForced( |
| 471 int num_draws) { | 469 int num_draws) { |
| 472 maximum_number_of_failed_draws_before_draw_is_forced_ = num_draws; | 470 maximum_number_of_failed_draws_before_draw_is_forced_ = num_draws; |
| 473 } | 471 } |
| 474 | 472 |
| 475 } // namespace cc | 473 } // namespace cc |
| OLD | NEW |