[gtk+] Only record node names when we should
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Only record node names when we should
- Date: Sun, 3 Sep 2017 14:33:23 +0000 (UTC)
commit eab50246e14e57af9a506e09c1e9c1c8cf0a5a19
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Sep 3 10:30:32 2017 -0400
Only record node names when we should
This is the same thing we do for render nodes elsewhere.
gtk/gskpango.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gskpango.c b/gtk/gskpango.c
index a73f25c..5263e1c 100644
--- a/gtk/gskpango.c
+++ b/gtk/gskpango.c
@@ -21,6 +21,7 @@
#include "gsk/gsk.h"
#include "gskpango.h"
+#include "gtksnapshotprivate.h"
#include <math.h>
@@ -116,7 +117,6 @@ gsk_pango_renderer_show_text_glyphs (PangoRenderer *renderer,
int x_offset, y_offset;
GskRenderNode *node;
GdkRGBA color;
- char name[64];
gtk_snapshot_get_offset (crenderer->snapshot, &x_offset, &y_offset);
@@ -125,8 +125,12 @@ gsk_pango_renderer_show_text_glyphs (PangoRenderer *renderer,
get_color (crenderer, PANGO_RENDER_PART_FOREGROUND, &color);
node = gsk_text_node_new (font, glyphs, &color, x_offset, y_offset, base_x, base_y);
- snprintf (name, sizeof (name), "Glyphs<%d>", glyphs->num_glyphs);
- gsk_render_node_set_name (node, name);
+ if (crenderer->snapshot->record_names)
+ {
+ char name[64];
+ snprintf (name, sizeof (name), "Glyphs<%d>", glyphs->num_glyphs);
+ gsk_render_node_set_name (node, name);
+ }
gtk_snapshot_append_node (crenderer->snapshot, node);
gsk_render_node_unref (node);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]