| 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/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "base/format_macros.h" | 8 #include "base/format_macros.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 // After this point, we only start a commit once per frame. | 459 // After this point, we only start a commit once per frame. |
| 460 if (HasSentBeginMainFrameThisFrame()) | 460 if (HasSentBeginMainFrameThisFrame()) |
| 461 return false; | 461 return false; |
| 462 | 462 |
| 463 // We shouldn't normally accept commits if there isn't an OutputSurface. | 463 // We shouldn't normally accept commits if there isn't an OutputSurface. |
| 464 if (!HasInitializedOutputSurface()) | 464 if (!HasInitializedOutputSurface()) |
| 465 return false; | 465 return false; |
| 466 | 466 |
| 467 // SwapAck throttle the BeginMainFrames | 467 // SwapAck throttle the BeginMainFrames |
| 468 // TODO(brianderson): Remove this restriction to improve throughput. | 468 // TODO(brianderson): Remove this restriction to improve throughput. |
| 469 if (pending_swaps_ >= max_pending_swaps_) | 469 if (pending_swaps_ >= max_pending_swaps_ && |
| 470 begin_impl_frame_state_ != BEGIN_IMPL_FRAME_STATE_INSIDE_DEADLINE) |
| 470 return false; | 471 return false; |
| 471 | 472 |
| 472 if (skip_begin_main_frame_to_reduce_latency_) | 473 if (skip_begin_main_frame_to_reduce_latency_) |
| 473 return false; | 474 return false; |
| 474 | 475 |
| 475 return true; | 476 return true; |
| 476 } | 477 } |
| 477 | 478 |
| 478 bool SchedulerStateMachine::ShouldCommit() const { | 479 bool SchedulerStateMachine::ShouldCommit() const { |
| 479 if (commit_state_ != COMMIT_STATE_READY_TO_COMMIT) | 480 if (commit_state_ != COMMIT_STATE_READY_TO_COMMIT) |
| (...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1067 case OUTPUT_SURFACE_ACTIVE: | 1068 case OUTPUT_SURFACE_ACTIVE: |
| 1068 case OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT: | 1069 case OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT: |
| 1069 case OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION: | 1070 case OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION: |
| 1070 return true; | 1071 return true; |
| 1071 } | 1072 } |
| 1072 NOTREACHED(); | 1073 NOTREACHED(); |
| 1073 return false; | 1074 return false; |
| 1074 } | 1075 } |
| 1075 | 1076 |
| 1076 } // namespace cc | 1077 } // namespace cc |
| OLD | NEW |