Changeset 150440 in webkit


Ignore:
Timestamp:
May 21, 2013 6:37:17 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

[GTK] Always use EGL to create the GL context when running on Wayland
https://bugs.webkit.org/show_bug.cgi?id=115721

Patch by Iago Toral Quiroga <itoral@igalia.com> on 2013-05-21
Reviewed by Martin Robinson.

  • platform/graphics/cairo/GLContext.cpp:

(WebCore::GLContext::createContextForWindow):
(WebCore::GLContext::createOffscreenContext): Always use EGL to create the GL context
instead of GLX when running on Wayland and make createOffScreenContext reuse the code
in createContextWindow.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r150437 r150440  
     12013-05-21  Iago Toral Quiroga  <itoral@igalia.com>
     2
     3        [GTK] Always use EGL to create the GL context when running on Wayland
     4        https://bugs.webkit.org/show_bug.cgi?id=115721
     5
     6        Reviewed by Martin Robinson.
     7
     8        * platform/graphics/cairo/GLContext.cpp:
     9        (WebCore::GLContext::createContextForWindow):
     10        (WebCore::GLContext::createOffscreenContext): Always use EGL to create the GL context
     11        instead of GLX when running on Wayland and make createOffScreenContext reuse the code
     12        in createContextWindow.
     13
    1142013-05-21  Alberto Garcia  <agarcia@igalia.com>
    215
  • trunk/Source/WebCore/platform/graphics/cairo/GLContext.cpp

    r130525 r150440  
    2828#if PLATFORM(X11)
    2929#include <X11/Xlib.h>
     30#endif
     31
     32#if PLATFORM(GTK)
     33#include <gdk/gdk.h>
     34#ifndef GTK_API_VERSION_2
     35#ifdef GDK_WINDOWING_WAYLAND
     36#include <gdk/gdkwayland.h>
     37#endif
     38#endif
    3039#endif
    3140
     
    114123PassOwnPtr<GLContext> GLContext::createContextForWindow(uint64_t windowHandle, GLContext* sharingContext)
    115124{
     125#if PLATFORM(GTK) && defined(GDK_WINDOWING_WAYLAND) && USE(EGL)
     126    GdkDisplay* display = gdk_display_manager_get_default_display(gdk_display_manager_get());
     127
     128    if (GDK_IS_WAYLAND_DISPLAY(display)) {
     129        if (OwnPtr<GLContext> eglContext = GLContextEGL::createContext(windowHandle, sharingContext))
     130            return eglContext.release();
     131        return nullptr;
     132    }
     133#endif
     134
    116135#if USE(GLX)
    117136    if (OwnPtr<GLContext> glxContext = GLContextGLX::createContext(windowHandle, sharingContext))
     
    132151PassOwnPtr<GLContext> GLContext::createOffscreenContext(GLContext* sharingContext)
    133152{
    134 #if USE(GLX)
    135     if (OwnPtr<GLContext> glxContext = GLContextGLX::createContext(0, sharingContext))
    136         return glxContext.release();
    137 #endif
    138 #if USE(EGL)
    139     if (OwnPtr<GLContext> eglContext = GLContextEGL::createContext(0, sharingContext))
    140         return eglContext.release();
    141 #endif
    142     return nullptr;
     153    return createContextForWindow(0, sharingContext);
    143154}
    144155
Note: See TracChangeset for help on using the changeset viewer.