Chromium Code Reviews| Index: ui/ozone/platform/dri/gbm_surfaceless.cc |
| diff --git a/ui/ozone/platform/dri/gbm_surfaceless.cc b/ui/ozone/platform/dri/gbm_surfaceless.cc |
| index b3748445a369b53d97866b759da0455c26cc4c0d..d3b0e15df3fb4982a74109c5c9cbb3ce3424160e 100644 |
| --- a/ui/ozone/platform/dri/gbm_surfaceless.cc |
| +++ b/ui/ozone/platform/dri/gbm_surfaceless.cc |
| @@ -8,11 +8,13 @@ |
| #include "ui/ozone/platform/dri/dri_window_delegate.h" |
| #include "ui/ozone/platform/dri/gbm_buffer.h" |
| #include "ui/ozone/platform/dri/hardware_display_controller.h" |
| +#include "ui/ozone/platform/dri/page_flip_event_handler.h" |
| namespace ui { |
| -GbmSurfaceless::GbmSurfaceless(DriWindowDelegate* window_delegate) |
| - : window_delegate_(window_delegate) { |
| +GbmSurfaceless::GbmSurfaceless(DriWindowDelegate* window_delegate, |
| + PageFilpEventHandler* handler) |
| + : window_delegate_(window_delegate), flip_handler_(handler) { |
| } |
| GbmSurfaceless::~GbmSurfaceless() {} |
| @@ -32,8 +34,17 @@ bool GbmSurfaceless::OnSwapBuffers() { |
| if (!controller) |
| return true; |
| + // Make sure any previous Page Flip requests have been processed, otherwise |
| + // the drivers will complain as EBusy. We don't have support for Flip queue |
| + // in any of the drivers. |
| + if (flip_handler_) |
| + flip_handler_->EnsurePreviousFlipHandled(); |
|
brianderson
2014/12/10 22:48:05
Looks like this is a blocking call. Is this on a c
kalyank
2014/12/11 03:24:26
We swap, submit page flip requests and wait till t
kalyank
2014/12/11 12:55:58
Now, we don't block on Main thread at all. In GLSu
|
| + |
| bool success = controller->SchedulePageFlip(); |
| - controller->WaitForPageFlipEvent(); |
| + if (!flip_handler_) |
| + controller->WaitForPageFlipEvent(); |
| + else |
| + flip_handler_->GetPageFlipCompleted(controller, callback_); |
| return success; |
| } |
| @@ -42,4 +53,9 @@ scoped_ptr<gfx::VSyncProvider> GbmSurfaceless::CreateVSyncProvider() { |
| return scoped_ptr<gfx::VSyncProvider>(new DriVSyncProvider(window_delegate_)); |
| } |
| +void GbmSurfaceless::SetPageFlipCompletionCallback( |
| + const PageFlipCompletionCallback& callback) { |
| + callback_ = callback; |
| +} |
| + |
| } // namespace ui |