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/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 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 418 // single commit per interval because the result will be swapped to screen. | 418 // single commit per interval because the result will be swapped to screen. |
| 419 if (forced_redraw_state_ == FORCED_REDRAW_STATE_WAITING_FOR_COMMIT) | 419 if (forced_redraw_state_ == FORCED_REDRAW_STATE_WAITING_FOR_COMMIT) |
| 420 return true; | 420 return true; |
| 421 | 421 |
| 422 // We shouldn't normally accept commits if there isn't an OutputSurface. | 422 // We shouldn't normally accept commits if there isn't an OutputSurface. |
| 423 if (!HasInitializedOutputSurface()) | 423 if (!HasInitializedOutputSurface()) |
| 424 return false; | 424 return false; |
| 425 | 425 |
| 426 // SwapAck throttle the BeginMainFrames unless we just swapped. | 426 // SwapAck throttle the BeginMainFrames unless we just swapped. |
| 427 // TODO(brianderson): Remove this restriction to improve throughput. | 427 // TODO(brianderson): Remove this restriction to improve throughput. |
| 428 #if !defined(ARCH_CPU_ARM_FAMILY) | |
|
danakj
2015/04/06 16:32:51
This should be a LayerTreeSetting->SchedulerSettin
brianderson
2015/04/07 03:15:38
Let's just enable this on all platforms and see if
| |
| 428 bool just_swapped_in_deadline = | 429 bool just_swapped_in_deadline = |
| 429 begin_impl_frame_state_ == BEGIN_IMPL_FRAME_STATE_INSIDE_DEADLINE && | 430 begin_impl_frame_state_ == BEGIN_IMPL_FRAME_STATE_INSIDE_DEADLINE && |
| 430 perform_swap_funnel_; | 431 perform_swap_funnel_; |
| 431 if (pending_swaps_ >= max_pending_swaps_ && !just_swapped_in_deadline) | 432 if (pending_swaps_ >= max_pending_swaps_ && !just_swapped_in_deadline) |
| 432 return false; | 433 return false; |
| 434 #endif | |
| 433 | 435 |
| 434 if (skip_begin_main_frame_to_reduce_latency_) | 436 if (skip_begin_main_frame_to_reduce_latency_) |
| 435 return false; | 437 return false; |
| 436 | 438 |
| 437 return true; | 439 return true; |
| 438 } | 440 } |
| 439 | 441 |
| 440 bool SchedulerStateMachine::ShouldCommit() const { | 442 bool SchedulerStateMachine::ShouldCommit() const { |
| 441 if (commit_state_ != COMMIT_STATE_READY_TO_COMMIT) | 443 if (commit_state_ != COMMIT_STATE_READY_TO_COMMIT) |
| 442 return false; | 444 return false; |
| (...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1080 static_cast<int>(begin_impl_frame_state_), | 1082 static_cast<int>(begin_impl_frame_state_), |
| 1081 static_cast<int>(commit_state_), | 1083 static_cast<int>(commit_state_), |
| 1082 has_pending_tree_ ? 'T' : 'F', | 1084 has_pending_tree_ ? 'T' : 'F', |
| 1083 pending_tree_is_ready_for_activation_ ? 'T' : 'F', | 1085 pending_tree_is_ready_for_activation_ ? 'T' : 'F', |
| 1084 active_tree_needs_first_draw_ ? 'T' : 'F', | 1086 active_tree_needs_first_draw_ ? 'T' : 'F', |
| 1085 max_pending_swaps_, | 1087 max_pending_swaps_, |
| 1086 pending_swaps_); | 1088 pending_swaps_); |
| 1087 } | 1089 } |
| 1088 | 1090 |
| 1089 } // namespace cc | 1091 } // namespace cc |
| OLD | NEW |