| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 // SchedulerClient implementation. | 105 // SchedulerClient implementation. |
| 106 void WillBeginImplFrame(const BeginFrameArgs& args) override { | 106 void WillBeginImplFrame(const BeginFrameArgs& args) override { |
| 107 PushAction("WillBeginImplFrame"); | 107 PushAction("WillBeginImplFrame"); |
| 108 } | 108 } |
| 109 void ScheduledActionSendBeginMainFrame() override { | 109 void ScheduledActionSendBeginMainFrame() override { |
| 110 PushAction("ScheduledActionSendBeginMainFrame"); | 110 PushAction("ScheduledActionSendBeginMainFrame"); |
| 111 } | 111 } |
| 112 void ScheduledActionAnimate() override { | 112 void ScheduledActionAnimate() override { |
| 113 PushAction("ScheduledActionAnimate"); | 113 PushAction("ScheduledActionAnimate"); |
| 114 } | 114 } |
| 115 void ScheduledActionCustomMutate() override {} |
| 115 DrawResult ScheduledActionDrawAndSwapIfPossible() override { | 116 DrawResult ScheduledActionDrawAndSwapIfPossible() override { |
| 116 PushAction("ScheduledActionDrawAndSwapIfPossible"); | 117 PushAction("ScheduledActionDrawAndSwapIfPossible"); |
| 117 num_draws_++; | 118 num_draws_++; |
| 118 DrawResult result = | 119 DrawResult result = |
| 119 draw_will_happen_ ? DRAW_SUCCESS : DRAW_ABORTED_CHECKERBOARD_ANIMATIONS; | 120 draw_will_happen_ ? DRAW_SUCCESS : DRAW_ABORTED_CHECKERBOARD_ANIMATIONS; |
| 120 bool swap_will_happen = | 121 bool swap_will_happen = |
| 121 draw_will_happen_ && swap_will_happen_if_draw_happens_; | 122 draw_will_happen_ && swap_will_happen_if_draw_happens_; |
| 122 if (swap_will_happen) { | 123 if (swap_will_happen) { |
| 123 scheduler_->DidSwapBuffers(); | 124 scheduler_->DidSwapBuffers(); |
| 124 | 125 |
| (...skipping 2104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2229 client_->Reset(); | 2230 client_->Reset(); |
| 2230 | 2231 |
| 2231 task_runner().RunPendingTasks(); // Run posted deadline. | 2232 task_runner().RunPendingTasks(); // Run posted deadline. |
| 2232 EXPECT_ACTION("SetNeedsBeginFrames(false)", client_, 0, 2); | 2233 EXPECT_ACTION("SetNeedsBeginFrames(false)", client_, 0, 2); |
| 2233 EXPECT_ACTION("SendBeginMainFrameNotExpectedSoon", client_, 1, 2); | 2234 EXPECT_ACTION("SendBeginMainFrameNotExpectedSoon", client_, 1, 2); |
| 2234 client_->Reset(); | 2235 client_->Reset(); |
| 2235 } | 2236 } |
| 2236 | 2237 |
| 2237 } // namespace | 2238 } // namespace |
| 2238 } // namespace cc | 2239 } // namespace cc |
| OLD | NEW |