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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 void HardwareDisplayController::OnPageFlipEvent(unsigned int frame, | 195 void HardwareDisplayController::OnPageFlipEvent(unsigned int frame, |
196 unsigned int seconds, | 196 unsigned int seconds, |
197 unsigned int useconds) { | 197 unsigned int useconds) { |
198 time_of_last_flip_ = | 198 time_of_last_flip_ = |
199 static_cast<uint64_t>(seconds) * base::Time::kMicrosecondsPerSecond + | 199 static_cast<uint64_t>(seconds) * base::Time::kMicrosecondsPerSecond + |
200 useconds; | 200 useconds; |
201 | 201 |
202 surface_->SwapBuffers(); | 202 surface_->SwapBuffers(); |
203 } | 203 } |
204 | 204 |
205 bool HardwareDisplayController::SetCursor(ScanoutSurface* surface) { | 205 bool HardwareDisplayController::SetCursor(scoped_refptr<ScanoutBuffer> buffer) { |
206 bool ret = drm_->SetCursor(crtc_id_, | 206 bool ret = drm_->SetCursor(crtc_id_, |
207 surface->GetHandle(), | 207 buffer->GetHandle(), |
208 surface->Size().width(), | 208 buffer->GetSize()); |
209 surface->Size().height()); | 209 cursor_buffer_ = buffer; |
210 surface->SwapBuffers(); | |
211 return ret; | 210 return ret; |
212 } | 211 } |
213 | 212 |
214 bool HardwareDisplayController::UnsetCursor() { | 213 bool HardwareDisplayController::UnsetCursor() { |
215 return drm_->SetCursor(crtc_id_, 0, 0, 0); | 214 cursor_buffer_ = NULL; |
| 215 return drm_->SetCursor(crtc_id_, 0, gfx::Size()); |
216 } | 216 } |
217 | 217 |
218 bool HardwareDisplayController::MoveCursor(const gfx::Point& location) { | 218 bool HardwareDisplayController::MoveCursor(const gfx::Point& location) { |
219 if (is_disabled_) | 219 if (is_disabled_) |
220 return true; | 220 return true; |
221 | 221 |
222 return drm_->MoveCursor(crtc_id_, location.x(), location.y()); | 222 return drm_->MoveCursor(crtc_id_, location); |
223 } | 223 } |
224 | 224 |
225 } // namespace ui | 225 } // namespace ui |
OLD | NEW |