| 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/debug/trace_event_argument.h" | 8 #include "base/debug/trace_event_argument.h" |
| 9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 696 | 696 |
| 697 if (did_request_swap) | 697 if (did_request_swap) |
| 698 last_frame_number_swap_requested_ = current_frame_number_; | 698 last_frame_number_swap_requested_ = current_frame_number_; |
| 699 } | 699 } |
| 700 | 700 |
| 701 void SchedulerStateMachine::UpdateStateOnManageTiles() { | 701 void SchedulerStateMachine::UpdateStateOnManageTiles() { |
| 702 needs_manage_tiles_ = false; | 702 needs_manage_tiles_ = false; |
| 703 } | 703 } |
| 704 | 704 |
| 705 void SchedulerStateMachine::SetSkipNextBeginMainFrameToReduceLatency() { | 705 void SchedulerStateMachine::SetSkipNextBeginMainFrameToReduceLatency() { |
| 706 TRACE_EVENT_INSTANT0("cc", |
| 707 "Scheduler: SkipNextBeginMainFrameToReduceLatency", |
| 708 TRACE_EVENT_SCOPE_THREAD); |
| 706 skip_next_begin_main_frame_to_reduce_latency_ = true; | 709 skip_next_begin_main_frame_to_reduce_latency_ = true; |
| 707 } | 710 } |
| 708 | 711 |
| 709 bool SchedulerStateMachine::BeginFrameNeeded() const { | 712 bool SchedulerStateMachine::BeginFrameNeeded() const { |
| 710 // Proactive BeginFrames are bad for the synchronous compositor because we | 713 // Proactive BeginFrames are bad for the synchronous compositor because we |
| 711 // have to draw when we get the BeginFrame and could end up drawing many | 714 // have to draw when we get the BeginFrame and could end up drawing many |
| 712 // duplicate frames if our new frame isn't ready in time. | 715 // duplicate frames if our new frame isn't ready in time. |
| 713 // To poll for state with the synchronous compositor without having to draw, | 716 // To poll for state with the synchronous compositor without having to draw, |
| 714 // we rely on ShouldPollForAnticipatedDrawTriggers instead. | 717 // we rely on ShouldPollForAnticipatedDrawTriggers instead. |
| 715 if (!SupportsProactiveBeginFrame()) | 718 if (!SupportsProactiveBeginFrame()) |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1094 static_cast<int>(begin_impl_frame_state_), | 1097 static_cast<int>(begin_impl_frame_state_), |
| 1095 static_cast<int>(commit_state_), | 1098 static_cast<int>(commit_state_), |
| 1096 has_pending_tree_ ? 'T' : 'F', | 1099 has_pending_tree_ ? 'T' : 'F', |
| 1097 pending_tree_is_ready_for_activation_ ? 'T' : 'F', | 1100 pending_tree_is_ready_for_activation_ ? 'T' : 'F', |
| 1098 active_tree_needs_first_draw_ ? 'T' : 'F', | 1101 active_tree_needs_first_draw_ ? 'T' : 'F', |
| 1099 max_pending_swaps_, | 1102 max_pending_swaps_, |
| 1100 pending_swaps_); | 1103 pending_swaps_); |
| 1101 } | 1104 } |
| 1102 | 1105 |
| 1103 } // namespace cc | 1106 } // namespace cc |
| OLD | NEW |