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

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: Adding missing WaylandDisplay include Created 9 years, 4 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
« no previous file with comments | « ui/gfx/gl/gl_surface_egl.h ('k') | ui/gfx/gl/gl_surface_wayland.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5bc03ade6da8338985fde41546e0b0c5efe8a4af..2f95385e42eb50a00f4be77ebbba55b13419ecfc 100644
--- a/ui/gfx/gl/gl_surface_egl.cc
+++ b/ui/gfx/gl/gl_surface_egl.cc
@@ -15,12 +15,16 @@
// 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>
}
#endif
+#if defined(USE_WAYLAND)
+#include "ui/wayland/wayland_display.h"
+#endif
+
namespace gfx {
namespace {
@@ -43,7 +47,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;
@@ -67,7 +73,12 @@ bool GLSurfaceEGL::InitializeOneOff() {
EGL_GREEN_SIZE, 8,
EGL_RED_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
};
« no previous file with comments | « ui/gfx/gl/gl_surface_egl.h ('k') | ui/gfx/gl/gl_surface_wayland.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698