| 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 bool DriSurfaceFactory::AttemptToResizeAcceleratedWidget( | 196 bool DriSurfaceFactory::AttemptToResizeAcceleratedWidget( |
| 197 gfx::AcceleratedWidget w, | 197 gfx::AcceleratedWidget w, |
| 198 const gfx::Rect& bounds) { | 198 const gfx::Rect& bounds) { |
| 199 return false; | 199 return false; |
| 200 } | 200 } |
| 201 | 201 |
| 202 bool DriSurfaceFactory::SchedulePageFlip(gfx::AcceleratedWidget w) { | 202 bool DriSurfaceFactory::SchedulePageFlip(gfx::AcceleratedWidget w) { |
| 203 CHECK(state_ == INITIALIZED); | 203 CHECK(state_ == INITIALIZED); |
| 204 // TODO(dnicoara) Change this CHECK once we're running with the threaded | 204 // TODO(dnicoara) Change this CHECK once we're running with the threaded |
| 205 // compositor. | 205 // compositor. |
| 206 CHECK(base::MessageLoop::current()->type() == base::MessageLoop::TYPE_UI); | 206 CHECK(base::MessageLoopForUI::IsCurrent()); |
| 207 | 207 |
| 208 // TODO(dnicoara) Once we can handle multiple displays this needs to be | 208 // TODO(dnicoara) Once we can handle multiple displays this needs to be |
| 209 // changed. | 209 // changed. |
| 210 CHECK(w == kDefaultWidgetHandle); | 210 CHECK(w == kDefaultWidgetHandle); |
| 211 | 211 |
| 212 if (!controller_->SchedulePageFlip()) | 212 if (!controller_->SchedulePageFlip()) |
| 213 return false; | 213 return false; |
| 214 | 214 |
| 215 // Only wait for the page flip event to finish if it was properly scheduled. | 215 // Only wait for the page flip event to finish if it was properly scheduled. |
| 216 // | 216 // |
| (...skipping 91 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 |