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/dri_wrapper.h" | 5 #include "ui/ozone/platform/dri/dri_wrapper.h" |
6 | 6 |
7 #include <fcntl.h> | 7 #include <fcntl.h> |
8 #include <sys/mman.h> | 8 #include <sys/mman.h> |
9 #include <unistd.h> | 9 #include <unistd.h> |
10 #include <xf86drm.h> | 10 #include <xf86drm.h> |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 property->flags & DRM_MODE_PROP_BLOB) | 191 property->flags & DRM_MODE_PROP_BLOB) |
192 return ScopedDrmPropertyBlobPtr( | 192 return ScopedDrmPropertyBlobPtr( |
193 drmModeGetPropertyBlob(fd_, connector->prop_values[i])); | 193 drmModeGetPropertyBlob(fd_, connector->prop_values[i])); |
194 } | 194 } |
195 | 195 |
196 return ScopedDrmPropertyBlobPtr(); | 196 return ScopedDrmPropertyBlobPtr(); |
197 } | 197 } |
198 | 198 |
199 bool DriWrapper::SetCursor(uint32_t crtc_id, | 199 bool DriWrapper::SetCursor(uint32_t crtc_id, |
200 uint32_t handle, | 200 uint32_t handle, |
201 uint32_t width, | 201 const gfx::Size& size) { |
202 uint32_t height) { | |
203 CHECK(fd_ >= 0); | 202 CHECK(fd_ >= 0); |
204 return !drmModeSetCursor(fd_, crtc_id, handle, width, height); | 203 return !drmModeSetCursor(fd_, crtc_id, handle, size.width(), size.height()); |
205 } | 204 } |
206 | 205 |
207 bool DriWrapper::MoveCursor(uint32_t crtc_id, int x, int y) { | 206 bool DriWrapper::MoveCursor(uint32_t crtc_id, const gfx::Point& point) { |
208 CHECK(fd_ >= 0); | 207 CHECK(fd_ >= 0); |
209 return !drmModeMoveCursor(fd_, crtc_id, x, y); | 208 return !drmModeMoveCursor(fd_, crtc_id, point.x(), point.y()); |
210 } | 209 } |
211 | 210 |
212 void DriWrapper::HandleEvent(drmEventContext& event) { | 211 void DriWrapper::HandleEvent(drmEventContext& event) { |
213 CHECK(fd_ >= 0); | 212 CHECK(fd_ >= 0); |
214 drmHandleEvent(fd_, &event); | 213 drmHandleEvent(fd_, &event); |
215 } | 214 } |
216 | 215 |
217 bool DriWrapper::CreateDumbBuffer(const SkImageInfo& info, | 216 bool DriWrapper::CreateDumbBuffer(const SkImageInfo& info, |
218 uint32_t* handle, | 217 uint32_t* handle, |
219 uint32_t* stride, | 218 uint32_t* stride, |
(...skipping 15 matching lines...) Expand all Loading... |
235 uint32_t handle, | 234 uint32_t handle, |
236 uint32_t stride, | 235 uint32_t stride, |
237 void* pixels) { | 236 void* pixels) { |
238 CHECK(fd_ >= 0); | 237 CHECK(fd_ >= 0); |
239 munmap(pixels, info.getSafeSize(stride)); | 238 munmap(pixels, info.getSafeSize(stride)); |
240 DrmDestroyDumbBuffer(fd_, handle); | 239 DrmDestroyDumbBuffer(fd_, handle); |
241 } | 240 } |
242 | 241 |
243 | 242 |
244 } // namespace ui | 243 } // namespace ui |
OLD | NEW |