| 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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 TRACE_EVENT0("cc", "Scheduler::PollForAnticipatedDrawTriggers"); | 293 TRACE_EVENT0("cc", "Scheduler::PollForAnticipatedDrawTriggers"); |
| 294 poll_for_draw_triggers_closure_.Cancel(); | 294 poll_for_draw_triggers_closure_.Cancel(); |
| 295 state_machine_.DidEnterPollForAnticipatedDrawTriggers(); | 295 state_machine_.DidEnterPollForAnticipatedDrawTriggers(); |
| 296 ProcessScheduledActions(); | 296 ProcessScheduledActions(); |
| 297 state_machine_.DidLeavePollForAnticipatedDrawTriggers(); | 297 state_machine_.DidLeavePollForAnticipatedDrawTriggers(); |
| 298 } | 298 } |
| 299 | 299 |
| 300 void Scheduler::DrawAndSwapIfPossible() { | 300 void Scheduler::DrawAndSwapIfPossible() { |
| 301 DrawSwapReadbackResult result = | 301 DrawSwapReadbackResult result = |
| 302 client_->ScheduledActionDrawAndSwapIfPossible(); | 302 client_->ScheduledActionDrawAndSwapIfPossible(); |
| 303 state_machine_.DidDrawIfPossibleCompleted(result.did_draw); | 303 state_machine_.DidDrawIfPossibleCompleted(result.draw_result); |
| 304 } | 304 } |
| 305 | 305 |
| 306 void Scheduler::DrawAndSwapForced() { | 306 void Scheduler::DrawAndSwapForced() { |
| 307 client_->ScheduledActionDrawAndSwapForced(); | 307 client_->ScheduledActionDrawAndSwapForced(); |
| 308 } | 308 } |
| 309 | 309 |
| 310 void Scheduler::DrawAndReadback() { | 310 void Scheduler::DrawAndReadback() { |
| 311 DrawSwapReadbackResult result = client_->ScheduledActionDrawAndReadback(); | 311 DrawSwapReadbackResult result = client_->ScheduledActionDrawAndReadback(); |
| 312 DCHECK(!result.did_swap); | 312 DCHECK(!result.did_swap); |
| 313 } | 313 } |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 // impl thread's deadline. | 387 // impl thread's deadline. |
| 388 base::TimeTicks estimated_draw_time = | 388 base::TimeTicks estimated_draw_time = |
| 389 last_begin_impl_frame_args_.frame_time + | 389 last_begin_impl_frame_args_.frame_time + |
| 390 client_->BeginMainFrameToCommitDurationEstimate() + | 390 client_->BeginMainFrameToCommitDurationEstimate() + |
| 391 client_->CommitToActivateDurationEstimate(); | 391 client_->CommitToActivateDurationEstimate(); |
| 392 | 392 |
| 393 return estimated_draw_time < last_begin_impl_frame_args_.deadline; | 393 return estimated_draw_time < last_begin_impl_frame_args_.deadline; |
| 394 } | 394 } |
| 395 | 395 |
| 396 } // namespace cc | 396 } // namespace cc |
| OLD | NEW |