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/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 } | 109 } |
110 bool needs_begin_frame() { return needs_begin_frame_; } | 110 bool needs_begin_frame() { return needs_begin_frame_; } |
111 int num_draws() const { return num_draws_; } | 111 int num_draws() const { return num_draws_; } |
112 int num_actions_() const { return static_cast<int>(actions_.size()); } | 112 int num_actions_() const { return static_cast<int>(actions_.size()); } |
113 const char* Action(int i) const { return actions_[i]; } | 113 const char* Action(int i) const { return actions_[i]; } |
114 std::string StateForAction(int i) const { return states_[i]->ToString(); } | 114 std::string StateForAction(int i) const { return states_[i]->ToString(); } |
115 base::TimeTicks posted_begin_impl_frame_deadline() const { | 115 base::TimeTicks posted_begin_impl_frame_deadline() const { |
116 return posted_begin_impl_frame_deadline_; | 116 return posted_begin_impl_frame_deadline_; |
117 } | 117 } |
118 | 118 |
119 OrderedSimpleTaskRunner& task_runner() { return *task_runner_; } | 119 OrderedSimpleTaskRunner& task_runner() { return *task_runner_.get(); } |
120 | 120 |
121 int ActionIndex(const char* action) const { | 121 int ActionIndex(const char* action) const { |
122 for (size_t i = 0; i < actions_.size(); i++) | 122 for (size_t i = 0; i < actions_.size(); i++) |
123 if (!strcmp(actions_[i], action)) | 123 if (!strcmp(actions_[i], action)) |
124 return i; | 124 return i; |
125 return -1; | 125 return -1; |
126 } | 126 } |
127 | 127 |
128 void SetSwapContainsIncompleteTile(bool contain) { | 128 void SetSwapContainsIncompleteTile(bool contain) { |
129 swap_contains_incomplete_tile_ = contain; | 129 swap_contains_incomplete_tile_ = contain; |
(...skipping 1787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1917 EXPECT_FALSE(scheduler->IsSyntheticBeginFrameSourceActive()); | 1917 EXPECT_FALSE(scheduler->IsSyntheticBeginFrameSourceActive()); |
1918 | 1918 |
1919 client.Reset(); | 1919 client.Reset(); |
1920 client.task_runner().RunPendingTasks(); // Run posted deadline. | 1920 client.task_runner().RunPendingTasks(); // Run posted deadline. |
1921 EXPECT_SINGLE_ACTION("ScheduledActionBeginOutputSurfaceCreation", client); | 1921 EXPECT_SINGLE_ACTION("ScheduledActionBeginOutputSurfaceCreation", client); |
1922 EXPECT_FALSE(scheduler->IsSyntheticBeginFrameSourceActive()); | 1922 EXPECT_FALSE(scheduler->IsSyntheticBeginFrameSourceActive()); |
1923 } | 1923 } |
1924 | 1924 |
1925 } // namespace | 1925 } // namespace |
1926 } // namespace cc | 1926 } // namespace cc |
OLD | NEW |