OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/gfx/ozone/dri/dri_surface_factory.h" | 5 #include "ui/gfx/ozone/dri/dri_surface_factory.h" |
6 | 6 |
7 #include <drm.h> | 7 #include <drm.h> |
8 #include <errno.h> | 8 #include <errno.h> |
9 #include <xf86drm.h> | 9 #include <xf86drm.h> |
10 | 10 |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 | 230 |
231 return true; | 231 return true; |
232 } | 232 } |
233 | 233 |
234 SkCanvas* DriSurfaceFactory::GetCanvasForWidget( | 234 SkCanvas* DriSurfaceFactory::GetCanvasForWidget( |
235 gfx::AcceleratedWidget w) { | 235 gfx::AcceleratedWidget w) { |
236 CHECK(state_ == INITIALIZED); | 236 CHECK(state_ == INITIALIZED); |
237 return reinterpret_cast<DriSurface*>(w)->GetDrawableForWidget(); | 237 return reinterpret_cast<DriSurface*>(w)->GetDrawableForWidget(); |
238 } | 238 } |
239 | 239 |
240 gfx::VSyncProvider* DriSurfaceFactory::GetVSyncProvider( | 240 scoped_ptr<gfx::VSyncProvider> DriSurfaceFactory::CreateVSyncProvider( |
241 gfx::AcceleratedWidget w) { | 241 gfx::AcceleratedWidget w) { |
242 CHECK(state_ == INITIALIZED); | 242 CHECK(state_ == INITIALIZED); |
243 return new DriVSyncProvider(controller_.get()); | 243 return scoped_ptr<VSyncProvider>(new DriVSyncProvider(controller_.get())); |
244 } | 244 } |
245 | 245 |
246 //////////////////////////////////////////////////////////////////////////////// | 246 //////////////////////////////////////////////////////////////////////////////// |
247 // DriSurfaceFactory private | 247 // DriSurfaceFactory private |
248 | 248 |
249 DriSurface* DriSurfaceFactory::CreateSurface( | 249 DriSurface* DriSurfaceFactory::CreateSurface( |
250 HardwareDisplayController* controller) { | 250 HardwareDisplayController* controller) { |
251 return new DriSurface(controller); | 251 return new DriSurface(controller); |
252 } | 252 } |
253 | 253 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 drmEventContext drm_event; | 308 drmEventContext drm_event; |
309 drm_event.version = DRM_EVENT_CONTEXT_VERSION; | 309 drm_event.version = DRM_EVENT_CONTEXT_VERSION; |
310 drm_event.page_flip_handler = HandlePageFlipEvent; | 310 drm_event.page_flip_handler = HandlePageFlipEvent; |
311 drm_event.vblank_handler = NULL; | 311 drm_event.vblank_handler = NULL; |
312 | 312 |
313 // Wait for the page-flip to complete. | 313 // Wait for the page-flip to complete. |
314 drmHandleEvent(fd, &drm_event); | 314 drmHandleEvent(fd, &drm_event); |
315 } | 315 } |
316 | 316 |
317 } // namespace gfx | 317 } // namespace gfx |
OLD | NEW |