OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ui/ozone/platform/dri/hardware_display_controller.h" | 5 #include "ui/ozone/platform/dri/hardware_display_controller.h" |
6 | 6 |
7 #include <drm.h> | 7 #include <drm.h> |
8 #include <errno.h> | 8 #include <errno.h> |
9 #include <string.h> | 9 #include <string.h> |
10 #include <xf86drm.h> | 10 #include <xf86drm.h> |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 return status; | 168 return status; |
169 } | 169 } |
170 | 170 |
171 void HardwareDisplayController::AddCrtc(scoped_ptr<CrtcController> controller) { | 171 void HardwareDisplayController::AddCrtc(scoped_ptr<CrtcController> controller) { |
172 crtc_controllers_.push_back(controller.release()); | 172 crtc_controllers_.push_back(controller.release()); |
173 } | 173 } |
174 | 174 |
175 scoped_ptr<CrtcController> HardwareDisplayController::RemoveCrtc( | 175 scoped_ptr<CrtcController> HardwareDisplayController::RemoveCrtc( |
176 uint32_t crtc) { | 176 uint32_t crtc) { |
177 for (ScopedVector<CrtcController>::iterator it = crtc_controllers_.begin(); | 177 for (ScopedVector<CrtcController>::iterator it = crtc_controllers_.begin(); |
178 it != crtc_controllers_.end(); | 178 it != crtc_controllers_.end(); ++it) { |
179 ++it) { | |
180 if ((*it)->crtc() == crtc) { | 179 if ((*it)->crtc() == crtc) { |
181 scoped_ptr<CrtcController> controller(*it); | 180 scoped_ptr<CrtcController> controller(*it); |
182 crtc_controllers_.weak_erase(it); | 181 crtc_controllers_.weak_erase(it); |
183 return controller.Pass(); | 182 return controller.Pass(); |
184 } | 183 } |
185 } | 184 } |
186 | 185 |
187 return scoped_ptr<CrtcController>(); | 186 return scoped_ptr<CrtcController>(); |
188 } | 187 } |
189 | 188 |
(...skipping 20 matching lines...) Expand all Loading... |
210 uint64_t HardwareDisplayController::GetTimeOfLastFlip() const { | 209 uint64_t HardwareDisplayController::GetTimeOfLastFlip() const { |
211 uint64_t time = 0; | 210 uint64_t time = 0; |
212 for (size_t i = 0; i < crtc_controllers_.size(); ++i) | 211 for (size_t i = 0; i < crtc_controllers_.size(); ++i) |
213 if (time < crtc_controllers_[i]->time_of_last_flip()) | 212 if (time < crtc_controllers_[i]->time_of_last_flip()) |
214 time = crtc_controllers_[i]->time_of_last_flip(); | 213 time = crtc_controllers_[i]->time_of_last_flip(); |
215 | 214 |
216 return time; | 215 return time; |
217 } | 216 } |
218 | 217 |
219 } // namespace ui | 218 } // namespace ui |
OLD | NEW |