compositor-view/native: Check output color state for direct scanout

The stage view color state is not the output color state but usually a
linear version of it. For direct scanout, we need the view color state
to match the output color state instead.

Fixes: 20c7653d49 ("compositor-view/native: Don't scan out surface with color state mismatch")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4196>
This commit is contained in:
Sebastian Wick 2024-12-23 12:46:21 +01:00 committed by Marge Bot
parent e7ff05632d
commit aea1aee79e

View File

@ -159,7 +159,7 @@ find_scanout_candidate (MetaCompositorView *compositor_view,
ClutterActorBox actor_box;
MetaSurfaceActor *surface_actor;
MetaSurfaceActorWayland *surface_actor_wayland;
ClutterColorState *view_color_state;
ClutterColorState *output_color_state;
ClutterColorState *surface_color_state;
MetaWaylandSurface *surface;
@ -290,11 +290,11 @@ find_scanout_candidate (MetaCompositorView *compositor_view,
return FALSE;
}
view_color_state =
clutter_stage_view_get_color_state (CLUTTER_STAGE_VIEW (view));
output_color_state =
clutter_stage_view_get_output_color_state (CLUTTER_STAGE_VIEW (view));
surface_color_state =
clutter_actor_get_color_state (CLUTTER_ACTOR (surface_actor));
if (!clutter_color_state_equals (view_color_state, surface_color_state))
if (!clutter_color_state_equals (output_color_state, surface_color_state))
{
meta_topic (META_DEBUG_RENDER,
"No direct scanout candidate: "