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 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 state_machine_ | 448 state_machine_ |
449 .last_begin_frame_sequence_number_compositor_frame_was_fresh(); | 449 .last_begin_frame_sequence_number_compositor_frame_was_fresh(); |
450 } | 450 } |
451 | 451 |
452 bool did_submit = false; | 452 bool did_submit = false; |
453 if (result == kBeginFrameFinished) { | 453 if (result == kBeginFrameFinished) { |
454 did_submit = state_machine_.did_submit_in_last_frame(); | 454 did_submit = state_machine_.did_submit_in_last_frame(); |
455 } | 455 } |
456 | 456 |
457 BeginFrameAck ack(args.source_id, args.sequence_number, | 457 BeginFrameAck ack(args.source_id, args.sequence_number, |
458 latest_confirmed_sequence_number, 0, did_submit); | 458 latest_confirmed_sequence_number, did_submit); |
459 begin_frame_source_->DidFinishFrame(this, ack); | 459 begin_frame_source_->DidFinishFrame(this, ack); |
460 } | 460 } |
461 | 461 |
462 // BeginImplFrame starts a compositor frame that will wait up until a deadline | 462 // BeginImplFrame starts a compositor frame that will wait up until a deadline |
463 // for a BeginMainFrame+activation to complete before it times out and draws | 463 // for a BeginMainFrame+activation to complete before it times out and draws |
464 // any asynchronous animation and scroll/pinch updates. | 464 // any asynchronous animation and scroll/pinch updates. |
465 void Scheduler::BeginImplFrame(const BeginFrameArgs& args, | 465 void Scheduler::BeginImplFrame(const BeginFrameArgs& args, |
466 base::TimeTicks now) { | 466 base::TimeTicks now) { |
467 DCHECK_EQ(state_machine_.begin_impl_frame_state(), | 467 DCHECK_EQ(state_machine_.begin_impl_frame_state(), |
468 SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_IDLE); | 468 SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_IDLE); |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 return (state_machine_.begin_main_frame_state() == | 795 return (state_machine_.begin_main_frame_state() == |
796 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_SENT || | 796 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_SENT || |
797 state_machine_.begin_main_frame_state() == | 797 state_machine_.begin_main_frame_state() == |
798 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_STARTED); | 798 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_STARTED); |
799 } | 799 } |
800 | 800 |
801 BeginFrameAck Scheduler::CurrentBeginFrameAckForActiveTree() const { | 801 BeginFrameAck Scheduler::CurrentBeginFrameAckForActiveTree() const { |
802 return BeginFrameAck( | 802 return BeginFrameAck( |
803 begin_main_frame_args_.source_id, begin_main_frame_args_.sequence_number, | 803 begin_main_frame_args_.source_id, begin_main_frame_args_.sequence_number, |
804 state_machine_.last_begin_frame_sequence_number_active_tree_was_fresh(), | 804 state_machine_.last_begin_frame_sequence_number_active_tree_was_fresh(), |
805 0, true); | 805 true); |
806 } | 806 } |
807 | 807 |
808 } // namespace cc | 808 } // namespace cc |
OLD | NEW |