⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 243284 in webkit


Ignore:
Timestamp:
Mar 21, 2019, 2:44:22 AM (7 years ago)
Author:
Carlos Garcia Campos
Message:

[WPE] Confusing messages in stderr when surfaceless context is not supported
https://bugs.webkit.org/show_bug.cgi?id=195742

Reviewed by Žan Doberšek.

The messages shown are:

Cannot create EGL surfaceless context: missing EGL_KHR_surfaceless_{context,opengl} extension.
Cannot create EGL WPE context: EGL_SUCCESS

It seems like there's anything wrong, while there isn't. It's also confusing an error message where the error is
EGL_SUCCESS. I think we should not show those messages at all, not suporting surfaceless contexts is not an
error and it's correctly handled. Failing to get a native window handle from render backend offscreen egl target
is not an error either, since most of the backends don't implement the interface (they actually have an empty
implementation).

  • platform/graphics/egl/GLContextEGL.cpp:

(WebCore::GLContextEGL::createSurfacelessContext): Remove the message when extensions are not present

  • platform/graphics/egl/GLContextEGLLibWPE.cpp:

(WebCore::GLContextEGL::createWPEContext): Handle the case of wpe_renderer_backend_egl_offscreen_target_create()
returning nullptr, which can happen if the backend doesn't implement the interface. Move the context creation
after the target initialization, to avoid leaking the context when the target doesn't have a native window.

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r243279 r243284  
     12019-03-21  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [WPE] Confusing messages in stderr when surfaceless context is not supported
     4        https://bugs.webkit.org/show_bug.cgi?id=195742
     5
     6        Reviewed by Žan Doberšek.
     7
     8        The messages shown are:
     9
     10        Cannot create EGL surfaceless context: missing EGL_KHR_surfaceless_{context,opengl} extension.
     11        Cannot create EGL WPE context: EGL_SUCCESS
     12
     13        It seems like there's anything wrong, while there isn't. It's also confusing an error message where the error is
     14        EGL_SUCCESS. I think we should not show those messages at all, not suporting surfaceless contexts is not an
     15        error and it's correctly handled. Failing to get a native window handle from render backend offscreen egl target
     16        is not an error either, since most of the backends don't implement the interface (they actually have an empty
     17        implementation).
     18
     19        * platform/graphics/egl/GLContextEGL.cpp:
     20        (WebCore::GLContextEGL::createSurfacelessContext): Remove the message when extensions are not present
     21        * platform/graphics/egl/GLContextEGLLibWPE.cpp:
     22        (WebCore::GLContextEGL::createWPEContext): Handle the case of wpe_renderer_backend_egl_offscreen_target_create()
     23        returning nullptr, which can happen if the backend doesn't implement the interface. Move the context creation
     24        after the target initialization, to avoid leaking the context when the target doesn't have a native window.
     25
    1262019-03-20  Yusuke Suzuki  <ysuzuki@apple.com>
    227
  • trunk/Source/WebCore/platform/graphics/egl/GLContextEGL.cpp

    r242640 r243284  
    234234
    235235    const char* extensions = eglQueryString(display, EGL_EXTENSIONS);
    236     if (!GLContext::isExtensionSupported(extensions, "EGL_KHR_surfaceless_context") && !GLContext::isExtensionSupported(extensions, "EGL_KHR_surfaceless_opengl")) {
    237         WTFLogAlways("Cannot create EGL surfaceless context: missing EGL_KHR_surfaceless_{context,opengl} extension.\n");
    238         return nullptr;
    239     }
     236    if (!GLContext::isExtensionSupported(extensions, "EGL_KHR_surfaceless_context") && !GLContext::isExtensionSupported(extensions, "EGL_KHR_surfaceless_opengl"))
     237        return nullptr;
    240238
    241239    EGLConfig config;
  • trunk/Source/WebCore/platform/graphics/egl/GLContextEGLLibWPE.cpp

    r238282 r243284  
    6060    }
    6161
    62     EGLContext context = createContextForEGLVersion(platformDisplay, config, sharingContext);
    63     if (context == EGL_NO_CONTEXT) {
    64         WTFLogAlways("Cannot create EGL WPE context: %s\n", lastErrorString());
     62    auto* target = wpe_renderer_backend_egl_offscreen_target_create();
     63    if (!target)
     64        return nullptr;
     65
     66    wpe_renderer_backend_egl_offscreen_target_initialize(target, downcast<PlatformDisplayLibWPE>(platformDisplay).backend());
     67    EGLNativeWindowType window = wpe_renderer_backend_egl_offscreen_target_get_native_window(target);
     68    if (!window) {
     69        wpe_renderer_backend_egl_offscreen_target_destroy(target);
    6570        return nullptr;
    6671    }
    6772
    68     auto* target = wpe_renderer_backend_egl_offscreen_target_create();
    69     wpe_renderer_backend_egl_offscreen_target_initialize(target, downcast<PlatformDisplayLibWPE>(platformDisplay).backend());
    70     EGLNativeWindowType window = wpe_renderer_backend_egl_offscreen_target_get_native_window(target);
    71     if (!window) {
     73    EGLContext context = createContextForEGLVersion(platformDisplay, config, sharingContext);
     74    if (context == EGL_NO_CONTEXT) {
    7275        WTFLogAlways("Cannot create EGL WPE context: %s\n", lastErrorString());
    7376        wpe_renderer_backend_egl_offscreen_target_destroy(target);
Note: See TracChangeset for help on using the changeset viewer.