summaryrefslogtreecommitdiffstats
path: root/gfx/gl/GLContextProviderEGL.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:34:42 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:34:42 +0000
commitda4c7e7ed675c3bf405668739c3012d140856109 (patch)
treecdd868dba063fecba609a1d819de271f0d51b23e /gfx/gl/GLContextProviderEGL.cpp
parentAdding upstream version 125.0.3. (diff)
downloadfirefox-da4c7e7ed675c3bf405668739c3012d140856109.tar.xz
firefox-da4c7e7ed675c3bf405668739c3012d140856109.zip
Adding upstream version 126.0.upstream/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;
}