[gtk+] Record node names for debug output
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Record node names for debug output
- Date: Sun, 3 Sep 2017 16:01:17 +0000 (UTC)
commit a05895e029a2461c1eb893c652cc9cc9faa80d29
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Sep 3 11:29:29 2017 -0400
Record node names for debug output
This is useful for GSK_NOTE output as well.
gsk/gskdebugprivate.h | 2 ++
gtk/gtkwidget.c | 10 +++++++++-
2 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/gsk/gskdebugprivate.h b/gsk/gskdebugprivate.h
index 5a3f58d..0f82c80 100644
--- a/gsk/gskdebugprivate.h
+++ b/gsk/gskdebugprivate.h
@@ -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,
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index b2e13df..9042af9 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]