From 751e059f5c506138c478fbcc2e9dfe8e92aaa3ab Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Mon, 18 Jul 2005 08:04:16 +0000 Subject: [PATCH] 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. --- ChangeLog | 19 +++++++++++++++++++ ROADMAP | 8 ++++---- test/cairo-test.c | 16 +++++++++++++--- test/cairo-test.h | 6 ++++-- test/composite-integer-translate-over.c | 2 +- test/composite-integer-translate-source.c | 2 +- test/mask.c | 2 +- test/trap-clip.c | 2 +- 8 files changed, 44 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 541a0d92e..6d8bece81 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,22 @@ +2005-07-18 Carl Worth + + * 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 * BUGS: Add note that Xlib caches need to be cleand up on close diff --git a/ROADMAP b/ROADMAP index 88fad3087..d979adbbb 100644 --- a/ROADMAP +++ b/ROADMAP @@ -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 diff --git a/test/cairo-test.c b/test/cairo-test.c index 9917ac94a..77cf48fd0 100644 --- a/test/cairo-test.c +++ b/test/cairo-test.c @@ -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); diff --git a/test/cairo-test.h b/test/cairo-test.h index 1055a0c26..beabc6a5e 100644 --- a/test/cairo-test.h +++ b/test/cairo-test.h @@ -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 - diff --git a/test/composite-integer-translate-over.c b/test/composite-integer-translate-over.c index 867448889..52b4a6c47 100644 --- a/test/composite-integer-translate-over.c +++ b/test/composite-integer-translate-over.c @@ -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); diff --git a/test/composite-integer-translate-source.c b/test/composite-integer-translate-source.c index a467f089a..d2f39a351 100644 --- a/test/composite-integer-translate-source.c +++ b/test/composite-integer-translate-source.c @@ -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); diff --git a/test/mask.c b/test/mask.c index bf94f7163..a9414e046 100644 --- a/test/mask.c +++ b/test/mask.c @@ -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); } diff --git a/test/trap-clip.c b/test/trap-clip.c index dddb94cb2..75b06a83d 100644 --- a/test/trap-clip.c +++ b/test/trap-clip.c @@ -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); }