Bug 195742

Summary: [WPE] Confusing messages in stderr when surfaceless context is not supported
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: WPE WebKitAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: aperez, bugs-noreply, magomez, zan
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch zan: review+

Description Carlos Garcia Campos 2019-03-14 05:16:52 PDT
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 backend don't implement the interface (they actually have an empty implementation).
Comment 1 Carlos Garcia Campos 2019-03-14 05:24:13 PDT
Created attachment 364654 [details]
Patch
Comment 2 Adrian Perez 2019-03-14 16:09:35 PDT
(In reply to Carlos Garcia Campos from comment #0)
> 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.
> [...]

I have to admit the first time I noticed these messages they
were indeed confusing; it will be good to just go ahead and
remove them, IMO.
Comment 3 Zan Dobersek 2019-03-15 07:48:52 PDT
Comment on attachment 364654 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=364654&action=review

> Source/WebCore/platform/graphics/egl/GLContextEGLLibWPE.cpp:77
> +    if (context == EGL_NO_CONTEXT) {
> +        WTFLogAlways("Cannot create EGL WPE context: %s\n", lastErrorString());
> +        return nullptr;
> +    }

This needs to destroy the offscreen target before returning early.
Comment 4 Carlos Garcia Campos 2019-03-15 08:27:39 PDT
Comment on attachment 364654 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=364654&action=review

>> Source/WebCore/platform/graphics/egl/GLContextEGLLibWPE.cpp:77
>> +    }
> 
> This needs to destroy the offscreen target before returning early.

Right! I fixed the context leak to introduce a target leak :-P
Comment 5 Carlos Garcia Campos 2019-03-20 05:54:38 PDT
Created attachment 365341 [details]
Patch
Comment 6 Carlos Garcia Campos 2019-03-21 02:44:28 PDT
Committed r243284: <https://trac.webkit.org/changeset/243284>