Record node names for debug output

This is useful for GSK_NOTE output as well.
This commit is contained in:
Matthias Clasen 2017-09-03 11:29:29 -04:00
parent 8db13c3362
commit a05895e029
2 changed files with 11 additions and 1 deletions

View File

@ -17,6 +17,8 @@ typedef enum {
GSK_DEBUG_FALLBACK = 1 << 8
} GskDebugFlags;
#define GSK_DEBUG_ANY ((1 << 9) - 1)
typedef enum {
GSK_RENDERING_MODE_GEOMETRY = 1 << 0,
GSK_RENDERING_MODE_SHADERS = 1 << 1,

View File

@ -73,6 +73,7 @@
#include "gtkrenderbackgroundprivate.h"
#include "gtkcssshadowsvalueprivate.h"
#include "gtkdebugupdatesprivate.h"
#include "gsk/gskdebugprivate.h"
#include "inspector/window.h"
@ -15223,6 +15224,13 @@ gtk_widget_snapshot (GtkWidget *widget,
gtk_snapshot_pop (snapshot);
}
static gboolean
should_record_names (GtkWidget *widget)
{
return gtk_inspector_is_recording (widget) ||
gsk_check_debug_flags (GSK_DEBUG_ANY);
}
void
gtk_widget_render (GtkWidget *widget,
GdkWindow *window,
@ -15247,7 +15255,7 @@ gtk_widget_render (GtkWidget *widget,
gtk_snapshot_init (&snapshot,
renderer,
gtk_inspector_is_recording (widget),
should_record_names (widget),
clip,
"Render<%s>", G_OBJECT_TYPE_NAME (widget));
cairo_region_destroy (clip);