summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/glyph_cache.c11
-rw-r--r--common/glyph_cache.h1
-rw-r--r--etnaviv/etnaviv_render.c10
3 files changed, 22 insertions, 0 deletions
diff --git a/common/glyph_cache.c b/common/glyph_cache.c
index 1ea668a..6bf1c46 100644
--- a/common/glyph_cache.c
+++ b/common/glyph_cache.c
@@ -343,6 +343,17 @@ PicturePtr glyph_cache(ScreenPtr pScreen, GlyphPtr pGlyph, xPoint *pos)
return GetGlyphPicture(pGlyph, pScreen);
}
+void glyph_cache_remove(ScreenPtr pScreen, GlyphPtr pGlyph)
+{
+ struct glyph_priv *priv;
+
+ priv = glyph_get_priv(pGlyph);
+ if (priv) {
+ priv->cache->glyphs[priv->index] = NULL;
+ glyph_set_priv(pGlyph, NULL);
+ }
+}
+
/* Pre-load glyphs into the glyph cache before we start rendering. */
Bool glyph_cache_preload(ScreenPtr pScreen, int nlist, GlyphListPtr list,
GlyphPtr *glyphs)
diff --git a/common/glyph_cache.h b/common/glyph_cache.h
index 8ac9a3c..f783a3a 100644
--- a/common/glyph_cache.h
+++ b/common/glyph_cache.h
@@ -11,6 +11,7 @@ PicturePtr glyph_cache_only(ScreenPtr pScreen, GlyphPtr pGlyph, xPoint *pos);
PicturePtr glyph_cache(ScreenPtr pScreen, GlyphPtr pGlyph, xPoint *pos);
Bool glyph_cache_preload(ScreenPtr pScreen, int nlist, GlyphListPtr list,
GlyphPtr *glyphs);
+void glyph_cache_remove(ScreenPtr pScreen, GlyphPtr pGlyph);
#define NeedsComponent(f) (PICT_FORMAT_A(f) != 0 && PICT_FORMAT_RGB(f) != 0)
diff --git a/etnaviv/etnaviv_render.c b/etnaviv/etnaviv_render.c
index a3abb3b..d547aef 100644
--- a/etnaviv/etnaviv_render.c
+++ b/etnaviv/etnaviv_render.c
@@ -1185,6 +1185,15 @@ static void etnaviv_Glyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
xSrc, ySrc, nlist, list, glyphs);
}
+static void etnaviv_UnrealizeGlyph(ScreenPtr pScreen, GlyphPtr glyph)
+{
+ struct etnaviv *etnaviv = etnaviv_get_screen_priv(pScreen);
+
+ glyph_cache_remove(pScreen, glyph);
+
+ etnaviv->UnrealizeGlyph(pScreen, glyph);
+}
+
static const unsigned glyph_formats[] = {
PICT_a8r8g8b8,
PICT_a8,
@@ -1237,6 +1246,7 @@ void etnaviv_render_screen_init(ScreenPtr pScreen)
etnaviv->Glyphs = ps->Glyphs;
ps->Glyphs = etnaviv_Glyphs;
etnaviv->UnrealizeGlyph = ps->UnrealizeGlyph;
+ ps->UnrealizeGlyph = etnaviv_UnrealizeGlyph;
etnaviv->Triangles = ps->Triangles;
ps->Triangles = unaccel_Triangles;
etnaviv->Trapezoids = ps->Trapezoids;