summaryrefslogtreecommitdiff
path: root/test/paint-with-alpha.c
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2006-04-25 01:56:51 -0700
committerCarl Worth <cworth@cworth.org>2006-04-25 01:56:51 -0700
commitbef621e870e3d4038e00ed56ad40d726d5a7ca77 (patch)
tree4a5989793ad3433a1ec6329a001f8bdb390a8fd8 /test/paint-with-alpha.c
parenta5afc59d0ad90125c0593ab60c8e1e01f51bdc3c (diff)
downloadcairo-bef621e870e3d4038e00ed56ad40d726d5a7ca77.tar.gz
Augment tests to do better testing of paths/images with alpha.
Add a new cairo_test_paint_checkered function so that tests that draw with alpha can easily put an easy-to-see checkered background in place first. Add new tests caps-joins-alpha and paint-source-alpha that do simple tests of strokes and image painting with source pattern alpha. Also, add the checkered background to paint-with-alpha for consistency.
Diffstat (limited to 'test/paint-with-alpha.c')
-rw-r--r--test/paint-with-alpha.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/paint-with-alpha.c b/test/paint-with-alpha.c
index 3292d5f90..b204b0865 100644
--- a/test/paint-with-alpha.c
+++ b/test/paint-with-alpha.c
@@ -1,5 +1,6 @@
/*
* Copyright © 2005 Red Hat, Inc.
+ * Copyright © 2006 Red Hat, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software
* and its documentation for any purpose is hereby granted without
@@ -28,7 +29,7 @@
cairo_test_t test = {
"paint-with-alpha",
"Simple test of cairo_paint_with_alpha",
- 12, 12
+ 32, 32
};
static cairo_test_status_t
@@ -46,9 +47,11 @@ draw (cairo_t *cr, int width, int height)
surface = cairo_image_surface_create_for_data ((unsigned char *) data,
CAIRO_FORMAT_RGB24, 4, 4, 16);
- cairo_scale (cr, 2, 2);
+ cairo_test_paint_checkered (cr);
- cairo_set_source_surface (cr, surface, 1 , 1);
+ cairo_scale (cr, 4, 4);
+
+ cairo_set_source_surface (cr, surface, 2 , 2);
cairo_pattern_set_filter (cairo_get_source (cr), CAIRO_FILTER_NEAREST);
cairo_paint_with_alpha (cr, 0.5);