From: Matthias Clasen Date: Fri, 23 Sep 2022 01:35:24 +0000 (-0400) Subject: gsk: Introduce new debug macros X-Git-Tag: archive/raspbian/4.8.3+ds-2+rpi1~3^2~20^2~1^2~39^2~6 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=4d08eb264d6e5fca203c48e2523f9d1f56a31505;p=gtk4.git gsk: Introduce new debug macros Introduce GSK_RENDERER_DEBUG() and GSK_DEBUG(), which mirror the new macros in gdk. They use the same helper function gdk_debug_message(). --- diff --git a/gsk/gskdebugprivate.h b/gsk/gskdebugprivate.h index 345c1555ab..a8a69dafc3 100644 --- a/gsk/gskdebugprivate.h +++ b/gsk/gskdebugprivate.h @@ -2,6 +2,7 @@ #define __GSK_DEBUG_PRIVATE_H__ #include +#include "gdk/gdkdebug.h" G_BEGIN_DECLS @@ -41,8 +42,15 @@ gboolean gsk_check_debug_flags (GskDebugFlags flags); } } G_STMT_END #define GSK_RENDERER_NOTE(renderer,type,action) G_STMT_START { \ if (GSK_RENDERER_DEBUG_CHECK (renderer,type)) { \ - action; \ - } } G_STMT_END + action; + +#define GSK_RENDERER_DEBUG(renderer,type,...) \ + if (GSK_RENDERER_DEBUG_CHECK (renderer,type)) \ + gdk_debug_message (__VA_ARGS__); \ + +#define GSK_DEBUG(type,...) \ + if (GSK_DEBUG_CHECK (type)) \ + gdk_debug_message (__VA_ARGS__); \ #else @@ -50,6 +58,8 @@ gboolean gsk_check_debug_flags (GskDebugFlags flags); #define GSK_RENDERER_DEBUG_CHECK(renderer,type) 0 #define GSK_NOTE(type,action) #define GSK_RENDERER_NOTE(renderer,type,action) +#define GSK_RENDERER_DEBUG(display,type,...) +#define GSK_DEBUG(type,...) #endif