Note some progress.

New helper function to help create an image surface from a PNG file, while taking the srcdir environment variable into consideration. Rename the pattern creating helper function to match.
Use new cairo_test_create_surface_from_png so that non-srcdir builds work.
Track change in cairo_test_create_pattern_from_png.
This commit is contained in:
Carl Worth 2005-07-18 08:04:16 +00:00
parent 584954859e
commit 751e059f5c
8 changed files with 44 additions and 13 deletions

View file

@ -1,3 +1,22 @@
2005-07-18 Carl Worth <cworth@cworth.org>
* ROADMAP: Note some progress.
* test/cairo-test.h:
* test/cairo-test.c: (cairo_test_create_surface_from_png),
(cairo_test_create_pattern_from_png): New helper function to help
create an image surface from a PNG file, while taking the srcdir
environment variable into consideration. Rename the pattern
creating helper function to match.
* test/composite-integer-translate-over.c: (draw):
* test/composite-integer-translate-source.c: (draw): Use new
cairo_test_create_surface_from_png so that non-srcdir builds work.
* test/mask.c: (set_image_pattern):
* test/trap-clip.c: (set_image_pattern): Track change in
cairo_test_create_pattern_from_png.
2005-07-18 Carl Worth <cworth@cworth.org>
* BUGS: Add note that Xlib caches need to be cleand up on close

View file

@ -1,7 +1,7 @@
cairo 0.5.2
===========
Get tor to sign off that the win32 stuff is up to snuff
glyph path patch reviewed and committed
Get tor to sign off that the win32 stuff is up to snuff
glyph path patch reviewed and committed
✓ Fix the BadMatch error introduced between 0.5.0 and 0.5.1:
https://bugs.freedesktop.org/show_bug.cgi?id=3604
@ -10,8 +10,8 @@ cairo 0.5.2
0.1.4 which is already fixed in libpixman 0.1.5)
Add a workaround for Render's overlapping source/dest bug
Use XCopyArea when possible (integer translation)
Otherwise make a copy of the source
Use XCopyArea when possible (integer translation)
Otherwise make a copy of the source
Fix the cache lock deadlocking problems.
Difficulty: Hard

View file

@ -575,11 +575,10 @@ cairo_test (cairo_test_t *test, cairo_test_draw_function_t draw)
return cairo_test_expecting (test, draw, CAIRO_TEST_SUCCESS);
}
cairo_pattern_t *
cairo_test_create_png_pattern (cairo_t *cr, const char *filename)
cairo_surface_t *
cairo_test_create_surface_from_png (const char *filename)
{
cairo_surface_t *image;
cairo_pattern_t *pattern;
char *srcdir = getenv ("srcdir");
image = cairo_image_surface_create_from_png (filename);
@ -594,6 +593,17 @@ cairo_test_create_png_pattern (cairo_t *cr, const char *filename)
return NULL;
}
return image;
}
cairo_pattern_t *
cairo_test_create_pattern_from_png (const char *filename)
{
cairo_surface_t *image;
cairo_pattern_t *pattern;
image = cairo_test_create_surface_from_png (filename);
pattern = cairo_pattern_create_for_surface (image);
cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT);

View file

@ -53,8 +53,11 @@ cairo_test_expect_failure (cairo_test_t *test,
cairo_test_draw_function_t draw,
const char *reason);
cairo_surface_t *
cairo_test_create_surface_from_png (const char *filename);
cairo_pattern_t *
cairo_test_create_png_pattern (cairo_t *cr, const char *filename);
cairo_test_create_pattern_from_png (const char *filename);
void
cairo_test_log (const char *fmt, ...);
@ -63,4 +66,3 @@ void
xasprintf (char **strp, const char *fmt, ...);
#endif

View file

@ -18,7 +18,7 @@ draw (cairo_t *cr, int width, int height)
{
cairo_surface_t *image;
image = cairo_image_surface_create_from_png (png_filename);
image = cairo_test_create_surface_from_png (png_filename);
cairo_set_source_rgba (cr, 0, 0, 0, 1);
cairo_rectangle (cr, 0, 0, SIZE, SIZE);

View file

@ -18,7 +18,7 @@ draw (cairo_t *cr, int width, int height)
{
cairo_surface_t *image;
image = cairo_image_surface_create_from_png (png_filename);
image = cairo_test_create_surface_from_png (png_filename);
cairo_set_source_rgba (cr, 0, 0, 0, 1);
cairo_rectangle (cr, 0, 0, SIZE, SIZE);

View file

@ -64,7 +64,7 @@ set_image_pattern (cairo_t *cr, int x, int y)
{
cairo_pattern_t *pattern;
pattern = cairo_test_create_png_pattern (cr, png_filename);
pattern = cairo_test_create_pattern_from_png (png_filename);
cairo_set_source (cr, pattern);
cairo_pattern_destroy (pattern);
}

View file

@ -63,7 +63,7 @@ set_image_pattern (cairo_t *cr, int x, int y)
{
cairo_pattern_t *pattern;
pattern = cairo_test_create_png_pattern (cr, png_filename);
pattern = cairo_test_create_pattern_from_png (png_filename);
cairo_set_source (cr, pattern);
cairo_pattern_destroy (pattern);
}