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 603cff4968ff92a86a6fc16e4153b584aada5637..9ab51ff3daba88aa3b23edf86122e63cc1a4e14f 100644 |
--- a/ui/gfx/gl/gl_surface_egl.cc |
+++ b/ui/gfx/gl/gl_surface_egl.cc |
@@ -7,14 +7,19 @@ |
#include "build/build_config.h" |
#include "base/logging.h" |
#include "base/memory/scoped_ptr.h" |
+#if defined(USE_WAYLAND) |
+#include "ui/wayland/wayland_display.h" |
+#include <EGL/egl.h> |
+#else |
#include "third_party/angle/include/EGL/egl.h" |
+#endif |
#include "ui/gfx/gl/egl_util.h" |
// 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) |
jonathan.backer
2011/07/26 14:56:27
Is it consistent to have USE_X11 and USE_WAYLAND d
|
extern "C" { |
#include <X11/Xlib.h> |
} |
@@ -39,7 +44,9 @@ bool GLSurfaceEGL::InitializeOneOff() { |
if (initialized) |
return true; |
-#if defined(USE_X11) |
+#if defined(USE_WAYLAND) |
+ g_native_display = WaylandDisplay::Connect(NULL)->GetNativeDisplay(); |
+#elif defined(USE_X11) |
g_native_display = XOpenDisplay(NULL); |
#else |
g_native_display = EGL_DEFAULT_DISPLAY; |
@@ -65,7 +72,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 |
}; |