From 20f066b00b96d44a1054ad85fc4098d294915606 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Fri, 18 Jan 2002 05:42:20 +0000 Subject: Add glyph_cache_destroy to PangoFont. This is slightly ugly, we should 2002-01-18 Alexander Larsson * pango/pangoft2-private.h: Add glyph_cache_destroy to PangoFont. This is slightly ugly, we should perhaps have it in the FontMap, but it was easy. Added cached_glyph to PangoFT2GlyphInfo. This can be used by apps that want to have a glyph cache. Only one user per PangoContext though. Right now it is only internally accessible. Added pango_ft2_font_get_cache_glyph_data(), pango_ft2_font_set_cache_glyph_data() and pango_ft2_font_set_glyph_cache_destroy() to access this functionallity * pango/pangoft2.c: Implement glyph caching for pango_ft2_render_layout(). Unbounded caching right now. We should probably limit this in order to not use a lot of memory if the user displayed a lot of glyphs once, and then doesn't use them anymore. --- pango/pangoft2-private.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'pango/pangoft2-private.h') diff --git a/pango/pangoft2-private.h b/pango/pangoft2-private.h index e7276bd3..0a9ff03b 100644 --- a/pango/pangoft2-private.h +++ b/pango/pangoft2-private.h @@ -76,12 +76,14 @@ struct _PangoFT2Font gboolean in_cache; GHashTable *glyph_info; + GDestroyNotify glyph_cache_destroy; }; struct _PangoFT2GlyphInfo { PangoRectangle logical_rect; PangoRectangle ink_rect; + void *cached_glyph; }; struct _PangoFT2Face @@ -115,4 +117,14 @@ const char *_pango_ft2_ft_strerror (FT_Error error); PangoFontDescription *_pango_ft2_font_desc_from_pattern (MiniXftPattern *pattern, gboolean include_size); +void *pango_ft2_font_get_cache_glyph_data (PangoFont *font, + int glyph_index); +void pango_ft2_font_set_cache_glyph_data (PangoFont *font, + int glyph_index, + void *cached_glyph); +void pango_ft2_font_set_glyph_cache_destroy (PangoFont *font, + GDestroyNotify destroy_notify); + + + #endif /* __PANGOFT2_PRIVATE_H__ */ -- cgit v1.2.1