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/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 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 457 return true; | 457 return true; |
| 458 | 458 |
| 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 unless we just swapped. |
|
danakj
2014/06/11 23:08:57
This sounds like the opposite of what you have bel
brianderson
2014/06/11 23:25:49
I think the comment and logic do match, it's just
Sami
2014/06/13 10:39:12
The conceptual double negatives here make your hea
brianderson
2014/06/13 18:19:29
I've been trying to figure out why getting rid of
| |
| 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 bool just_swapped_in_deadline = |
| 470 begin_impl_frame_state_ == BEGIN_IMPL_FRAME_STATE_INSIDE_DEADLINE && | |
| 471 HasSwappedThisFrame(); | |
| 472 if (pending_swaps_ >= max_pending_swaps_ && !just_swapped_in_deadline) | |
| 470 return false; | 473 return false; |
| 471 | 474 |
| 472 if (skip_begin_main_frame_to_reduce_latency_) | 475 if (skip_begin_main_frame_to_reduce_latency_) |
| 473 return false; | 476 return false; |
| 474 | 477 |
| 475 return true; | 478 return true; |
| 476 } | 479 } |
| 477 | 480 |
| 478 bool SchedulerStateMachine::ShouldCommit() const { | 481 bool SchedulerStateMachine::ShouldCommit() const { |
| 479 if (commit_state_ != COMMIT_STATE_READY_TO_COMMIT) | 482 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: | 1070 case OUTPUT_SURFACE_ACTIVE: |
| 1068 case OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT: | 1071 case OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT: |
| 1069 case OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION: | 1072 case OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION: |
| 1070 return true; | 1073 return true; |
| 1071 } | 1074 } |
| 1072 NOTREACHED(); | 1075 NOTREACHED(); |
| 1073 return false; | 1076 return false; |
| 1074 } | 1077 } |
| 1075 | 1078 |
| 1076 } // namespace cc | 1079 } // namespace cc |
| OLD | NEW |