mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2025-12-31 19:30:13 +01:00
[gl] Only unlock the glyph cache when full.
This commit is contained in:
parent
a251e34dbb
commit
3d8f1d3dc8
1 changed files with 7 additions and 3 deletions
|
|
@ -171,6 +171,12 @@ cairo_gl_context_get_glyph_cache (cairo_gl_context_t *ctx,
|
|||
return cache;
|
||||
}
|
||||
|
||||
static void
|
||||
_cairo_gl_glyph_cache_unlock (cairo_gl_glyph_cache_t *cache)
|
||||
{
|
||||
_cairo_rtree_unpin (&cache->rtree);
|
||||
}
|
||||
|
||||
static cairo_bool_t
|
||||
_cairo_gl_surface_owns_font (cairo_gl_surface_t *surface,
|
||||
cairo_scaled_font_t *scaled_font)
|
||||
|
|
@ -260,9 +266,6 @@ _cairo_gl_flush_glyphs (cairo_gl_context_t *ctx,
|
|||
setup->num_prims = 0;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < ARRAY_LENGTH (ctx->glyph_cache); i++)
|
||||
_cairo_rtree_unpin (&ctx->glyph_cache[i].rtree);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -551,6 +554,7 @@ _cairo_gl_surface_show_glyphs (void *abstract_dst,
|
|||
if (status == CAIRO_INT_STATUS_UNSUPPORTED) {
|
||||
/* Cache is full, so flush existing prims and try again. */
|
||||
_cairo_gl_flush_glyphs (ctx, &setup);
|
||||
_cairo_gl_glyph_cache_unlock (cache);
|
||||
}
|
||||
|
||||
status = _cairo_gl_glyph_cache_add_glyph (cache, scaled_glyph);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue