diff options
author | Matthias Clasen <mclasen@redhat.com> | 2021-03-29 19:18:44 +0000 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2021-03-29 19:18:44 +0000 |
commit | ce13859046ac37ba94c6a5727c221b0b97e90a9e (patch) | |
tree | 263f6548706be5acbd6ba91a71252904cb21c757 /pango/pangofc-shape.c | |
parent | 5ccc0c7aa5de2667a5e0da8c35387eb662c3edff (diff) | |
parent | b86ded710d391b78842c607962d9a2281596b862 (diff) | |
download | pango-ce13859046ac37ba94c6a5727c221b0b97e90a9e.tar.gz |
Merge branch 'misc-speedups' into 'master'
Misc speedups
See merge request GNOME/pango!306
Diffstat (limited to 'pango/pangofc-shape.c')
-rw-r--r-- | pango/pangofc-shape.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/pango/pangofc-shape.c b/pango/pangofc-shape.c index 5c716b24..0a5ce7f9 100644 --- a/pango/pangofc-shape.c +++ b/pango/pangofc-shape.c @@ -151,18 +151,10 @@ pango_hb_font_get_nominal_glyph (hb_font_t *font, { PangoHbShapeContext *context = (PangoHbShapeContext *) font_data; - if ((context->show_flags & PANGO_SHOW_IGNORABLES) != 0) + if (context->show_flags != 0) { - if (pango_get_ignorable (unicode)) - { - *glyph = PANGO_GET_UNKNOWN_GLYPH (unicode); - return TRUE; - } - } - - if ((context->show_flags & PANGO_SHOW_SPACES) != 0) - { - if (g_unichar_type (unicode) == G_UNICODE_SPACE_SEPARATOR) + if ((context->show_flags & PANGO_SHOW_SPACES) != 0 && + g_unichar_type (unicode) == G_UNICODE_SPACE_SEPARATOR) { /* Replace 0x20 by visible space, since we * don't draw a hex box for 0x20 @@ -173,11 +165,16 @@ pango_hb_font_get_nominal_glyph (hb_font_t *font, *glyph = PANGO_GET_UNKNOWN_GLYPH (unicode); return TRUE; } - } - if ((context->show_flags & PANGO_SHOW_LINE_BREAKS) != 0) - { - if (unicode == 0x2028) + if ((context->show_flags & PANGO_SHOW_IGNORABLES) != 0 && + pango_get_ignorable (unicode)) + { + *glyph = PANGO_GET_UNKNOWN_GLYPH (unicode); + return TRUE; + } + + if ((context->show_flags & PANGO_SHOW_LINE_BREAKS) != 0 && + unicode == 0x2028) { /* Always mark LS as unknown. If it ends up * at the line end, PangoLayout takes care of |