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

Unified Diff: ui/ozone/platform/dri/gbm_surface_factory.cc

Issue 433543002: Add a new ozone switch to enable surfaceless output mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: switch to ozone flag Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: ui/ozone/platform/dri/gbm_surface_factory.cc
diff --git a/ui/ozone/platform/dri/gbm_surface_factory.cc b/ui/ozone/platform/dri/gbm_surface_factory.cc
index 1920cc662c68a8d90687f510b092567e9b6f8237..bab30ff11a6de6db523ab1cf11d22ca575d7f366 100644
--- a/ui/ozone/platform/dri/gbm_surface_factory.cc
+++ b/ui/ozone/platform/dri/gbm_surface_factory.cc
@@ -97,19 +97,22 @@ scoped_ptr<SurfaceOzoneEGL> GbmSurfaceFactory::CreateEGLSurfaceForWidget(
DCHECK(state_ == INITIALIZED);
ResetCursor(widget);
- if (allow_surfaceless_) {
- return scoped_ptr<SurfaceOzoneEGL>(
- new GbmSurfaceless(screen_manager_->GetDisplayController(widget)));
- } else {
- scoped_ptr<GbmSurface> surface(
- new GbmSurface(screen_manager_->GetDisplayController(widget),
- device_,
- drm_));
- if (!surface->Initialize())
- return scoped_ptr<SurfaceOzoneEGL>();
-
- return surface.PassAs<SurfaceOzoneEGL>();
- }
+ scoped_ptr<GbmSurface> surface(
+ new GbmSurface(screen_manager_->GetDisplayController(widget),
+ device_,
+ drm_));
+ if (!surface->Initialize())
+ return scoped_ptr<SurfaceOzoneEGL>();
+
+ return surface.PassAs<SurfaceOzoneEGL>();
+}
+
+scoped_ptr<SurfaceOzoneEGL> GbmSurfaceFactory::CreateEmptyEGLSurfaceForWidget(
+ gfx::AcceleratedWidget widget) {
+ if (!allow_surfaceless_)
+ return scoped_ptr<SurfaceOzoneEGL>();
+ return scoped_ptr<SurfaceOzoneEGL>(
+ new GbmSurfaceless(screen_manager_->GetDisplayController(widget)));
}
scoped_refptr<ui::NativePixmap> GbmSurfaceFactory::CreateNativePixmap(

Powered by Google App Engine
This is Rietveld 408576698