[gtk/glyphy2: 25/29] glyphy: Cosmetics




commit f4761ef618f5a5c85d89ab8f7da5431552f8ff60
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Apr 4 00:35:53 2022 -0400

    glyphy: Cosmetics

 gsk/gl/gskglglyphylibrary.c        | 4 ++++
 gsk/gl/gskglglyphylibraryprivate.h | 6 ++++--
 gsk/gl/gskglrenderjob.c            | 4 ++--
 3 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/gsk/gl/gskglglyphylibrary.c b/gsk/gl/gskglglyphylibrary.c
index 6443e09f95..fd5d1d503a 100644
--- a/gsk/gl/gskglglyphylibrary.c
+++ b/gsk/gl/gskglglyphylibrary.c
@@ -184,12 +184,16 @@ gsk_gl_glyphy_library_finalize (GObject *object)
   G_OBJECT_CLASS (gsk_gl_glyphy_library_parent_class)->finalize (object);
 }
 
+GQuark quark_glyphy_font_key;
+
 static void
 gsk_gl_glyphy_library_class_init (GskGLGlyphyLibraryClass *klass)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
   GskGLTextureLibraryClass *library_class = GSK_GL_TEXTURE_LIBRARY_CLASS (klass);
 
+  quark_glyphy_font_key = g_quark_from_static_string ("glyphy-font-key");
+
   object_class->finalize = gsk_gl_glyphy_library_finalize;
 
   library_class->allocate = gsk_gl_glyphy_library_allocate;
diff --git a/gsk/gl/gskglglyphylibraryprivate.h b/gsk/gl/gskglglyphylibraryprivate.h
index 651668bd87..fece808bcd 100644
--- a/gsk/gl/gskglglyphylibraryprivate.h
+++ b/gsk/gl/gskglglyphylibraryprivate.h
@@ -32,19 +32,21 @@ G_BEGIN_DECLS
 
 typedef guint FontKey;
 
+extern GQuark quark_glyphy_font_key;
+
 static inline FontKey
 gsk_gl_glyphy_library_get_font_key (PangoFont *font)
 {
   FontKey key;
 
-  key = (FontKey) GPOINTER_TO_UINT (g_object_get_data ((GObject *)font, "glyphy-font-key"));
+  key = (FontKey) GPOINTER_TO_UINT (g_object_get_qdata ((GObject *)font, quark_glyphy_font_key));
   if (key == 0)
     {
       PangoFontDescription *desc = pango_font_describe (font);
       pango_font_description_set_size (desc, 10 * PANGO_SCALE);
       key = (FontKey) pango_font_description_hash (desc);
       pango_font_description_free (desc);
-      g_object_set_data ((GObject *)font, "glyphy-font-key", GUINT_TO_POINTER (key));
+      g_object_set_qdata ((GObject *)font, quark_glyphy_font_key, GUINT_TO_POINTER (key));
     }
 
   return key;
diff --git a/gsk/gl/gskglrenderjob.c b/gsk/gl/gskglrenderjob.c
index 59b272bd6c..963ecf401a 100644
--- a/gsk/gl/gskglrenderjob.c
+++ b/gsk/gl/gskglrenderjob.c
@@ -3076,7 +3076,7 @@ typedef struct
   float g16lo;
 } EncodedGlyph;
 
-static unsigned int
+static inline unsigned int
 glyph_encode (guint atlas_x ,  /* 7 bits */
               guint atlas_y,   /* 7 bits */
               guint corner_x,  /* 1 bit */
@@ -3099,7 +3099,7 @@ glyph_encode (guint atlas_x ,  /* 7 bits */
   return (x << 16) | y;
 }
 
-static void
+static inline void
 encoded_glyph_init (EncodedGlyph           *eg,
                     float                   x,
                     float                   y,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]