mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 11:36:10 +00:00
LibWeb/WebGL: Specifically request ANGLE Metal backend on macOS
This commit is contained in:
parent
3bdcadc947
commit
6241d06660
1 changed files with 9 additions and 2 deletions
|
@ -79,10 +79,16 @@ static EGLConfig get_egl_config(EGLDisplay display)
|
|||
}
|
||||
#endif
|
||||
|
||||
OwnPtr<OpenGLContext> OpenGLContext::create(NonnullRefPtr<Gfx::SkiaBackendContext> skia_backend_context)
|
||||
OwnPtr<OpenGLContext> OpenGLContext::create(NonnullRefPtr<Gfx::SkiaBackendContext> skia_backend_context, WebGLVersion webgl_version)
|
||||
{
|
||||
#ifdef AK_OS_MACOS
|
||||
EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
|
||||
EGLAttrib display_attributes[] = {
|
||||
EGL_PLATFORM_ANGLE_TYPE_ANGLE,
|
||||
EGL_PLATFORM_ANGLE_TYPE_METAL_ANGLE,
|
||||
EGL_NONE,
|
||||
};
|
||||
|
||||
EGLDisplay display = eglGetPlatformDisplay(EGL_PLATFORM_ANGLE_ANGLE, reinterpret_cast<void*>(EGL_DEFAULT_DISPLAY), display_attributes);
|
||||
if (display == EGL_NO_DISPLAY) {
|
||||
dbgln("Failed to get EGL display");
|
||||
return {};
|
||||
|
@ -115,6 +121,7 @@ OwnPtr<OpenGLContext> OpenGLContext::create(NonnullRefPtr<Gfx::SkiaBackendContex
|
|||
return make<OpenGLContext>(skia_backend_context, Impl { .display = display, .config = config, .context = context }, webgl_version);
|
||||
#else
|
||||
(void)skia_backend_context;
|
||||
(void)webgl_version;
|
||||
return nullptr;
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue