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

Unified Diff: ui/gfx/gl/gl_surface_egl.cc

Issue 7467007: Adding Wayland support for ui/gfx (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Accidentally pulled in some extra changes in common.gypi Created 9 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/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
};

Powered by Google App Engine
This is Rietveld 408576698