| Index: ui/gfx/gl/gl_surface_egl.cc
|
| diff --git a/ui/gfx/gl/gl_surface_egl.cc b/ui/gfx/gl/gl_surface_egl.cc
|
| index bf509bd30493e661da9c524a59b690b124b57ae9..fef43fe5c4fcf03c0ca94023c8b65bb609caf055 100644
|
| --- a/ui/gfx/gl/gl_surface_egl.cc
|
| +++ b/ui/gfx/gl/gl_surface_egl.cc
|
| @@ -7,15 +7,22 @@
|
| #include "build/build_config.h"
|
| #include "base/logging.h"
|
| #include "base/memory/scoped_ptr.h"
|
| +#include "ui/gfx/gl/egl_util.h"
|
| +
|
| +#if defined(USE_WAYLAND)
|
| +#include "ui/wayland/wayland_display.h"
|
| +#include <EGL/egl.h>
|
| +#include <EGL/eglext.h>
|
| +#else
|
| #include "third_party/angle/include/EGL/egl.h"
|
| #include "third_party/angle/include/EGL/eglext.h"
|
| -#include "ui/gfx/gl/egl_util.h"
|
| +#endif
|
|
|
| // This header must come after the above third-party include, as
|
| // it brings in #defines that cause conflicts.
|
| #include "ui/gfx/gl/gl_bindings.h"
|
|
|
| -#if defined(USE_X11)
|
| +#if defined(USE_X11) && !defined(USE_WAYLAND)
|
| extern "C" {
|
| #include <X11/Xlib.h>
|
| }
|
| @@ -43,7 +50,9 @@ bool GLSurfaceEGL::InitializeOneOff() {
|
| if (initialized)
|
| return true;
|
|
|
| -#if defined(USE_X11)
|
| +#if defined(USE_WAYLAND)
|
| + g_native_display = ui::WaylandDisplay::Connect(NULL)->display();
|
| +#elif defined(USE_X11)
|
| g_native_display = XOpenDisplay(NULL);
|
| #else
|
| g_native_display = EGL_DEFAULT_DISPLAY;
|
| @@ -69,7 +78,12 @@ bool GLSurfaceEGL::InitializeOneOff() {
|
| EGL_DEPTH_SIZE, 16,
|
| EGL_STENCIL_SIZE, 8,
|
| EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
|
| - EGL_SURFACE_TYPE, EGL_WINDOW_BIT | EGL_PBUFFER_BIT,
|
| + EGL_SURFACE_TYPE, EGL_WINDOW_BIT
|
| +#if defined(USE_WAYLAND)
|
| + | EGL_PIXMAP_BIT,
|
| +#else
|
| + | EGL_PBUFFER_BIT,
|
| +#endif
|
| EGL_NONE
|
| };
|
|
|
|
|