Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: ui/ozone/platform/dri/gbm_surfaceless.cc

Issue 821023003: [Ozone-DRI] Listen for swap events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@async-swap
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/gbm_surfaceless.h" 5 #include "ui/ozone/platform/dri/gbm_surfaceless.h"
6 6
7 #include "ui/ozone/platform/dri/dri_vsync_provider.h" 7 #include "ui/ozone/platform/dri/dri_vsync_provider.h"
8 #include "ui/ozone/platform/dri/dri_window_delegate.h" 8 #include "ui/ozone/platform/dri/dri_window_delegate.h"
9 #include "ui/ozone/platform/dri/gbm_buffer.h" 9 #include "ui/ozone/platform/dri/gbm_buffer.h"
10 #include "ui/ozone/platform/dri/hardware_display_controller.h" 10 #include "ui/ozone/platform/dri/hardware_display_controller.h"
(...skipping 10 matching lines...) Expand all
21 NOTREACHED(); 21 NOTREACHED();
22 return 0; 22 return 0;
23 } 23 }
24 24
25 bool GbmSurfaceless::ResizeNativeWindow(const gfx::Size& viewport_size) { 25 bool GbmSurfaceless::ResizeNativeWindow(const gfx::Size& viewport_size) {
26 NOTIMPLEMENTED(); 26 NOTIMPLEMENTED();
27 return false; 27 return false;
28 } 28 }
29 29
30 bool GbmSurfaceless::OnSwapBuffers() { 30 bool GbmSurfaceless::OnSwapBuffers() {
31 HardwareDisplayController* controller = window_delegate_->GetController(); 31 NOTREACHED();
32 if (!controller) 32 return false;
33 return true;
34
35 bool success = controller->SchedulePageFlip();
36 controller->WaitForPageFlipEvent();
37
38 return success;
39 } 33 }
40 34
41 bool GbmSurfaceless::OnSwapBuffersAsync( 35 bool GbmSurfaceless::OnSwapBuffersAsync(
42 const SwapCompletionCallback& callback) { 36 const SwapCompletionCallback& callback) {
43 bool success = OnSwapBuffers(); 37 HardwareDisplayController* controller = window_delegate_->GetController();
44 callback.Run(); 38 if (!controller) {
45 return success; 39 callback.Run();
40 return true;
41 }
42
43 return controller->SchedulePageFlip(callback);
46 } 44 }
47 45
48 scoped_ptr<gfx::VSyncProvider> GbmSurfaceless::CreateVSyncProvider() { 46 scoped_ptr<gfx::VSyncProvider> GbmSurfaceless::CreateVSyncProvider() {
49 return scoped_ptr<gfx::VSyncProvider>(new DriVSyncProvider(window_delegate_)); 47 return scoped_ptr<gfx::VSyncProvider>(new DriVSyncProvider(window_delegate_));
50 } 48 }
51 49
52 } // namespace ui 50 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698