| 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.h" | 5 #include "cc/scheduler/scheduler.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 | 10 |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 return last_begin_frame_args_.frame_time; | 125 return last_begin_frame_args_.frame_time; |
| 126 } | 126 } |
| 127 | 127 |
| 128 void Scheduler::SetupNextBeginFrameIfNeeded() { | 128 void Scheduler::SetupNextBeginFrameIfNeeded() { |
| 129 bool needs_begin_frame_to_draw = | 129 bool needs_begin_frame_to_draw = |
| 130 state_machine_.BeginFrameNeededToDrawByImplThread(); | 130 state_machine_.BeginFrameNeededToDrawByImplThread(); |
| 131 // We want to avoid proactive begin frames with the synchronous compositor | 131 // We want to avoid proactive begin frames with the synchronous compositor |
| 132 // because every SetNeedsBeginFrame will force a redraw. | 132 // because every SetNeedsBeginFrame will force a redraw. |
| 133 bool proactive_begin_frame_wanted = | 133 bool proactive_begin_frame_wanted = |
| 134 state_machine_.ProactiveBeginFrameWantedByImplThread() && | 134 state_machine_.ProactiveBeginFrameWantedByImplThread() && |
| 135 !settings_.using_synchronous_renderer_compositor; | 135 !settings_.using_synchronous_renderer_compositor && |
| 136 settings_.throttle_frame_production; |
| 136 bool needs_begin_frame = needs_begin_frame_to_draw || | 137 bool needs_begin_frame = needs_begin_frame_to_draw || |
| 137 proactive_begin_frame_wanted; | 138 proactive_begin_frame_wanted; |
| 138 bool immediate_disables_needed = | 139 bool immediate_disables_needed = |
| 139 settings_.using_synchronous_renderer_compositor; | 140 settings_.using_synchronous_renderer_compositor; |
| 140 | 141 |
| 141 if (needs_begin_frame_to_draw) | 142 if (needs_begin_frame_to_draw) |
| 142 safe_to_expect_begin_frame_ = true; | 143 safe_to_expect_begin_frame_ = true; |
| 143 | 144 |
| 144 // Determine if we need BeginFrame notifications. | 145 // Determine if we need BeginFrame notifications. |
| 145 // If we do, always request the BeginFrame immediately. | 146 // If we do, always request the BeginFrame immediately. |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 | 235 |
| 235 SetupNextBeginFrameIfNeeded(); | 236 SetupNextBeginFrameIfNeeded(); |
| 236 client_->DidAnticipatedDrawTimeChange(AnticipatedDrawTime()); | 237 client_->DidAnticipatedDrawTimeChange(AnticipatedDrawTime()); |
| 237 } | 238 } |
| 238 | 239 |
| 239 bool Scheduler::WillDrawIfNeeded() const { | 240 bool Scheduler::WillDrawIfNeeded() const { |
| 240 return !state_machine_.DrawSuspendedUntilCommit(); | 241 return !state_machine_.DrawSuspendedUntilCommit(); |
| 241 } | 242 } |
| 242 | 243 |
| 243 } // namespace cc | 244 } // namespace cc |
| OLD | NEW |