summaryrefslogtreecommitdiff
path: root/test/coverage.c
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2005-04-14 14:42:26 +0000
committerCarl Worth <cworth@cworth.org>2005-04-14 14:42:26 +0000
commit828094aef860c8087564c93408846a4e81eec20d (patch)
treea184e27200c9abb643b9e345983eddc1af8b1ebb /test/coverage.c
parentc0d9c13d0403673a7fe994664a4f616c71301474 (diff)
and delete:
cairo_set_pattern -> cairo_set_source cairo_get_pattern -> cairo_get_source cairo_set_rgb_color -> cairo_set_source_rgb -> cairo_set_source_rgba cairo_set_alpha -> cairo_get_alpha -> Note that we'll likely want to add cairo_set_source_surface. Add _cairo_stock_color helper function. Improve some interfaces: _cairo_color_init _cairo_color_init_rgb _cairo_color_set_rgb -> _cairo_color_init_rgba _cairo_color_set_alpha _cairo_color_multiply_alpha _cairo_color_get_rgb -> _cairo_color_get_rbga _cairo_color_get_rgba_premultiplied Add cairo_stock_t and some helper macros: CAIRO_COLOR_WHITE CAIRO_COLOR_BLACK CAIRO_COLOR_TRANSPARENT Fix cairo_pattern_t by eliminating pattern->alpha. Fix cairo_solid_pattern_t to use cairo_color_t rather than three doubles. Track removal of pattern->alpha, simplifying the code considerably Track _cairo_color interface changes. Remove gstate->alpha. Propagate down set_source renamings. cairo_pattern_add_color_stop -> cairo_pattern_add_color_stop_rgba and add: cairo_pattern_add_color_stop_rgb Remove pattern->alpha, simplifying the code considerably. Track pattern and color interface changes. Add const where appropriate on cairo_color_t*. Add private type inspection predicate. (cairo_xlib_surface_set_size): Add check for surface type mismatch, (no useful error reporting yet, though). Note coverage as en expected failure. Improve line wrap on expected failure messages. Port all tests to new cairo_set_source interfaces.
Diffstat (limited to 'test/coverage.c')
-rw-r--r--test/coverage.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/test/coverage.c b/test/coverage.c
index 1b605af6..1afee3c3 100644
--- a/test/coverage.c
+++ b/test/coverage.c
@@ -40,15 +40,13 @@ const char png_filename[] = "romedalen.png";
static void
set_solid_pattern (cairo_t *cr, int x, int y)
{
- cairo_set_rgb_color (cr, 0, 0, 0.6);
- cairo_set_alpha (cr, 1.0);
+ cairo_set_source_rgb (cr, 0, 0, 0.6);
}
static void
set_translucent_pattern (cairo_t *cr, int x, int y)
{
- cairo_set_rgb_color (cr, 0, 0, 0.6);
- cairo_set_alpha (cr, 0.5);
+ cairo_set_source_rgba (cr, 0, 0, 0.6, 0.5);
}
static void
@@ -58,10 +56,9 @@ set_gradient_pattern (cairo_t *cr, int x, int y)
pattern =
cairo_pattern_create_linear (x, y, x + WIDTH, y + HEIGHT);
- cairo_pattern_add_color_stop (pattern, 0, 1, 1, 1, 1);
- cairo_pattern_add_color_stop (pattern, 1, 0, 0, 0.4, 1);
- cairo_set_pattern (cr, pattern);
- cairo_set_alpha (cr, 1);
+ cairo_pattern_add_color_stop_rgb (pattern, 0, 1, 1, 1);
+ cairo_pattern_add_color_stop_rgb (pattern, 1, 0, 0, 0.4);
+ cairo_set_source (cr, pattern);
}
static void
@@ -70,8 +67,7 @@ set_image_pattern (cairo_t *cr, int x, int y)
cairo_pattern_t *pattern;
pattern = cairo_test_create_png_pattern (cr, png_filename);
- cairo_set_pattern (cr, pattern);
- cairo_set_alpha (cr, 1);
+ cairo_set_source (cr, pattern);
}
static void
@@ -80,8 +76,7 @@ set_translucent_image_pattern (cairo_t *cr, int x, int y)
cairo_pattern_t *pattern;
pattern = cairo_test_create_png_pattern (cr, png_filename);
- cairo_set_pattern (cr, pattern);
- cairo_set_alpha (cr, 0.5);
+ cairo_set_source (cr, pattern);
}
#if WE_FIX_THE_TEST_SO_THAT_IT_DOES_NOT_DEPEND_ON_HOW_FREETPYE_IS_COMPILED
@@ -165,7 +160,6 @@ draw (cairo_t *cr, int width, int height)
cairo_save (cr);
- cairo_set_alpha (cr, 1.0);
cairo_new_path (cr);
cairo_arc (cr, x + WIDTH / 2, y + HEIGHT / 2,
WIDTH / 3, 0, 2 * M_PI);
@@ -186,5 +180,6 @@ draw (cairo_t *cr, int width, int height)
int
main (void)
{
- return cairo_test (&test, draw);
+ return cairo_test_expect_failure (&test, draw,
+ "missing API to replace cairo_show_surface with alpha");
}