Merge branch 'ngl-glyph-cache' into 'master'

Ngl glyph cache

See merge request GNOME/gtk!3322
This commit is contained in:
Matthias Clasen 2021-03-19 18:59:33 +00:00
commit b9da74590b
3 changed files with 4 additions and 6 deletions

View File

@ -98,7 +98,6 @@ gsk_ngl_glyph_library_finalize (GObject *object)
{ {
GskNglGlyphLibrary *self = (GskNglGlyphLibrary *)object; GskNglGlyphLibrary *self = (GskNglGlyphLibrary *)object;
g_clear_pointer (&self->hash_table, g_hash_table_unref);
g_clear_pointer (&self->surface_data, g_free); g_clear_pointer (&self->surface_data, g_free);
G_OBJECT_CLASS (gsk_ngl_glyph_library_parent_class)->finalize (object); G_OBJECT_CLASS (gsk_ngl_glyph_library_parent_class)->finalize (object);

View File

@ -55,7 +55,6 @@ G_DECLARE_FINAL_TYPE (GskNglGlyphLibrary, gsk_ngl_glyph_library, GSK, NGL_GLYPH_
struct _GskNglGlyphLibrary struct _GskNglGlyphLibrary
{ {
GskNglTextureLibrary parent_instance; GskNglTextureLibrary parent_instance;
GHashTable *hash_table;
guint8 *surface_data; guint8 *surface_data;
gsize surface_data_len; gsize surface_data_len;
struct { struct {
@ -92,7 +91,7 @@ gsk_ngl_glyph_library_lookup_or_add (GskNglGlyphLibrary *self,
const GskNglGlyphValue **out_value) const GskNglGlyphValue **out_value)
{ {
GskNglTextureAtlasEntry *entry; 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) if (memcmp (key, &self->front[front_index], sizeof *key) == 0)
{ {

View File

@ -459,7 +459,7 @@ gtk_text_tag_class_init (GtkTextTagClass *klass)
/** /**
* GtkTextTag:justification: * GtkTextTag:justification:
* *
* Lett, right, or center justification. * Left, right, or center justification.
*/ */
g_object_class_install_property (object_class, g_object_class_install_property (object_class,
PROP_JUSTIFICATION, PROP_JUSTIFICATION,
@ -951,7 +951,7 @@ gtk_text_tag_class_init (GtkTextTagClass *klass)
/** /**
* GtkTextTag:underline-rgba-set: * 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, ADD_SET_PROP ("underline-rgba-set", PROP_UNDERLINE_RGBA_SET,
P_("Underline RGBA set"), P_("Underline RGBA set"),
@ -968,7 +968,7 @@ gtk_text_tag_class_init (GtkTextTagClass *klass)
/** /**
* GtkTextTag:strikethrough-rgba-set: * 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, ADD_SET_PROP ("strikethrough-rgba-set", PROP_STRIKETHROUGH_RGBA_SET,
P_("Strikethrough RGBA set"), P_("Strikethrough RGBA set"),