| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include "base/auto_reset.h" | 8 #include "base/auto_reset.h" |
| 9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 | 150 |
| 151 if (should_call_set_needs_begin_frame) { | 151 if (should_call_set_needs_begin_frame) { |
| 152 client_->SetNeedsBeginFrameOnImplThread(needs_begin_frame); | 152 client_->SetNeedsBeginFrameOnImplThread(needs_begin_frame); |
| 153 last_set_needs_begin_frame_ = needs_begin_frame; | 153 last_set_needs_begin_frame_ = needs_begin_frame; |
| 154 } | 154 } |
| 155 | 155 |
| 156 // Setup PollForAnticipatedDrawTriggers if we need to monitor state but | 156 // Setup PollForAnticipatedDrawTriggers if we need to monitor state but |
| 157 // aren't expecting any more BeginFrames. This should only be needed by the | 157 // aren't expecting any more BeginFrames. This should only be needed by the |
| 158 // synchronous compositor when BeginFrameNeededByImplThread is false. | 158 // synchronous compositor when BeginFrameNeededByImplThread is false. |
| 159 if (state_machine_.ShouldPollForAnticipatedDrawTriggers()) { | 159 if (state_machine_.ShouldPollForAnticipatedDrawTriggers()) { |
| 160 DCHECK(settings_.using_synchronous_renderer_compositor); | 160 DCHECK(!state_machine_.SupportsProactiveBeginFrame()); |
| 161 DCHECK(!needs_begin_frame); | 161 DCHECK(!needs_begin_frame); |
| 162 if (poll_for_draw_triggers_closure_.IsCancelled()) { | 162 if (poll_for_draw_triggers_closure_.IsCancelled()) { |
| 163 poll_for_draw_triggers_closure_.Reset( | 163 poll_for_draw_triggers_closure_.Reset( |
| 164 base::Bind(&Scheduler::PollForAnticipatedDrawTriggers, | 164 base::Bind(&Scheduler::PollForAnticipatedDrawTriggers, |
| 165 weak_factory_.GetWeakPtr())); | 165 weak_factory_.GetWeakPtr())); |
| 166 base::MessageLoop::current()->PostDelayedTask( | 166 base::MessageLoop::current()->PostDelayedTask( |
| 167 FROM_HERE, | 167 FROM_HERE, |
| 168 poll_for_draw_triggers_closure_.callback(), | 168 poll_for_draw_triggers_closure_.callback(), |
| 169 last_begin_frame_args_.interval); | 169 last_begin_frame_args_.interval); |
| 170 } | 170 } |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 | 330 |
| 331 SetupNextBeginFrameIfNeeded(); | 331 SetupNextBeginFrameIfNeeded(); |
| 332 client_->DidAnticipatedDrawTimeChange(AnticipatedDrawTime()); | 332 client_->DidAnticipatedDrawTimeChange(AnticipatedDrawTime()); |
| 333 } | 333 } |
| 334 | 334 |
| 335 bool Scheduler::WillDrawIfNeeded() const { | 335 bool Scheduler::WillDrawIfNeeded() const { |
| 336 return !state_machine_.PendingDrawsShouldBeAborted(); | 336 return !state_machine_.PendingDrawsShouldBeAborted(); |
| 337 } | 337 } |
| 338 | 338 |
| 339 } // namespace cc | 339 } // namespace cc |
| OLD | NEW |