Bug 1946586 - Set opaque region even without an EGL window. r=stransky, a=dsmith

Differential Revision: https://phabricator.services.mozilla.com/D254738
This commit is contained in:
Emilio Cobos Álvarez
2025-06-24 09:13:01 +00:00
committed by dsmith@mozilla.com
parent 97039c7694
commit 1680854f3b
2 changed files with 5 additions and 21 deletions

View File

@@ -272,10 +272,8 @@ static bool moz_container_wayland_ensure_surface(MozContainer* container,
surface->EnableCeiledScaleLocked(lock);
}
if (MOZ_WL_CONTAINER(container)->opaque_region_needs_updates) {
surface->SetOpaqueRegionLocked(lock,
window->GetOpaqueRegion().ToUnknownRegion());
}
surface->DisableUserInputLocked(lock);
// Commit eplicitly now as moz_container_wayland_invalidate() initiated
@@ -305,23 +303,11 @@ struct wl_egl_window* moz_container_wayland_get_egl_window(
return MOZ_WL_SURFACE(container)->GetEGLWindow(unscaledSize);
}
gboolean moz_container_wayland_has_egl_window(MozContainer* container) {
return MOZ_WL_SURFACE(container)->HasEGLWindow();
}
void moz_container_wayland_update_opaque_region(MozContainer* container) {
MOZ_WL_CONTAINER(container)->opaque_region_needs_updates = true;
// When GL compositor / WebRender is used,
// moz_container_wayland_get_egl_window() is called only once when window
// is created or resized so update opaque region now.
if (MOZ_WL_SURFACE(container)->HasEGLWindow()) {
MOZ_WL_CONTAINER(container)->opaque_region_needs_updates = false;
nsWindow* window = moz_container_get_nsWindow(container);
MOZ_WL_SURFACE(container)->SetOpaqueRegion(
window->GetOpaqueRegion().ToUnknownRegion());
}
}
gboolean moz_container_wayland_can_draw(MozContainer* container) {
return MOZ_WL_SURFACE(container)->IsReadyToDraw();

View File

@@ -43,7 +43,6 @@ struct MozContainerWayland {
: mSurface(aSurface) {}
RefPtr<mozilla::widget::WaylandSurface> mSurface;
gboolean opaque_region_needs_updates = false;
gboolean before_first_size_alloc = false;
gboolean waiting_to_show = false;
};
@@ -56,7 +55,6 @@ void moz_container_wayland_unmap(GtkWidget*);
struct wl_egl_window* moz_container_wayland_get_egl_window(
MozContainer* container);
gboolean moz_container_wayland_has_egl_window(MozContainer* container);
void moz_container_wayland_add_or_fire_initial_draw_callback(
MozContainer* container, const std::function<void(void)>& initial_draw_cb);