Changeset 173716 in webkit


Ignore:
Timestamp:
Sep 17, 2014, 11:21:55 PM (11 years ago)
Author:
zandobersek@gmail.com
Message:

[GTK] Add Wayland support to GLContextEGL
https://bugs.webkit.org/show_bug.cgi?id=136829

Reviewed by Martin Robinson.

  • platform/graphics/egl/GLContextEGL.cpp:

(WebCore::sharedEGLDisplay): Special-case the shared EGL display initialization
for the GTK port when running under Wayland. In that case the pointer to the
native wl_display object should be passed to eglGetDisplay(). If not running
under Wayland we should fall back to using the shared X11 display (if support
for that display system is enabled) or the EGL_DEFAULT_DISPLAY.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r173710 r173716  
     12014-09-17  Iago Toral  <itoral@igalia.com> and Zan Dobersek  <zdobersek@igalia.com>
     2
     3        [GTK] Add Wayland support to GLContextEGL
     4        https://bugs.webkit.org/show_bug.cgi?id=136829
     5
     6        Reviewed by Martin Robinson.
     7
     8        * platform/graphics/egl/GLContextEGL.cpp:
     9        (WebCore::sharedEGLDisplay): Special-case the shared EGL display initialization
     10        for the GTK port when running under Wayland. In that case the pointer to the
     11        native wl_display object should be passed to eglGetDisplay(). If not running
     12        under Wayland we should fall back to using the shared X11 display (if support
     13        for that display system is enabled) or the EGL_DEFAULT_DISPLAY.
     14
    1152014-09-17  Daniel Bates  <dabates@apple.com>
    216
  • trunk/Source/WebCore/platform/graphics/egl/GLContextEGL.cpp

    r169935 r173716  
    3636#endif
    3737
     38#if PLATFORM(GTK)
     39#include "GtkUtilities.h"
     40#if PLATFORM(WAYLAND) && !defined(GTK_API_VERSION_2)
     41#include "WaylandDisplay.h"
     42#endif
     43#endif
     44
    3845#if ENABLE(ACCELERATED_2D_CANVAS)
    3946// cairo-gl.h includes some definitions from GLX that conflict with
     
    5966    if (!initialized) {
    6067        initialized = true;
     68#if PLATFORM(GTK) && PLATFORM(WAYLAND) && !defined(GTK_API_VERSION_2)
     69        if (getDisplaySystemType() == DisplaySystemType::Wayland && WaylandDisplay::instance())
     70            gSharedEGLDisplay = eglGetDisplay(WaylandDisplay::instance()->nativeDisplay());
     71        else // Note that this branch continutes outside this #if-guarded segment.
     72#endif
    6173#if PLATFORM(X11)
    62         gSharedEGLDisplay = eglGetDisplay(GLContext::sharedX11Display());
    63 #else
    64         gSharedEGLDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
     74            gSharedEGLDisplay = eglGetDisplay(GLContext::sharedX11Display());
     75#else
     76            gSharedEGLDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
    6577#endif
    6678        if (gSharedEGLDisplay != EGL_NO_DISPLAY && (!eglInitialize(gSharedEGLDisplay, 0, 0) || !eglBindAPI(gGLAPI)))
Note: See TracChangeset for help on using the changeset viewer.