summaryrefslogtreecommitdiffstats
path: root/gfx/gl
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:34:50 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:34:50 +0000
commitdef92d1b8e9d373e2f6f27c366d578d97d8960c6 (patch)
tree2ef34b9ad8bb9a9220e05d60352558b15f513894 /gfx/gl
parentAdding debian version 125.0.3-1. (diff)
downloadfirefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.tar.xz
firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.zip
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gfx/gl')
-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;
}