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 | |
488 if (skip_begin_main_frame_to_reduce_latency_) | 483 if (skip_begin_main_frame_to_reduce_latency_) |
489 return false; | 484 return false; |
490 | 485 |
491 return true; | 486 return true; |
492 } | 487 } |
493 | 488 |
494 bool SchedulerStateMachine::ShouldCommit() const { | 489 bool SchedulerStateMachine::ShouldCommit() const { |
495 if (commit_state_ != COMMIT_STATE_READY_TO_COMMIT) | 490 if (commit_state_ != COMMIT_STATE_READY_TO_COMMIT) |
496 return false; | 491 return false; |
497 | 492 |
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1184 case OUTPUT_SURFACE_ACTIVE: | 1179 case OUTPUT_SURFACE_ACTIVE: |
1185 case OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT: | 1180 case OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT: |
1186 case OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION: | 1181 case OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION: |
1187 return true; | 1182 return true; |
1188 } | 1183 } |
1189 NOTREACHED(); | 1184 NOTREACHED(); |
1190 return false; | 1185 return false; |
1191 } | 1186 } |
1192 | 1187 |
1193 } // namespace cc | 1188 } // namespace cc |
OLD | NEW |