| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 } | 61 } |
| 62 | 62 |
| 63 void SetDrawWillHappen(bool draw_will_happen) { | 63 void SetDrawWillHappen(bool draw_will_happen) { |
| 64 draw_will_happen_ = draw_will_happen; | 64 draw_will_happen_ = draw_will_happen; |
| 65 } | 65 } |
| 66 void SetSwapWillHappenIfDrawHappens(bool swap_will_happen_if_draw_happens) { | 66 void SetSwapWillHappenIfDrawHappens(bool swap_will_happen_if_draw_happens) { |
| 67 swap_will_happen_if_draw_happens_ = swap_will_happen_if_draw_happens; | 67 swap_will_happen_if_draw_happens_ = swap_will_happen_if_draw_happens; |
| 68 } | 68 } |
| 69 | 69 |
| 70 // Scheduler Implementation. | 70 // Scheduler Implementation. |
| 71 virtual void SetNeedsBeginFrameOnImplThread(bool enable) OVERRIDE { |
| 72 actions_.push_back("SetNeedsBeginFrameOnImplThread"); |
| 73 states_.push_back(scheduler_->StateAsStringForTesting()); |
| 74 } |
| 71 virtual void ScheduledActionSendBeginFrameToMainThread() OVERRIDE { | 75 virtual void ScheduledActionSendBeginFrameToMainThread() OVERRIDE { |
| 72 actions_.push_back("ScheduledActionSendBeginFrameToMainThread"); | 76 actions_.push_back("ScheduledActionSendBeginFrameToMainThread"); |
| 73 states_.push_back(scheduler_->StateAsStringForTesting()); | 77 states_.push_back(scheduler_->StateAsStringForTesting()); |
| 74 } | 78 } |
| 75 virtual ScheduledActionDrawAndSwapResult | 79 virtual ScheduledActionDrawAndSwapResult |
| 76 ScheduledActionDrawAndSwapIfPossible() OVERRIDE { | 80 ScheduledActionDrawAndSwapIfPossible() OVERRIDE { |
| 77 actions_.push_back("ScheduledActionDrawAndSwapIfPossible"); | 81 actions_.push_back("ScheduledActionDrawAndSwapIfPossible"); |
| 78 states_.push_back(scheduler_->StateAsStringForTesting()); | 82 states_.push_back(scheduler_->StateAsStringForTesting()); |
| 79 num_draws_++; | 83 num_draws_++; |
| 80 return ScheduledActionDrawAndSwapResult(draw_will_happen_, | 84 return ScheduledActionDrawAndSwapResult(draw_will_happen_, |
| (...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 640 scheduler->DidLoseOutputSurface(); | 644 scheduler->DidLoseOutputSurface(); |
| 641 // Verifying that it's 1 so that we know that it's reset on recreate. | 645 // Verifying that it's 1 so that we know that it's reset on recreate. |
| 642 EXPECT_EQ(1, controller_ptr->NumFramesPending()); | 646 EXPECT_EQ(1, controller_ptr->NumFramesPending()); |
| 643 | 647 |
| 644 scheduler->DidCreateAndInitializeOutputSurface(); | 648 scheduler->DidCreateAndInitializeOutputSurface(); |
| 645 EXPECT_EQ(0, controller_ptr->NumFramesPending()); | 649 EXPECT_EQ(0, controller_ptr->NumFramesPending()); |
| 646 } | 650 } |
| 647 | 651 |
| 648 } // namespace | 652 } // namespace |
| 649 } // namespace cc | 653 } // namespace cc |
| OLD | NEW |