summaryrefslogtreecommitdiffstats
path: root/gfx/gl/GLContextProviderEGL.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
commitd8bbc7858622b6d9c278469aab701ca0b609cddf (patch)
treeeff41dc61d9f714852212739e6b3738b82a2af87 /gfx/gl/GLContextProviderEGL.cpp
parentReleasing progress-linux version 125.0.3-1~progress7.99u1. (diff)
downloadfirefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz
firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gfx/gl/GLContextProviderEGL.cpp')
-rw-r--r--gfx/gl/GLContextProviderEGL.cpp42
1 files changed, 19 insertions, 23 deletions
diff --git a/gfx/gl/GLContextProviderEGL.cpp b/gfx/gl/GLContextProviderEGL.cpp
index cb47e285a5..ffd32202e5 100644
--- a/gfx/gl/GLContextProviderEGL.cpp
+++ b/gfx/gl/GLContextProviderEGL.cpp
@@ -336,23 +336,29 @@ EGLSurface GLContextEGL::CreateEGLSurfaceForCompositorWidget(
}
MOZ_ASSERT(aCompositorWidget);
-#ifdef MOZ_WAYLAND
- // RenderCompositorEGL does not like EGL_NO_SURFACE as it fallbacks
- // to SW rendering or claims itself as paused.
- // In case we're missing valid native window because aCompositorWidget hidden,
- // just create a fallback EGLSurface.
- // Actual EGLSurface will be created by widget code later when
- // aCompositorWidget becomes visible.
- if (widget::GdkIsWaylandDisplay() && aCompositorWidget->IsHidden()) {
- mozilla::gfx::IntSize pbSize(16, 16);
- return CreateWaylandOffscreenSurface(*egl, aConfig, pbSize);
- }
-#endif
EGLNativeWindowType window =
GET_NATIVE_WINDOW_FROM_COMPOSITOR_WIDGET(aCompositorWidget);
if (!window) {
+#ifdef MOZ_WIDGET_GTK
+ // RenderCompositorEGL does not like EGL_NO_SURFACE as it fallbacks
+ // to SW rendering or claims itself as paused.
+ // In case we're missing valid native window because aCompositorWidget
+ // hidden, just create a fallback EGLSurface. Actual EGLSurface will be
+ // created by widget code later when aCompositorWidget becomes visible.
+ mozilla::gfx::IntSize pbSize(16, 16);
+# ifdef MOZ_WAYLAND
+ if (GdkIsWaylandDisplay()) {
+ return CreateWaylandOffscreenSurface(*egl, aConfig, pbSize);
+ } else
+# endif
+ {
+ return CreatePBufferSurfaceTryingPowerOfTwo(*egl, aConfig, LOCAL_EGL_NONE,
+ pbSize);
+ }
+#else
gfxCriticalNote << "window is null";
return EGL_NO_SURFACE;
+#endif
}
return mozilla::gl::CreateSurfaceFromNativeWindow(*egl, window, aConfig);
@@ -486,16 +492,6 @@ bool GLContextEGL::RenewSurface(CompositorWidget* aWidget) {
EGLNativeWindowType nativeWindow =
GET_NATIVE_WINDOW_FROM_COMPOSITOR_WIDGET(aWidget);
-#ifdef MOZ_WAYLAND
- // In case we're missing native window on Wayland CompositorWidget is hidden.
- // Don't create a fallback EGL surface but fails here.
- // We need to repeat RenewSurface() when native window is available
- // (CompositorWidget becomes visible).
- if (GdkIsWaylandDisplay()) {
- NS_WARNING("Failed to get native window");
- return false;
- }
-#endif
if (nativeWindow) {
mSurface = mozilla::gl::CreateSurfaceFromNativeWindow(*mEgl, nativeWindow,
mSurfaceConfig);
@@ -974,7 +970,7 @@ bool CreateConfig(EglDisplay& aEgl, EGLConfig* aConfig, int32_t aDepth,
static bool CreateConfigScreen(EglDisplay& egl, EGLConfig* const aConfig,
const bool aEnableDepthBuffer,
const bool aUseGles) {
- int32_t depth = gfxVars::ScreenDepth();
+ int32_t depth = gfxVars::PrimaryScreenDepth();
if (CreateConfig(egl, aConfig, depth, aEnableDepthBuffer, aUseGles)) {
return true;
}