summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAdrian Johnson <ajohnson@redneon.com>2023-01-03 07:45:35 +0000
committerAdrian Johnson <ajohnson@redneon.com>2023-01-03 07:45:35 +0000
commitca0f8ffd84004a0576791531730b649b562ef05a (patch)
tree3b13d76da8430187cd03e9f1d6928d0eafa55aa9 /test
parent1af1e11254c29f6bd1f61b9e1776a57d4a772919 (diff)
parentf0ce8658f9ca905b87463f283155ed5c3ad67c10 (diff)
downloadcairo-ca0f8ffd84004a0576791531730b649b562ef05a.tar.gz
Merge branch 'foreground-color-in-group' into 'master'
User-fonts fails when foreground color used inside a group See merge request cairo/cairo!380
Diffstat (limited to 'test')
-rw-r--r--test/reference/user-font-color.image16.ref.pngbin3527 -> 4138 bytes
-rw-r--r--test/reference/user-font-color.pdf.ref.pngbin4234 -> 3999 bytes
-rw-r--r--test/reference/user-font-color.quartz.ref.pngbin4163 -> 4770 bytes
-rw-r--r--test/reference/user-font-color.recording.ref.pngbin4903 -> 5582 bytes
-rw-r--r--test/reference/user-font-color.ref.pngbin4233 -> 4852 bytes
-rw-r--r--test/reference/user-font-color.script.xfail.pngbin2189 -> 3346 bytes
-rw-r--r--test/reference/user-font-color.svg.ref.pngbin4289 -> 0 bytes
-rw-r--r--test/reference/user-font-color.svg.rgb24.xfail.pngbin3040 -> 0 bytes
-rw-r--r--test/reference/user-font-proxy.pdf.argb32.ref.pngbin4049 -> 10309 bytes
-rw-r--r--test/reference/user-font-proxy.pdf.rgb24.ref.pngbin16937 -> 10309 bytes
-rw-r--r--test/reference/user-font-proxy.quartz.ref.pngbin19737 -> 19701 bytes
-rw-r--r--test/user-font-color.c50
12 files changed, 48 insertions, 2 deletions
diff --git a/test/reference/user-font-color.image16.ref.png b/test/reference/user-font-color.image16.ref.png
index 404fbf948..6e3fe434c 100644
--- a/test/reference/user-font-color.image16.ref.png
+++ b/test/reference/user-font-color.image16.ref.png
Binary files differ
diff --git a/test/reference/user-font-color.pdf.ref.png b/test/reference/user-font-color.pdf.ref.png
index 674d1a4d6..9cb145202 100644
--- a/test/reference/user-font-color.pdf.ref.png
+++ b/test/reference/user-font-color.pdf.ref.png
Binary files differ
diff --git a/test/reference/user-font-color.quartz.ref.png b/test/reference/user-font-color.quartz.ref.png
index fc976e8ea..712e9a3d9 100644
--- a/test/reference/user-font-color.quartz.ref.png
+++ b/test/reference/user-font-color.quartz.ref.png
Binary files differ
diff --git a/test/reference/user-font-color.recording.ref.png b/test/reference/user-font-color.recording.ref.png
index 0b4cb06f5..68c058adc 100644
--- a/test/reference/user-font-color.recording.ref.png
+++ b/test/reference/user-font-color.recording.ref.png
Binary files differ
diff --git a/test/reference/user-font-color.ref.png b/test/reference/user-font-color.ref.png
index c4294c5f7..9c33df7cd 100644
--- a/test/reference/user-font-color.ref.png
+++ b/test/reference/user-font-color.ref.png
Binary files differ
diff --git a/test/reference/user-font-color.script.xfail.png b/test/reference/user-font-color.script.xfail.png
index e268cdc03..61ceab505 100644
--- a/test/reference/user-font-color.script.xfail.png
+++ b/test/reference/user-font-color.script.xfail.png
Binary files differ
diff --git a/test/reference/user-font-color.svg.ref.png b/test/reference/user-font-color.svg.ref.png
deleted file mode 100644
index 4ce8882f8..000000000
--- a/test/reference/user-font-color.svg.ref.png
+++ /dev/null
Binary files differ
diff --git a/test/reference/user-font-color.svg.rgb24.xfail.png b/test/reference/user-font-color.svg.rgb24.xfail.png
deleted file mode 100644
index 37b8aaa1e..000000000
--- a/test/reference/user-font-color.svg.rgb24.xfail.png
+++ /dev/null
Binary files differ
diff --git a/test/reference/user-font-proxy.pdf.argb32.ref.png b/test/reference/user-font-proxy.pdf.argb32.ref.png
index 9d61720e7..749c61bcd 100644
--- a/test/reference/user-font-proxy.pdf.argb32.ref.png
+++ b/test/reference/user-font-proxy.pdf.argb32.ref.png
Binary files differ
diff --git a/test/reference/user-font-proxy.pdf.rgb24.ref.png b/test/reference/user-font-proxy.pdf.rgb24.ref.png
index cffa9edb7..749c61bcd 100644
--- a/test/reference/user-font-proxy.pdf.rgb24.ref.png
+++ b/test/reference/user-font-proxy.pdf.rgb24.ref.png
Binary files differ
diff --git a/test/reference/user-font-proxy.quartz.ref.png b/test/reference/user-font-proxy.quartz.ref.png
index f7b1163be..710f58a92 100644
--- a/test/reference/user-font-proxy.quartz.ref.png
+++ b/test/reference/user-font-proxy.quartz.ref.png
Binary files differ
diff --git a/test/user-font-color.c b/test/user-font-color.c
index 781d6945d..c35e693be 100644
--- a/test/user-font-color.c
+++ b/test/user-font-color.c
@@ -38,10 +38,10 @@
#define BORDER 10
#define TEXT_SIZE 64
-#define WIDTH (TEXT_SIZE * 6 + 2*BORDER)
+#define WIDTH (TEXT_SIZE * 12 + 2*BORDER)
#define HEIGHT (TEXT_SIZE + 2*BORDER)
-#define TEXT "abcdef"
+#define TEXT "abcdefghijkl"
static cairo_status_t
@@ -64,6 +64,7 @@ render_glyph_solid (cairo_t *cr, double width, double height, cairo_bool_t color
cairo_rectangle (cr, 0, 0, width/2, height/2);
cairo_fill (cr);
+ /* Draw the middle rectangle using the foreground color */
if (color)
cairo_set_source (cr, pattern);
cairo_rectangle (cr, width/4, height/4, width/2, height/2);
@@ -133,6 +134,11 @@ test_scaled_font_render_color_glyph (cairo_scaled_font_t *scaled_font,
case 'c':
render_glyph_text (cr, width, height, TRUE);
break;
+
+ /* Ensure that the following glyphs are rendered with
+ * test_scaled_font_render_glyph() even if we draw
+ * something before returning.
+ */
case 'd':
render_glyph_solid (cr, width, height, TRUE);
status = CAIRO_STATUS_USER_FONT_NOT_IMPLEMENTED;
@@ -145,6 +151,26 @@ test_scaled_font_render_color_glyph (cairo_scaled_font_t *scaled_font,
render_glyph_solid (cr, width, height, TRUE);
status = CAIRO_STATUS_USER_FONT_NOT_IMPLEMENTED;
break;
+ case 'g':
+ cairo_push_group (cr);
+ render_glyph_solid (cr, width, height, TRUE);
+ cairo_pop_group_to_source (cr);
+ cairo_paint (cr);
+ break;
+ case 'h':
+ cairo_push_group (cr);
+ render_glyph_linear (cr, width, height, TRUE);
+ cairo_pop_group_to_source (cr);
+ cairo_paint (cr);
+ break;
+ case 'i':
+ cairo_push_group (cr);
+ render_glyph_text (cr, width, height, TRUE);
+ cairo_pop_group_to_source (cr);
+ cairo_paint (cr);
+ break;
+ default:
+ status = CAIRO_STATUS_USER_FONT_NOT_IMPLEMENTED;
}
return status;
@@ -170,6 +196,26 @@ test_scaled_font_render_glyph (cairo_scaled_font_t *scaled_font,
case 'f':
render_glyph_text (cr, width, height, FALSE);
break;
+ case 'j':
+ cairo_push_group (cr);
+ render_glyph_solid (cr, width, height, FALSE);
+ cairo_pop_group_to_source (cr);
+ cairo_paint (cr);
+ break;
+ case 'k':
+ cairo_push_group (cr);
+ render_glyph_linear (cr, width, height, FALSE);
+ cairo_pop_group_to_source (cr);
+ cairo_paint (cr);
+ break;
+ case 'l':
+ cairo_push_group (cr);
+ render_glyph_text (cr, width, height, FALSE);
+ cairo_pop_group_to_source (cr);
+ cairo_paint (cr);
+ break;
+ default:
+ return CAIRO_STATUS_USER_FONT_NOT_IMPLEMENTED;
}
return CAIRO_STATUS_SUCCESS;