summaryrefslogtreecommitdiff
path: root/src/cairo-user-font.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2008-10-21 22:48:17 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2008-10-22 00:53:55 +0100
commit1db8949f2baf1e620e1d5ef73a66de211420bd0a (patch)
tree23f0a27e6a92ec287be86e7f52e8d68b2aa886d3 /src/cairo-user-font.c
parentb2cbbceb4ca57816a498c2c1e676b19182c34e12 (diff)
downloadcairo-1db8949f2baf1e620e1d5ef73a66de211420bd0a.tar.gz
Ensure that the scaled font is frozen for the lifetime of the scaled glyph.
After discussing the scaled font locking with Behdad, it transpired that it is not sufficient for a font to be locked for the lifetime of a scaled glyph, but that the scaled font's glyph cache must be frozen for the glyph' lifetime. If the cache is not frozen, then there is a possibility that the glyph may be evicted before the reference goes out of scope i.e. the glyph becomes invalid whilst we are trying to use it. Since the freezing of the cache is the stronger barrier, we remove the locking/unlocking of the mutex from the backends and instead move the mutex acquisition into the freeze/thaw routines. Then update the rule on acquiring glyphs to enforce that the cache is frozen and review the usage of freeze/thaw by all the backends to ensure that the cache is frozen for the lifetime of the glyph.
Diffstat (limited to 'src/cairo-user-font.c')
-rw-r--r--src/cairo-user-font.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/src/cairo-user-font.c b/src/cairo-user-font.c
index 5645287a4..385b84147 100644
--- a/src/cairo-user-font.c
+++ b/src/cairo-user-font.c
@@ -481,7 +481,6 @@ _cairo_user_font_face_scaled_font_create (void *abstract_
if (status == CAIRO_STATUS_SUCCESS)
status = _cairo_scaled_font_set_metrics (&user_scaled_font->base, &font_extents);
-
if (status != CAIRO_STATUS_SUCCESS) {
_cairo_scaled_font_fini (&user_scaled_font->base);
free (user_scaled_font);