1 #ifndef __CLUTTER_DEBUG_H__
2 #define __CLUTTER_DEBUG_H__
5 #include "clutter-main.h"
10 CLUTTER_DEBUG_MISC = 1 << 0,
11 CLUTTER_DEBUG_ACTOR = 1 << 1,
12 CLUTTER_DEBUG_TEXTURE = 1 << 2,
13 CLUTTER_DEBUG_EVENT = 1 << 3,
14 CLUTTER_DEBUG_PAINT = 1 << 4,
15 CLUTTER_DEBUG_PANGO = 1 << 5,
16 CLUTTER_DEBUG_BACKEND = 1 << 6,
17 CLUTTER_DEBUG_SCHEDULER = 1 << 7,
18 CLUTTER_DEBUG_SCRIPT = 1 << 8,
19 CLUTTER_DEBUG_SHADER = 1 << 9,
20 CLUTTER_DEBUG_MULTISTAGE = 1 << 10,
21 CLUTTER_DEBUG_ANIMATION = 1 << 11,
22 CLUTTER_DEBUG_LAYOUT = 1 << 12,
23 CLUTTER_DEBUG_PICK = 1 << 13,
24 CLUTTER_DEBUG_EVENTLOOP = 1 << 14,
25 CLUTTER_DEBUG_CLIPPING = 1 << 15,
26 CLUTTER_DEBUG_OOB_TRANSFORMS = 1 << 16
30 CLUTTER_DEBUG_NOP_PICKING = 1 << 0,
31 CLUTTER_DEBUG_DUMP_PICK_BUFFERS = 1 << 1
32 } ClutterPickDebugFlag;
35 CLUTTER_DEBUG_DISABLE_SWAP_EVENTS = 1 << 0,
36 CLUTTER_DEBUG_DISABLE_CLIPPED_REDRAWS = 1 << 1,
37 CLUTTER_DEBUG_REDRAWS = 1 << 2,
38 CLUTTER_DEBUG_PAINT_VOLUMES = 1 << 3,
39 CLUTTER_DEBUG_DISABLE_CULLING = 1 << 4,
40 CLUTTER_DEBUG_DISABLE_OFFSCREEN_REDIRECT = 1 << 5,
41 CLUTTER_DEBUG_CONTINUOUS_REDRAW = 1 << 6,
42 CLUTTER_DEBUG_PAINT_DEFORM_TILES = 1 << 7
43 } ClutterDrawDebugFlag;
45 #ifdef CLUTTER_ENABLE_DEBUG
47 #define CLUTTER_HAS_DEBUG(type) ((clutter_debug_flags & CLUTTER_DEBUG_##type) != FALSE)
51 /* Try the GCC extension for valists in macros */
52 #define CLUTTER_NOTE(type,x,a...) G_STMT_START { \
53 if (G_UNLIKELY (CLUTTER_HAS_DEBUG (type))) { \
54 _clutter_debug_message ("[" #type "]:" G_STRLOC ": " x, ##a); \
58 /* Try the C99 version; unfortunately, this does not allow us to pass
59 * empty arguments to the macro, which means we have to
60 * do an intemediate printf.
62 #define CLUTTER_NOTE(type,...) G_STMT_START { \
63 if (G_UNLIKELY (CLUTTER_HAS_DEBUG (type))) { \
64 gchar *_fmt = g_strdup_printf (__VA_ARGS__); \
65 _clutter_debug_message ("[" #type "]:" G_STRLOC ": %s", _fmt); \
70 #else /* !CLUTTER_ENABLE_DEBUG */
72 #define CLUTTER_NOTE(type,...) G_STMT_START { } G_STMT_END
73 #define CLUTTER_HAS_DEBUG(type) FALSE
75 #endif /* CLUTTER_ENABLE_DEBUG */
77 extern guint clutter_debug_flags;
78 extern guint clutter_pick_debug_flags;
79 extern guint clutter_paint_debug_flags;
81 void _clutter_debug_messagev (const char *format,
83 void _clutter_debug_message (const char *format,
88 #endif /* __CLUTTER_DEBUG_H__ */