| 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 #include "cc/scheduler/scheduler.h" | 4 #include "cc/scheduler/scheduler.h" |
| 5 | 5 |
| 6 #include <string> | 6 #include <string> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 | 51 |
| 52 void Reset() { | 52 void Reset() { |
| 53 actions_.clear(); | 53 actions_.clear(); |
| 54 states_.clear(); | 54 states_.clear(); |
| 55 draw_will_happen_ = true; | 55 draw_will_happen_ = true; |
| 56 swap_will_happen_if_draw_happens_ = true; | 56 swap_will_happen_if_draw_happens_ = true; |
| 57 num_draws_ = 0; | 57 num_draws_ = 0; |
| 58 } | 58 } |
| 59 | 59 |
| 60 Scheduler* CreateScheduler(const SchedulerSettings& settings) { | 60 Scheduler* CreateScheduler(const SchedulerSettings& settings) { |
| 61 scheduler_ = Scheduler::Create(this, settings); | 61 scheduler_ = Scheduler::Create(this, settings, 0); |
| 62 return scheduler_.get(); | 62 return scheduler_.get(); |
| 63 } | 63 } |
| 64 | 64 |
| 65 bool needs_begin_impl_frame() { return needs_begin_impl_frame_; } | 65 bool needs_begin_impl_frame() { return needs_begin_impl_frame_; } |
| 66 int num_draws() const { return num_draws_; } | 66 int num_draws() const { return num_draws_; } |
| 67 int num_actions_() const { return static_cast<int>(actions_.size()); } | 67 int num_actions_() const { return static_cast<int>(actions_.size()); } |
| 68 const char* Action(int i) const { return actions_[i]; } | 68 const char* Action(int i) const { return actions_[i]; } |
| 69 base::Value& StateForAction(int i) const { return *states_[i]; } | 69 base::Value& StateForAction(int i) const { return *states_[i]; } |
| 70 | 70 |
| 71 int ActionIndex(const char* action) const { | 71 int ActionIndex(const char* action) const { |
| (...skipping 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1212 } | 1212 } |
| 1213 | 1213 |
| 1214 TEST(SchedulerTest, NotSkipMainFrameIfHighLatencyAndCanActivateTooLong) { | 1214 TEST(SchedulerTest, NotSkipMainFrameIfHighLatencyAndCanActivateTooLong) { |
| 1215 // Set up client so that estimates indicate that the activate cannot finish | 1215 // Set up client so that estimates indicate that the activate cannot finish |
| 1216 // before the deadline (~8ms by default). | 1216 // before the deadline (~8ms by default). |
| 1217 MainFrameInHighLatencyMode(1, 10, true); | 1217 MainFrameInHighLatencyMode(1, 10, true); |
| 1218 } | 1218 } |
| 1219 | 1219 |
| 1220 } // namespace | 1220 } // namespace |
| 1221 } // namespace cc | 1221 } // namespace cc |
| OLD | NEW |