[cairo-commit] cairo/test user-data.c,1.3,1.4

Owen Taylor commit at pdx.freedesktop.org
Fri Apr 8 13:14:19 PDT 2005


Committed by: otaylor

Update of /cvs/cairo/cairo/test
In directory gabe:/tmp/cvs-serv9556/test

Modified Files:
	user-data.c 
Log Message:
2005-04-08  Owen Taylor  <otaylor at redhat.com>

	* src/cairo.h src/cairo-font.c src/cairoint.h
	doc/public/cairo-sections.txt:
	Add cairo_font_face_set/get_user_data().

	* src/cairo-array.c src/cairoint.h src/cairo-surface.c:
	Refactor user data code from cairo-surface.c into 
	cairo_user_data_array_t.

	* src/cairo-font.c (cairo_font_face_destroy,
	(cairo_scaled_font_destroy, _cairo_unscaled_font_destroy):
	Switch these types to be like cairo_surface_t where the
	generic code frees the wrapper object.

	* src/cairo-atsui-font.c src/cairo-ft-font.c
	src/cairo-win32-font.c: Fix up for the above changes.

	* src/cairo-ft-font.c (_cairo_ft_unscaled_font_destroy,
	_ft_font_face_destroy): Implement a complicated mutual-referencing
	scheme to make sure that a face from cairo_ft_font_face_create_for_ft_face()
	is freed only when the FT_Face is no longer needed.

	* src/cairo-ft-font.c (cairo_ft_font_face_create_for_ft_face): 
	Update the docs to describe how to figure out when the FT_Face
	can be freed.

	* src/cairo-ft-font.c: Fix refcount leaks when creating fonts.

	* src/cairo-pdf-surface.c (cairo_pdf_ft_font_create): Remove
	excess call to _cairo_unscaled_font_reference().

	* src/cairo-gstate.c (_cairo_gstate_set_font_face): Remove
	stray initialization of font matrix to the identity.

	* src/cairo-array.c (_cairo_user_data_array_set_data) test/user-data.c:
	Fix a bug when setting/unsetting a key with a free key slot before it,
	add that to the test case.

	* src/cairo-array.c (_cairo_user_data_array_set_data): 
	Don't append an element when user_data is NULL.

Index: user-data.c
===================================================================
RCS file: /cvs/cairo/cairo/test/user-data.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- user-data.c	16 Mar 2005 20:15:29 -0000	1.3
+++ user-data.c	8 Apr 2005 20:14:17 -0000	1.4
@@ -60,6 +60,10 @@
     assert (data1 == 1);
     assert (data2 == 0);
 
+    assert (cairo_surface_set_user_data (surface, &key2, NULL, NULL)
+	    == CAIRO_STATUS_SUCCESS);
+    assert (data2 == 2);
+    
     data1 = 0;
     assert (cairo_surface_set_user_data (surface, &key1, &data1, NULL)
 	    == CAIRO_STATUS_SUCCESS);




More information about the cairo-commit mailing list