summaryrefslogtreecommitdiff
path: root/test/operator-www.c
diff options
context:
space:
mode:
authorAnton Danilkin <afdw@yandex.ru>2021-05-01 23:11:13 +0200
committerAnton Danilkin <afdw@yandex.ru>2021-05-01 23:14:24 +0200
commitbd487e64fc3680abf2dd9e165c7506043132229d (patch)
tree753fcf60da52a72309361e35cd206d34ec912783 /test/operator-www.c
parenta3e01d9e8c79c4dddd401af15bf37db7d75435ec (diff)
downloadcairo-bd487e64fc3680abf2dd9e165c7506043132229d.tar.gz
Add support for CAIRO_CONTENT_COLOR
Diffstat (limited to 'test/operator-www.c')
-rw-r--r--test/operator-www.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/test/operator-www.c b/test/operator-www.c
index 3e863040a..8657980ff 100644
--- a/test/operator-www.c
+++ b/test/operator-www.c
@@ -32,7 +32,7 @@ void
example (cairo_t *cr, char *name)
{
cairo_save (cr);
- cairo_push_group (cr);
+ cairo_push_group_with_content (cr, cairo_surface_get_content (cairo_get_target (cr)));
cairo_rectangle (cr, 0, 0, WIDTH, HEIGHT);
cairo_clip (cr);
@@ -107,14 +107,23 @@ example (cairo_t *cr, char *name)
cairo_set_source_rgba (cr, 0, 0, 0.9, 0.4);
cairo_fill (cr);
- cairo_pop_group_to_source (cr);
+ cairo_pattern_t *pattern = cairo_pop_group (cr);
+ cairo_rectangle (cr, 0, 0, WIDTH, HEIGHT);
+ cairo_clip (cr);
+ // Make problems with CAIRO_CONTENT_COLOR visible
+ if (cairo_surface_get_content (cairo_get_target (cr)) == CAIRO_CONTENT_COLOR) {
+ cairo_set_source_rgb (cr, 1, 1, 1);
+ cairo_paint (cr);
+ }
+ cairo_set_source (cr, pattern);
+ cairo_pattern_destroy (pattern);
cairo_paint (cr);
cairo_restore (cr);
cairo_select_font_face (cr, CAIRO_TEST_FONT_FAMILY " Sans",
CAIRO_FONT_SLANT_NORMAL,
CAIRO_FONT_WEIGHT_NORMAL);
- cairo_set_font_size(cr, 17);
+ cairo_set_font_size (cr, 17);
cairo_move_to (cr, WIDTH + 20, 70);
cairo_set_source_rgb (cr, 1, 1, 0);
cairo_show_text (cr, name);