[pango/kill-ft-face: 64/72] fc: Drop the cmap cache
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango/kill-ft-face: 64/72] fc: Drop the cmap cache
- Date: Wed, 10 Jul 2019 03:33:11 +0000 (UTC)
commit 50da152fbefd12fd212c1326355fde2e34ae439e
Author: Matthias Clasen <mclasen redhat com>
Date: Fri May 24 16:28:15 2019 +0000
fc: Drop the cmap cache
This is now unused.
pango/pangofc-fontmap.c | 51 -------------------------------------------------
pango/pangofc-private.h | 23 ----------------------
2 files changed, 74 deletions(-)
---
diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c
index a9aef116..c205ab78 100644
--- a/pango/pangofc-fontmap.c
+++ b/pango/pangofc-fontmap.c
@@ -165,7 +165,6 @@ struct _PangoFcFontFaceData
/* Data */
FcPattern *pattern; /* Referenced pattern that owns filename */
PangoCoverage *coverage;
- PangoFcCmapCache *cmap_cache;
hb_face_t *hb_face;
};
@@ -298,9 +297,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);
@@ -1938,53 +1934,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);
-}
-
PangoCoverage *
_pango_fc_font_map_get_coverage (PangoFcFontMap *fcfontmap,
PangoFcFont *fcfont)
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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]