summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2019-05-24 16:28:15 +0000
committerMatthias Clasen <mclasen@redhat.com>2019-07-18 12:47:53 -0700
commit89b8df08725a2da2fe3607fea2231ded1eb5c342 (patch)
tree3fd150cc64c1ca79df859e08133a7664e81ef841
parent9b91930793610304632d887f032d02e058db8259 (diff)
downloadpango-89b8df08725a2da2fe3607fea2231ded1eb5c342.tar.gz
fc: Drop the cmap cache
This is now unused.
-rw-r--r--pango/pangofc-font.c4
-rw-r--r--pango/pangofc-fontmap.c51
-rw-r--r--pango/pangofc-private.h23
3 files changed, 0 insertions, 78 deletions
diff --git a/pango/pangofc-font.c b/pango/pangofc-font.c
index c43781fa..8cbf1ec7 100644
--- a/pango/pangofc-font.c
+++ b/pango/pangofc-font.c
@@ -63,7 +63,6 @@ struct _PangoFcFontPrivate
{
PangoFcDecoder *decoder;
PangoFcFontKey *key;
- PangoFcCmapCache *cmap_cache;
};
static gboolean pango_fc_font_real_has_char (PangoFcFont *font,
@@ -177,9 +176,6 @@ pango_fc_font_finalize (GObject *object)
if (priv->decoder)
_pango_fc_font_set_decoder (fcfont, NULL);
- if (priv->cmap_cache)
- _pango_fc_cmap_cache_unref (priv->cmap_cache);
-
G_OBJECT_CLASS (pango_fc_font_parent_class)->finalize (object);
}
diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c
index cc450d20..0659b078 100644
--- a/pango/pangofc-fontmap.c
+++ b/pango/pangofc-fontmap.c
@@ -166,7 +166,6 @@ struct _PangoFcFontFaceData
/* Data */
FcPattern *pattern; /* Referenced pattern that owns filename */
PangoCoverage *coverage;
- PangoFcCmapCache *cmap_cache;
hb_face_t *hb_face;
};
@@ -299,9 +298,6 @@ pango_fc_font_face_data_free (PangoFcFontFaceData *data)
if (data->coverage)
pango_coverage_unref (data->coverage);
- if (data->cmap_cache)
- _pango_fc_cmap_cache_unref (data->cmap_cache);
-
hb_face_destroy (data->hb_face);
g_slice_free (PangoFcFontFaceData, data);
@@ -1939,53 +1935,6 @@ pango_fc_font_map_get_font_face_data (PangoFcFontMap *fcfontmap,
return data;
}
-static PangoFcCmapCache *
-_pango_fc_cmap_cache_ref (PangoFcCmapCache *cmap_cache)
-{
- g_atomic_int_inc ((int *) &cmap_cache->ref_count);
-
- return cmap_cache;
-}
-
-void
-_pango_fc_cmap_cache_unref (PangoFcCmapCache *cmap_cache)
-{
- g_return_if_fail (cmap_cache->ref_count > 0);
-
- if (g_atomic_int_dec_and_test ((int *) &cmap_cache->ref_count))
- {
- g_free (cmap_cache);
- }
-}
-
-PangoFcCmapCache *
-_pango_fc_font_map_get_cmap_cache (PangoFcFontMap *fcfontmap,
- PangoFcFont *fcfont)
-{
- PangoFcFontFaceData *data;
-
- if (G_UNLIKELY (fcfontmap == NULL))
- return NULL;
-
- if (G_UNLIKELY (!fcfont->font_pattern))
- return NULL;
-
- data = pango_fc_font_map_get_font_face_data (fcfontmap, fcfont->font_pattern);
- if (G_UNLIKELY (!data))
- return NULL;
-
- if (G_UNLIKELY (data->cmap_cache == NULL))
- {
- data->cmap_cache = g_new0 (PangoFcCmapCache, 1);
- data->cmap_cache->ref_count = 1;
-
- /* Make sure all cache entries are invalid initially */
- data->cmap_cache->entries[0].ch = 1; /* char 1 cannot happen in bucket 0 */
- }
-
- return _pango_fc_cmap_cache_ref (data->cmap_cache);
-}
-
typedef struct {
PangoCoverage parent_instance;
diff --git a/pango/pangofc-private.h b/pango/pangofc-private.h
index 5babc536..658d68fe 100644
--- a/pango/pangofc-private.h
+++ b/pango/pangofc-private.h
@@ -43,25 +43,6 @@ struct _PangoFcMetricsInfo
};
-typedef struct _PangoFcCmapCacheEntry PangoFcCmapCacheEntry;
-typedef struct _PangoFcCmapCache PangoFcCmapCache;
-
-#define CMAP_CACHE_NUM_ENTRIES 256 /* should be power of two */
-#define CMAP_CACHE_MASK (CMAP_CACHE_NUM_ENTRIES - 1)
-
-struct _PangoFcCmapCacheEntry
-{
- gunichar ch;
- PangoGlyph glyph;
-};
-
-struct _PangoFcCmapCache
-{
- guint ref_count;
- PangoFcCmapCacheEntry entries[CMAP_CACHE_NUM_ENTRIES];
-};
-
-
#define PANGO_SCALE_26_6 (PANGO_SCALE / (1<<6))
#define PANGO_PIXELS_26_6(d) \
(((d) >= 0) ? \
@@ -79,10 +60,6 @@ PangoCoverage *_pango_fc_font_map_get_coverage (PangoFcFontMap *fcfontmap,
PangoFcFont *fcfont);
PangoCoverage *_pango_fc_font_map_fc_to_coverage (FcCharSet *charset);
-PangoFcCmapCache *_pango_fc_font_map_get_cmap_cache (PangoFcFontMap *fcfontmap,
- PangoFcFont *fcfont);
-void _pango_fc_cmap_cache_unref (PangoFcCmapCache *cmap_cache);
-
PangoFcDecoder *_pango_fc_font_get_decoder (PangoFcFont *font);
void _pango_fc_font_set_decoder (PangoFcFont *font,
PangoFcDecoder *decoder);