[prev in list] [next in list] [prev in thread] [next in thread]
List: cairo-commit
Subject: [cairo-commit] test/user-font-rescale.c
From: ickle () kemper ! freedesktop ! org (Chris Wilson)
Date: 2008-12-23 15:04:01
Message-ID: 20081223150401.2A42610096 () kemper ! freedesktop ! org
[Download RAW message or body]
test/user-font-rescale.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
New commits:
commit 93672d842f2b2c840bb9e73901faa4ce5df9c792
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Tue Dec 23 15:00:47 2008 +0000
[test] Fix reference handling in user-font-rescale
user-font-rescale stored the current font on the context in order to
create a rescaling proxy font. As we failed to take a reference to the
font, it caught us by surprise when the font disappeared as we modified
the context before creating our proxy. Ho hum.
diff --git a/test/user-font-rescale.c b/test/user-font-rescale.c
index 0c32419..04d3f53 100644
--- a/test/user-font-rescale.c
+++ b/test/user-font-rescale.c
@@ -323,7 +323,7 @@ draw (cairo_t *cr, int width, int height)
cairo_show_text (cr, text);
/* same text in 'mono' with widths that match the 'sans' version */
- old = cairo_get_font_face (cr);
+ old = cairo_font_face_reference (cairo_get_font_face (cr));
cairo_select_font_face (cr,
"Bitstream Vera Sans Mono",
CAIRO_FONT_SLANT_NORMAL,
@@ -331,10 +331,12 @@ draw (cairo_t *cr, int width, int height)
substitute = cairo_get_font_face (cr);
status = get_user_font_face (substitute, text, old, &rescaled);
+ cairo_font_face_destroy (old);
if (status) {
return cairo_test_status_from_status (cairo_test_get_context (cr),
status);
}
+
cairo_set_font_face (cr, rescaled);
cairo_font_face_destroy (rescaled);
_______________________________________________
cairo-commit mailing list
cairo-commit@lists.cairographics.org
http://lists.cairographics.org/mailman/listinfo/cairo-commit
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic