diff options
author | Matthias Clasen <mclasen@redhat.com> | 2017-09-03 10:30:32 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2017-09-03 10:30:32 -0400 |
commit | eab50246e14e57af9a506e09c1e9c1c8cf0a5a19 (patch) | |
tree | 2ebacfb450188a9302c21fcb16e9d797639ece69 /gtk/gskpango.c | |
parent | 68631d6dbddf32daf59683a52cfad332d63e217b (diff) | |
download | gtk+-eab50246e14e57af9a506e09c1e9c1c8cf0a5a19.tar.gz |
Only record node names when we should
This is the same thing we do for render nodes elsewhere.
Diffstat (limited to 'gtk/gskpango.c')
-rw-r--r-- | gtk/gskpango.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gtk/gskpango.c b/gtk/gskpango.c index a73f25cae0..5263e1c950 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); |