glglyphcache: Remove surface member from dirty glyph
We don't use it after we've rendered to it, just its size and data.
This commit is contained in:
@@ -29,7 +29,6 @@ static gboolean glyph_cache_equal (gconstpointer v1,
|
||||
gconstpointer v2);
|
||||
static void glyph_cache_key_free (gpointer v);
|
||||
static void glyph_cache_value_free (gpointer v);
|
||||
static void dirty_glyph_free (gpointer v);
|
||||
|
||||
static GskGLGlyphAtlas *
|
||||
create_atlas (GskGLGlyphCache *cache)
|
||||
@@ -129,15 +128,6 @@ glyph_cache_value_free (gpointer v)
|
||||
g_free (v);
|
||||
}
|
||||
|
||||
static void
|
||||
dirty_glyph_free (gpointer v)
|
||||
{
|
||||
DirtyGlyph *glyph = v;
|
||||
|
||||
if (glyph->surface)
|
||||
cairo_surface_destroy (glyph->surface);
|
||||
}
|
||||
|
||||
static void
|
||||
add_to_cache (GskGLGlyphCache *cache,
|
||||
GlyphCacheKey *key,
|
||||
@@ -249,14 +239,17 @@ render_glyph (const GskGLGlyphAtlas *atlas,
|
||||
pango_cairo_show_glyph_string (cr, key->font, &glyph_string);
|
||||
cairo_destroy (cr);
|
||||
|
||||
glyph->surface = surface;
|
||||
cairo_surface_flush (surface);
|
||||
|
||||
region->data = cairo_image_surface_get_data (surface);
|
||||
region->width = cairo_image_surface_get_width (surface);
|
||||
region->height = cairo_image_surface_get_height (surface);
|
||||
region->stride = cairo_image_surface_get_stride (surface);
|
||||
region->data = g_memdup (cairo_image_surface_get_data (surface),
|
||||
region->stride * region->height * sizeof (guchar));
|
||||
region->x = (gsize)(value->tx * atlas->width);
|
||||
region->y = (gsize)(value->ty * atlas->height);
|
||||
|
||||
cairo_surface_destroy (surface);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -271,7 +264,8 @@ upload_dirty_glyph (GskGLGlyphCache *self,
|
||||
|
||||
gsk_gl_image_upload_regions (atlas->image, self->gl_driver, 1, ®ion);
|
||||
|
||||
dirty_glyph_free (&atlas->pending_glyph);
|
||||
g_free (region.data);
|
||||
|
||||
atlas->pending_glyph.key = NULL;
|
||||
atlas->pending_glyph.value = NULL;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,6 @@ struct _DirtyGlyph
|
||||
{
|
||||
GlyphCacheKey *key;
|
||||
GskGLCachedGlyph *value;
|
||||
cairo_surface_t *surface;
|
||||
};
|
||||
|
||||
typedef struct
|
||||
|
||||
Reference in New Issue
Block a user