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..f3132236f6233e05a7705f6420e871d9619f9e05 100644 |
--- a/ui/gfx/gl/gl_surface_egl.cc |
+++ b/ui/gfx/gl/gl_surface_egl.cc |
@@ -7,15 +7,21 @@ |
#include "build/build_config.h" |
#include "base/logging.h" |
#include "base/memory/scoped_ptr.h" |
+#if defined(USE_WAYLAND) |
sky
2011/07/27 15:51:05
conditional includes after non-conditional include
|
+#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" |
+#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) |
extern "C" { |
#include <X11/Xlib.h> |
} |
@@ -43,7 +49,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 +77,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 |
}; |