| 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 <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 void SetSwapWillHappenIfDrawHappens(bool swap_will_happen_if_draw_happens) { | 98 void SetSwapWillHappenIfDrawHappens(bool swap_will_happen_if_draw_happens) { |
| 99 swap_will_happen_if_draw_happens_ = swap_will_happen_if_draw_happens; | 99 swap_will_happen_if_draw_happens_ = swap_will_happen_if_draw_happens; |
| 100 } | 100 } |
| 101 void SetAutomaticSwapAck(bool automatic_swap_ack) { | 101 void SetAutomaticSwapAck(bool automatic_swap_ack) { |
| 102 automatic_swap_ack_ = automatic_swap_ack; | 102 automatic_swap_ack_ = automatic_swap_ack; |
| 103 } | 103 } |
| 104 // SchedulerClient implementation. | 104 // SchedulerClient implementation. |
| 105 void WillBeginImplFrame(const BeginFrameArgs& args) override { | 105 void WillBeginImplFrame(const BeginFrameArgs& args) override { |
| 106 PushAction("WillBeginImplFrame"); | 106 PushAction("WillBeginImplFrame"); |
| 107 } | 107 } |
| 108 void DidFinishImplFrame() override {} | |
| 109 | |
| 110 void ScheduledActionSendBeginMainFrame() override { | 108 void ScheduledActionSendBeginMainFrame() override { |
| 111 PushAction("ScheduledActionSendBeginMainFrame"); | 109 PushAction("ScheduledActionSendBeginMainFrame"); |
| 112 } | 110 } |
| 113 void ScheduledActionAnimate() override { | 111 void ScheduledActionAnimate() override { |
| 114 PushAction("ScheduledActionAnimate"); | 112 PushAction("ScheduledActionAnimate"); |
| 115 } | 113 } |
| 116 DrawResult ScheduledActionDrawAndSwapIfPossible() override { | 114 DrawResult ScheduledActionDrawAndSwapIfPossible() override { |
| 117 PushAction("ScheduledActionDrawAndSwapIfPossible"); | 115 PushAction("ScheduledActionDrawAndSwapIfPossible"); |
| 118 num_draws_++; | 116 num_draws_++; |
| 119 DrawResult result = | 117 DrawResult result = |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 PushAction("DidAnticipatedDrawTimeChange"); | 149 PushAction("DidAnticipatedDrawTimeChange"); |
| 152 } | 150 } |
| 153 base::TimeDelta DrawDurationEstimate() override { return base::TimeDelta(); } | 151 base::TimeDelta DrawDurationEstimate() override { return base::TimeDelta(); } |
| 154 base::TimeDelta BeginMainFrameToCommitDurationEstimate() override { | 152 base::TimeDelta BeginMainFrameToCommitDurationEstimate() override { |
| 155 return base::TimeDelta(); | 153 return base::TimeDelta(); |
| 156 } | 154 } |
| 157 base::TimeDelta CommitToActivateDurationEstimate() override { | 155 base::TimeDelta CommitToActivateDurationEstimate() override { |
| 158 return base::TimeDelta(); | 156 return base::TimeDelta(); |
| 159 } | 157 } |
| 160 | 158 |
| 159 void DidBeginImplFrameDeadline() override {} |
| 160 |
| 161 void SendBeginFramesToChildren(const BeginFrameArgs& args) override { | 161 void SendBeginFramesToChildren(const BeginFrameArgs& args) override { |
| 162 begin_frame_args_sent_to_children_ = args; | 162 begin_frame_args_sent_to_children_ = args; |
| 163 } | 163 } |
| 164 | 164 |
| 165 void SendBeginMainFrameNotExpectedSoon() override { | 165 void SendBeginMainFrameNotExpectedSoon() override { |
| 166 PushAction("SendBeginMainFrameNotExpectedSoon"); | 166 PushAction("SendBeginMainFrameNotExpectedSoon"); |
| 167 } | 167 } |
| 168 | 168 |
| 169 base::Callback<bool(void)> ImplFrameDeadlinePending(bool state) { | 169 base::Callback<bool(void)> ImplFrameDeadlinePending(bool state) { |
| 170 return base::Bind(&FakeSchedulerClient::ImplFrameDeadlinePendingCallback, | 170 return base::Bind(&FakeSchedulerClient::ImplFrameDeadlinePendingCallback, |
| (...skipping 2468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2639 | 2639 |
| 2640 // At the next BeginFrame, authoritative interval is used instead of previous | 2640 // At the next BeginFrame, authoritative interval is used instead of previous |
| 2641 // interval. | 2641 // interval. |
| 2642 EXPECT_NE(initial_interval, scheduler_->begin_impl_frame_args().interval); | 2642 EXPECT_NE(initial_interval, scheduler_->begin_impl_frame_args().interval); |
| 2643 EXPECT_EQ(authoritative_interval, | 2643 EXPECT_EQ(authoritative_interval, |
| 2644 scheduler_->begin_impl_frame_args().interval); | 2644 scheduler_->begin_impl_frame_args().interval); |
| 2645 } | 2645 } |
| 2646 | 2646 |
| 2647 } // namespace | 2647 } // namespace |
| 2648 } // namespace cc | 2648 } // namespace cc |
| OLD | NEW |