From e68f58940c6ca047c05d69f21b441706043cff1a Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 10 Jul 2024 07:52:25 -0400 Subject: [PATCH] offload: Add more debug spew Print what transform we are passing to the compositor. Helps for debugging transforms. --- gdk/wayland/gdksubsurface-wayland.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/gdk/wayland/gdksubsurface-wayland.c b/gdk/wayland/gdksubsurface-wayland.c index ddae752a0d..ca4165e3c8 100644 --- a/gdk/wayland/gdksubsurface-wayland.c +++ b/gdk/wayland/gdksubsurface-wayland.c @@ -247,6 +247,14 @@ gdk_texture_transform_to_wl (GdkDihedral transform) return (enum wl_output_transform) transform; } +static inline const char * +transform_name (GdkDihedral transform) +{ + const char *name[] = { "normal", "90", "180", "270", "flipped", "flipped 90", "flipped 180", "flipped 270" }; + + return name[transform]; +} + static inline GdkDihedral wl_output_transform_to_gdk (enum wl_output_transform transform) { @@ -503,7 +511,7 @@ gdk_wayland_subsurface_attach (GdkSubsurface *sub, } GDK_DISPLAY_DEBUG (gdk_surface_get_display (sub->parent), OFFLOAD, - "[%p] %s Attaching texture (%dx%d) at %d %d %d %d", + "[%p] %s Attaching texture (%dx%d) at %d %d %d %d%s%s%s", self, will_be_above ? (has_background ? "▲" : "△") @@ -511,7 +519,11 @@ gdk_wayland_subsurface_attach (GdkSubsurface *sub, gdk_texture_get_width (texture), gdk_texture_get_height (texture), self->dest.x, self->dest.y, - self->dest.width, self->dest.height); + self->dest.width, self->dest.height, + transform != GDK_DIHEDRAL_NORMAL ? " (" : "", + transform != GDK_DIHEDRAL_NORMAL ? transform_name (transform): "", + transform != GDK_DIHEDRAL_NORMAL ? " )" : "" + ); result = TRUE; } else