From 9981f19409092c19f448423510fc4da34e64512d Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 19 Mar 2021 14:04:27 -0400 Subject: [PATCH 1/3] texttag: A few typo fixes --- gtk/gtktexttag.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gtk/gtktexttag.c b/gtk/gtktexttag.c index 1b33897f69..f8db984825 100644 --- a/gtk/gtktexttag.c +++ b/gtk/gtktexttag.c @@ -459,7 +459,7 @@ gtk_text_tag_class_init (GtkTextTagClass *klass) /** * GtkTextTag:justification: * - * Lett, right, or center justification. + * Left, right, or center justification. */ g_object_class_install_property (object_class, PROP_JUSTIFICATION, @@ -951,7 +951,7 @@ gtk_text_tag_class_init (GtkTextTagClass *klass) /** * GtkTextTag:underline-rgba-set: * - * If the #GtkTextTag:underline-rgba property has been set. + * If the `underline-rgba` property has been set. */ ADD_SET_PROP ("underline-rgba-set", PROP_UNDERLINE_RGBA_SET, P_("Underline RGBA set"), @@ -968,7 +968,7 @@ gtk_text_tag_class_init (GtkTextTagClass *klass) /** * GtkTextTag:strikethrough-rgba-set: * - * If the #GtkTextTag:strikethrough-rgba property has been set. + * If the `strikethrough-rgba` property has been set. */ ADD_SET_PROP ("strikethrough-rgba-set", PROP_STRIKETHROUGH_RGBA_SET, P_("Strikethrough RGBA set"), From 5ac7f7c2f608a195ba2ed43f164d4f0eecb29a60 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 19 Mar 2021 14:05:15 -0400 Subject: [PATCH 2/3] ngl: Drop an unused struct member GskNglGlyphLibrary.hash_table wasn't used. --- gsk/ngl/gsknglglyphlibrary.c | 1 - gsk/ngl/gsknglglyphlibraryprivate.h | 1 - 2 files changed, 2 deletions(-) diff --git a/gsk/ngl/gsknglglyphlibrary.c b/gsk/ngl/gsknglglyphlibrary.c index bc57475c00..502bf01e26 100644 --- a/gsk/ngl/gsknglglyphlibrary.c +++ b/gsk/ngl/gsknglglyphlibrary.c @@ -98,7 +98,6 @@ gsk_ngl_glyph_library_finalize (GObject *object) { GskNglGlyphLibrary *self = (GskNglGlyphLibrary *)object; - g_clear_pointer (&self->hash_table, g_hash_table_unref); g_clear_pointer (&self->surface_data, g_free); G_OBJECT_CLASS (gsk_ngl_glyph_library_parent_class)->finalize (object); diff --git a/gsk/ngl/gsknglglyphlibraryprivate.h b/gsk/ngl/gsknglglyphlibraryprivate.h index 9df9526f99..f48ae6e585 100644 --- a/gsk/ngl/gsknglglyphlibraryprivate.h +++ b/gsk/ngl/gsknglglyphlibraryprivate.h @@ -55,7 +55,6 @@ G_DECLARE_FINAL_TYPE (GskNglGlyphLibrary, gsk_ngl_glyph_library, GSK, NGL_GLYPH_ struct _GskNglGlyphLibrary { GskNglTextureLibrary parent_instance; - GHashTable *hash_table; guint8 *surface_data; gsize surface_data_len; struct { From b253aca883e886a5b5b8eaa770594ad1b77e9afe Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 19 Mar 2021 14:30:19 -0400 Subject: [PATCH 3/3] ngl: Improve the glyph front cache The effectiveness of the front cache is limited by subpixel positioning making it very likely that we will meet the same glyph in different x phases inside a single line of text. Factoring the xphase into the front cache key makes things better. For the string eeeeeeeeeeeeeeeeeee before: 0% front cache hits after: >90% front cache hits --- gsk/ngl/gsknglglyphlibraryprivate.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gsk/ngl/gsknglglyphlibraryprivate.h b/gsk/ngl/gsknglglyphlibraryprivate.h index f48ae6e585..c44068dd50 100644 --- a/gsk/ngl/gsknglglyphlibraryprivate.h +++ b/gsk/ngl/gsknglglyphlibraryprivate.h @@ -91,7 +91,7 @@ gsk_ngl_glyph_library_lookup_or_add (GskNglGlyphLibrary *self, const GskNglGlyphValue **out_value) { GskNglTextureAtlasEntry *entry; - guint front_index = key->glyph & 0xFF; + guint front_index = ((key->glyph << 2) | key->xshift) & 0xFF; if (memcmp (key, &self->front[front_index], sizeof *key) == 0) {