summaryrefslogtreecommitdiff
path: root/test/trap-clip.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/trap-clip.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/trap-clip.c')
-rw-r--r--test/trap-clip.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/test/trap-clip.c b/test/trap-clip.c
index 4bc6f195..15549ae1 100644
--- a/test/trap-clip.c
+++ b/test/trap-clip.c
@@ -36,15 +36,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
@@ -57,7 +55,6 @@ set_gradient_pattern (cairo_t *cr, int x, int y)
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);
}
static void
@@ -67,7 +64,6 @@ set_image_pattern (cairo_t *cr, int x, int y)
pattern = cairo_test_create_png_pattern (cr, png_filename);
cairo_set_pattern (cr, pattern);
- cairo_set_alpha (cr, 1);
}
static void
@@ -113,7 +109,6 @@ clip_none (cairo_t *cr, int x, int y)
static void
clip_rect (cairo_t *cr, int x, int y)
{
- cairo_set_alpha (cr, 1.0);
cairo_new_path (cr);
cairo_rectangle (cr, x + (int)WIDTH / 6, y + (int)HEIGHT / 6,
4 * ((int)WIDTH / 6), 4 * ((int)WIDTH / 6));
@@ -126,7 +121,6 @@ clip_rects (cairo_t *cr, int x, int y)
{
int height = HEIGHT / 3;
- cairo_set_alpha (cr, 1.0);
cairo_new_path (cr);
cairo_rectangle (cr, x, y, WIDTH, height);
cairo_rectangle (cr, x, y + 2 * height, WIDTH, height);
@@ -137,7 +131,6 @@ clip_rects (cairo_t *cr, int x, int y)
static void
clip_circle (cairo_t *cr, int x, int y)
{
- 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);