[GTK] [Wayland] Should be possible to build with support for both X11 and Wayland.
authorclopez@igalia.com <clopez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Jun 2015 15:21:07 +0000 (15:21 +0000)
committerclopez@igalia.com <clopez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Jun 2015 15:21:07 +0000 (15:21 +0000)
commit3fddc509e29522ac85bf77645de4bc973b263b94
tree0274da44234b42506468940c10b7f1d5c7a50905
parent24381a04277fe956c1c4ec611c5bd6bc48dd8b52
[GTK] [Wayland] Should be possible to build with support for both X11 and Wayland.
https://bugs.webkit.org/show_bug.cgi?id=145701

Reviewed by Žan Doberšek.

.:

* Source/cmake/OptionsGTK.cmake: Remove conflicting options.

Source/WebCore:

No new tests, no behavior changes.

When building both targets, we have to include the wayland-egl
headers in order to build the Wayland target. This causes that
EGLNativePixmapType and EGLNativeWindowType get defined as
different types than when building only the X11 target.

By type casting them to the ones that are expected, we are able
to build both targets at the same time.

I have done tests (building each target alone as also both targets
at the same time), and everything seems to works as expected.

Once built for both targets, if you try to launch the MiniBrowser
from inside a Wayland compositor (Weston on top of X for example),
it will trigger the X11 target if the DISPLAY environment variable
is set and the environment variable GDK_BACKEND is not set to wayland,
otherwise it will trigger the Wayland target.

* platform/graphics/GLContext.cpp:
(WebCore::GLContext::createContextForWindow): Add type cast.
* platform/graphics/egl/GLContextEGL.cpp: Add missing include when
building both targets that is required for defining DefaultRootWindow().
(WebCore::GLContextEGL::createPixmapContext): Add type cast.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@185453 268f45cc-cd09-0410-ab3c-d52691b4dbfc
ChangeLog
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/GLContext.cpp
Source/WebCore/platform/graphics/egl/GLContextEGL.cpp
Source/cmake/OptionsGTK.cmake