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 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 return true; | 473 return true; |
474 | 474 |
475 // After this point, we only start a commit once per frame. | 475 // After this point, we only start a commit once per frame. |
476 if (HasSentBeginMainFrameThisFrame()) | 476 if (HasSentBeginMainFrameThisFrame()) |
477 return false; | 477 return false; |
478 | 478 |
479 // We shouldn't normally accept commits if there isn't an OutputSurface. | 479 // We shouldn't normally accept commits if there isn't an OutputSurface. |
480 if (!HasInitializedOutputSurface()) | 480 if (!HasInitializedOutputSurface()) |
481 return false; | 481 return false; |
482 | 482 |
| 483 // SwapAck throttle the BeginMainFrames |
| 484 // TODO(brianderson): Remove this restriction to improve throughput. |
| 485 if (pending_swaps_ >= max_pending_swaps_) |
| 486 return false; |
| 487 |
483 if (skip_begin_main_frame_to_reduce_latency_) | 488 if (skip_begin_main_frame_to_reduce_latency_) |
484 return false; | 489 return false; |
485 | 490 |
486 return true; | 491 return true; |
487 } | 492 } |
488 | 493 |
489 bool SchedulerStateMachine::ShouldCommit() const { | 494 bool SchedulerStateMachine::ShouldCommit() const { |
490 if (commit_state_ != COMMIT_STATE_READY_TO_COMMIT) | 495 if (commit_state_ != COMMIT_STATE_READY_TO_COMMIT) |
491 return false; | 496 return false; |
492 | 497 |
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1179 case OUTPUT_SURFACE_ACTIVE: | 1184 case OUTPUT_SURFACE_ACTIVE: |
1180 case OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT: | 1185 case OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT: |
1181 case OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION: | 1186 case OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION: |
1182 return true; | 1187 return true; |
1183 } | 1188 } |
1184 NOTREACHED(); | 1189 NOTREACHED(); |
1185 return false; | 1190 return false; |
1186 } | 1191 } |
1187 | 1192 |
1188 } // namespace cc | 1193 } // namespace cc |
OLD | NEW |