Bug 220183 - [GTK][CMake] Add a build switch USE_OPENGL_OR_ES to be able to disable OpenGL and ES
Summary: [GTK][CMake] Add a build switch USE_OPENGL_OR_ES to be able to disable OpenGL...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Fujii Hironori
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-28 07:22 PST by monson
Modified: 2021-01-06 16:50 PST (History)
10 users (show)

See Also:


Attachments
Patch (4.75 KB, patch)
2020-12-30 14:17 PST, Fujii Hironori
no flags Details | Formatted Diff | Diff
Patch (4.97 KB, patch)
2020-12-30 14:24 PST, Fujii Hironori
no flags Details | Formatted Diff | Diff
it's also needed to disable USE_GSTREAMER_GL (5.32 KB, patch)
2020-12-31 04:48 PST, Charlene Wendling
no flags Details | Formatted Diff | Diff
Patch (5.06 KB, patch)
2020-12-31 13:31 PST, Fujii Hironori
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description monson 2020-12-28 07:22:36 PST
In bug 219551, ENABLE_GRAPHICS_CONTEXT_GL was removed, leaving ENABLE_GLES2 only to control whether using OPENGL or GLES2. But there is a situation where we have neither of them, with the dependency-inferring removed, some webkit options (ENABLE_ASYNC_SCROLLING, USE_GSTREAMER_GL and maybe ENABLE_3D_TRANSFORMS, and of course ENABLE_WEBGL) may be broken because of lack of GL API.

We hope to bring back ENABLE_GRAPHICS_CONTEXT_GL (or in whatever name), or a mechanism of auto disabling GL-related options.

Maybe relate to bug 219916.

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

> Source/cmake/OptionsGTK.cmake:-113
> -WEBKIT_OPTION_DEPEND(ENABLE_3D_TRANSFORMS ENABLE_GRAPHICS_CONTEXT_GL)
> -WEBKIT_OPTION_DEPEND(ENABLE_ASYNC_SCROLLING ENABLE_GRAPHICS_CONTEXT_GL)
> -WEBKIT_OPTION_DEPEND(ENABLE_GLES2 ENABLE_GRAPHICS_CONTEXT_GL)
> -WEBKIT_OPTION_DEPEND(ENABLE_WEBGL ENABLE_GRAPHICS_CONTEXT_GL)
>  WEBKIT_OPTION_DEPEND(USE_ANGLE_WEBGL ENABLE_WEBGL)
> -WEBKIT_OPTION_DEPEND(USE_WPE_RENDERER ENABLE_GRAPHICS_CONTEXT_GL)
Comment 1 Fujii Hironori 2020-12-30 14:17:33 PST
Created attachment 416851 [details]
Patch
Comment 2 Fujii Hironori 2020-12-30 14:24:38 PST
Created attachment 416852 [details]
Patch
Comment 3 Fujii Hironori 2020-12-30 14:28:37 PST
What do you think about this patch? Could you test the patch on your platform?
Comment 4 Charlene Wendling 2020-12-31 04:48:18 PST
Created attachment 416862 [details]
it's also needed to disable USE_GSTREAMER_GL

Hi,

Thanks for taking care of this!

I've tried your patch against the latest WebKit sources on OpenBSD/amd64,
the build failed because it still defines USE_GSTREAMER_GL, so there are
missing symbols. 

I'm attaching your patch with an addition; i made USE_GSTREAMER_GL depends
on USE_OPENGL_OR_ES.

Then it builds properly on this platform; runtime is fine as long i don't play
videos, in such a case the web process crash with:

"WebKit wasn't able to find a WebVTT encoder. Not continuing without platform support for subtitles."

When using our package, and as such with GL enabled, the webprocess does
not crash, while displaying the same message about WebVTT. This is not a deal
breaker as far as i'm concerned, i can disable USE_VIDEO -- but i'm pretty sure
you won't have the same point of view.

I can't try on OpenBSD/macppc for the moment (that's where that new option
really matters for the OpenBSD port), but it should cause no issue.
Comment 5 Fujii Hironori 2020-12-31 12:25:17 PST
Comment on attachment 416862 [details]
it's also needed to disable USE_GSTREAMER_GL

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

Thank you very much for the testing.

> Source/cmake/GStreamerDependencies.cmake:1
> +WEBKIT_OPTION_DEPEND(USE_GSTREAMER_GL USE_OPENGL_OR_ES)

Hmm, this file is also used by WPE port which always uses OpenGL and doesn't have USE_OPENGL_OR_ES build switch.
Comment 6 Fujii Hironori 2020-12-31 13:31:19 PST
Created attachment 416871 [details]
Patch
Comment 7 Fujii Hironori 2021-01-02 13:24:55 PST
Hi Charlene and Monson, could you debug the video issue in another bug ticket? It seems that GTK port maintainers aren't interested in no OpenGL build configuration.
Comment 8 Fujii Hironori 2021-01-04 12:24:53 PST
If nobody is willing to maintaining the no OpenGL build configuration, WebKitGTK should remove those compilation switches.
Comment 9 monson 2021-01-06 05:33:53 PST
Comment on attachment 416871 [details]
Patch

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

> Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp:35
> +#include <X11/Xutil.h>

Looks good to me but I don't speak for this X11 line, because I'm mainly building GTK port on macos, not familiar with X11 target nor WPE port.
Comment 10 Kenneth Russell 2021-01-06 10:39:52 PST
Comment on attachment 416871 [details]
Patch

In case you still need a review, upon glance this looks fine to me - but if there are other stakeholders who aren't reviewers, please wait for their go-ahead. r+
Comment 11 Fujii Hironori 2021-01-06 16:50:50 PST
Comment on attachment 416871 [details]
Patch

Clearing flags on attachment: 416871

Committed r271220: <https://trac.webkit.org/changeset/271220>
Comment 12 Fujii Hironori 2021-01-06 16:50:55 PST
All reviewed patches have been landed.  Closing bug.