Title: [243284] trunk/Source/WebCore
Revision
243284
Author
[email protected]
Date
2019-03-21 02:44:22 -0700 (Thu, 21 Mar 2019)

Log 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.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (243283 => 243284)


--- trunk/Source/WebCore/ChangeLog	2019-03-21 09:43:15 UTC (rev 243283)
+++ trunk/Source/WebCore/ChangeLog	2019-03-21 09:44:22 UTC (rev 243284)
@@ -1,3 +1,28 @@
+2019-03-21  Carlos Garcia Campos  <[email protected]>
+
+        [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.
+
 2019-03-20  Yusuke Suzuki  <[email protected]>
 
         [JSC] Use finalizer in JSGlobalLexicalEnvironment and JSGlobalObject

Modified: trunk/Source/WebCore/platform/graphics/egl/GLContextEGL.cpp (243283 => 243284)


--- trunk/Source/WebCore/platform/graphics/egl/GLContextEGL.cpp	2019-03-21 09:43:15 UTC (rev 243283)
+++ trunk/Source/WebCore/platform/graphics/egl/GLContextEGL.cpp	2019-03-21 09:44:22 UTC (rev 243284)
@@ -233,10 +233,8 @@
     }
 
     const char* extensions = eglQueryString(display, EGL_EXTENSIONS);
-    if (!GLContext::isExtensionSupported(extensions, "EGL_KHR_surfaceless_context") && !GLContext::isExtensionSupported(extensions, "EGL_KHR_surfaceless_opengl")) {
-        WTFLogAlways("Cannot create EGL surfaceless context: missing EGL_KHR_surfaceless_{context,opengl} extension.\n");
+    if (!GLContext::isExtensionSupported(extensions, "EGL_KHR_surfaceless_context") && !GLContext::isExtensionSupported(extensions, "EGL_KHR_surfaceless_opengl"))
         return nullptr;
-    }
 
     EGLConfig config;
     if (!getEGLConfig(display, &config, Surfaceless)) {

Modified: trunk/Source/WebCore/platform/graphics/egl/GLContextEGLLibWPE.cpp (243283 => 243284)


--- trunk/Source/WebCore/platform/graphics/egl/GLContextEGLLibWPE.cpp	2019-03-21 09:43:15 UTC (rev 243283)
+++ trunk/Source/WebCore/platform/graphics/egl/GLContextEGLLibWPE.cpp	2019-03-21 09:44:22 UTC (rev 243284)
@@ -59,16 +59,19 @@
         return nullptr;
     }
 
-    EGLContext context = createContextForEGLVersion(platformDisplay, config, sharingContext);
-    if (context == EGL_NO_CONTEXT) {
-        WTFLogAlways("Cannot create EGL WPE context: %s\n", lastErrorString());
+    auto* target = wpe_renderer_backend_egl_offscreen_target_create();
+    if (!target)
         return nullptr;
-    }
 
-    auto* target = wpe_renderer_backend_egl_offscreen_target_create();
     wpe_renderer_backend_egl_offscreen_target_initialize(target, downcast<PlatformDisplayLibWPE>(platformDisplay).backend());
     EGLNativeWindowType window = wpe_renderer_backend_egl_offscreen_target_get_native_window(target);
     if (!window) {
+        wpe_renderer_backend_egl_offscreen_target_destroy(target);
+        return nullptr;
+    }
+
+    EGLContext context = createContextForEGLVersion(platformDisplay, config, sharingContext);
+    if (context == EGL_NO_CONTEXT) {
         WTFLogAlways("Cannot create EGL WPE context: %s\n", lastErrorString());
         wpe_renderer_backend_egl_offscreen_target_destroy(target);
         return nullptr;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to