Commit graph

208 commits

Author SHA1 Message Date
Adrian Johnson
9e59808ecb svg: test foreground colors
Convert the ft-svg-render-palette test to a color test that test
both palettes and foreground colors.
2023-01-27 20:22:18 +10:30
Adrian Johnson
f35f757e8f Update user font tests to test foreground colors 2023-01-26 19:49:06 +10:30
Adrian Johnson
b68583ee54 Add test for SVG font palettes 2023-01-21 17:46:18 +10:30
Adrian Johnson
745c3717aa Merge branch 'fix-shared-recording-surface' into 'master'
Fix shared use of recording surfaces

See merge request cairo/cairo!391
2023-01-16 08:59:32 +00:00
Adrian Johnson
c9187c529e Add a test that demonstrates a recording surface bug when re-used on different surfaces
There is a bug in the recording surface where if one recording surface
is used as the same source on different paginated targets that support
fine grained fallbacks, the output may be incorrect because the
analysis results of a previous target are re-used on another target.
2023-01-15 19:29:28 +10:30
Manuel Stoeckl
39f8be09f8 Add test for loading 16 bit PNG images
The base image has 16 bits per channel, with colors that do not
have an exact corresponding 8 bit representation. The reference
image uses 8bpc, like the rgb24/argb32 formatted images which
the test outputs.
2023-01-11 06:39:23 -05:00
Adrian Johnson
ca0f8ffd84 Merge branch 'foreground-color-in-group' into 'master'
User-fonts fails when foreground color used inside a group

See merge request cairo/cairo!380
2023-01-03 07:45:35 +00:00
Adrian Johnson
f0ce8658f9 Fix user-font with foreground in group failures on image, PDF, and PS 2023-01-03 17:37:36 +10:30
Uli Schlachter
3cc15cb40e Merge branch 'duplicate-ref-images' into 'master'
Remove duplicate reference images & run check-refs.sh in CI to ensure that no new duplicate images are added

See merge request cairo/cairo!384
2023-01-02 09:04:16 +00:00
Uli Schlachter
52e964da69 Merge branch 'speed-up-coverage-column-triangles' into 'master'
Speed up coverage-column-triangles test

Closes #498

See merge request cairo/cairo!379
2022-12-31 17:30:29 +00:00
Uli Schlachter
d546a78c6f Remove duplicate reference images
Running test/check-refs.sh reports:

redundant: arc-direction.pdf.ref.png and arc-direction.ref.png are byte-by-byte identical files
redundant: big-little-triangle.traps.argb32.ref.png and big-little-triangle.argb32.ref.png are byte-by-byte identical files
redundant: big-little-triangle.traps.rgb24.ref.png and big-little-triangle.rgb24.ref.png are byte-by-byte identical files
redundant: clip-fill-rule.pdf.rgb24.ref.png and clip-fill-rule.rgb24.ref.png are byte-by-byte identical files
redundant: dash-offset-negative.pdf.ref.png and dash-offset-negative.ref.png are byte-by-byte identical files
redundant: font-matrix-translation.traps.ref.png and font-matrix-translation.ref.png are byte-by-byte identical files
redundant: ft-show-glyphs-positioning.traps.ref.png and ft-show-glyphs-positioning.ref.png are byte-by-byte identical files
redundant: ft-show-glyphs-table.traps.ref.png and ft-show-glyphs-table.ref.png are byte-by-byte identical files
redundant: glyph-cache-pressure.traps.ref.png and glyph-cache-pressure.ref.png are byte-by-byte identical files
redundant: inverse-text.traps.ref.png and inverse-text.ref.png are byte-by-byte identical files
redundant: line-width-large-overlap-offset.ps.ref.png and line-width-large-overlap-offset.ref.png are byte-by-byte identical files
redundant: partial-clip-text-right.traps.ref.png and partial-clip-text-right.ref.png are byte-by-byte identical files
redundant: partial-clip-text-top.traps.ref.png and partial-clip-text-top.ref.png are byte-by-byte identical files
redundant: record90-fill-alpha.pdf.ref.png and record90-fill-alpha.ref.png are byte-by-byte identical files
redundant: record90-paint-alpha-clip.quartz.ref.png and record90-paint-alpha-clip.ref.png are byte-by-byte identical files
redundant: record-fill-alpha.pdf.ref.png and record-fill-alpha.ref.png are byte-by-byte identical files
redundant: recordflip-whole-fill-alpha.quartz.ref.png and recordflip-whole-fill-alpha.ref.png are byte-by-byte identical files
redundant: recordflip-whole-paint-alpha-clip-mask.quartz.ref.png and recordflip-whole-paint-alpha-clip-mask.ref.png are byte-by-byte identical files
redundant: record-mesh.ps.ref.png and record-mesh.ref.png are byte-by-byte identical files
redundant: select-font-face.traps.ref.png and select-font-face.ref.png are byte-by-byte identical files
redundant: show-glyphs-advance.traps.ref.png and show-glyphs-advance.ref.png are byte-by-byte identical files
redundant: show-text-current-point.traps.ref.png and show-text-current-point.ref.png are byte-by-byte identical files
redundant: text-antialias-gray.traps.ref.png and text-antialias-gray.ref.png are byte-by-byte identical files

This commit removes these redundant files.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2022-12-31 15:56:33 +01:00
Adrian Johnson
3a60f6e138 Merge branch 'ft-svg-fonts' into 'master'
Support SVG fonts in FT backend

See merge request cairo/cairo!319
2022-12-31 09:27:57 +00:00
Uli Schlachter
8d74c4d019 Speed up coverage-column-triangles test
This commit changes the height of the coverage-column-triangles test by
using a smaller height for the test. Previously the image was 40 pixels
in height and the test took 517 seconds for me. Now, the image has a
height of 4 pixels and the test takes 55 seconds.

This is possible since column_triangles() does the same thing for each y
coordinate. Thus, previously this test just did the same thing 40 times.

Times are measured with the backends I happened to have enabled locally:
script, xcb, xlib, image, recording.

Thanks a lot to Christian Rohlfs for coming up with this idea in
https://gitlab.freedesktop.org/cairo/cairo/-/issues/498#note_1700197

Possibly-fixes: https://gitlab.freedesktop.org/cairo/cairo/-/issues/498
Signed-off-by: Uli Schlachter <psychon@znc.in>
2022-12-30 16:36:22 +01:00
Uli Schlachter
4913f07950 Merge branch 'round-join' into 'master'
Remove `round-join-bug-520*` CI exceptions for Quartz backend

See merge request cairo/cairo!377
2022-12-29 12:37:01 +00:00
Christian Rohlfs
aa8d16ab83 Removed round-join-bug-520* CI exceptions for Quartz backend
Removed lines from `.gitlab-ci/ignore-quartz*`;
Added `round-join-bug-520-bevel.quartz.ref.png` file.
2022-12-28 17:50:27 +05:00
Uli Schlachter
0e56ea9d5c Merge branch 'round-join' into 'master'
Fix for round joins

See merge request cairo/cairo!372
2022-12-28 09:58:35 +00:00
Adrian Johnson
7fa02c81f1 Merge branch 'bug-535' into 'master'
Fix bug #535 in cairo-script

Closes #535

See merge request cairo/cairo!276
2022-12-28 05:05:07 +00:00
Adrian Johnson
8233c6362b ft-svg-render test 2022-12-28 13:22:00 +10:30
Adrian Johnson
252ff60f1e SVG font test using cairo logo 2022-12-28 13:22:00 +10:30
Adrian Johnson
1bd5751324 FT SVG color font test 2022-12-28 13:22:00 +10:30
Christian Rohlfs
805897b1f7 test: Add new round-join-bug-520 tests
https://gitlab.freedesktop.org/cairo/cairo/-/issues/520
2022-12-28 06:52:29 +05:00
John Ralls
04cf47b57a Change expected fails and reference image so that Quartz CI passes. 2022-11-17 16:20:14 -08:00
Adrian Johnson
99d59f00d6 Test color_mode option in ft-color-font test 2022-06-26 09:54:15 +09:30
Uli Schlachter
21d7198bef Merge branch 'fix-rgb24-tests' into 'master'
Fix clip-unbounded and alpha-similar in CI

See merge request cairo/cairo!301
2022-05-29 05:29:57 +00:00
Uli Schlachter
9136454629 Merge branch 'fix-clip-unbounded' into 'master'
Add missing ref image for clip-unbounded

See merge request cairo/cairo!261
2022-05-29 05:28:32 +00:00
Adrian Johnson
9fadf0a116 Update huge-linear and huge-radial pdf ref images
pdf output is correct but the poppler rendering is incorrect
2022-05-28 18:25:08 +09:30
Adrian Johnson
1aa53f2ed4 big-trap test works 2022-05-28 16:56:50 +09:30
Adrian Johnson
e7da8451f8 Update long-lines test 2022-05-28 16:14:31 +09:30
Adrian Johnson
455a4cca54 Merge branch 'quartz-core-text' into 'master'
quartz: support rendering colored bitmap fonts

See merge request cairo/cairo!289
2022-04-27 00:04:43 +00:00
John Ralls
cfb3835f57 [quartz] Add wiggle test for quartz emoji. 2022-04-26 15:52:04 -07:00
John Ralls
2784159d0e [quartz] Adjust x_extents metric.
CoreText uses different advances depending on the font size, with very
small point sizes sometimes getting advances that are smaller than the
glyph's width. This is manifested in the Apple Color Emoji font with the
Emoji glyphs having a width of 1.25 and an advance width of 1.0. That
results in overlapping emoji when they're in a string.

The small spacing difference also affects 3 tests so updated reference
images are included in this commit.

 # Please enter the commit message for your changes. Lines starting
2022-04-25 11:30:10 -07:00
Adrian Johnson
4815949d2f Fix the scaled_glyph_init color glyph logic
and split _cairo_user_scaled_glyph_init() into multiple functions.

Update user-font test to test changing foreground text color.
2022-04-25 17:08:07 +09:30
John Ralls
c6dc5df612 [quartz] Convert font handling from CGFont to CTFont. 2022-04-24 13:08:48 -07:00
Uli Schlachter
63973958bc Add an rgb24 ref image for alpha similar
This commit copies the current alpha-similar.image.rgb24.out.png to
alpha-similar.rgb24.ref.png to make the test pass.

This failure goes back to commits 6647511 / 049060 which changed the
image comparison in the test suite. Previously, transparent "nothing"
and black compared equal, but said commits fixed that. Thus, having a
special reference image with black instead of transparency is the right
fix.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2022-03-13 16:14:48 +01:00
Adrian Johnson
5018120af0 Update ref images 2022-03-05 11:51:55 +10:30
John Ralls
2e0075e265 [quartz] Don't use CGContextDrawTiledImage for tiled patterns.
CGContextDrawTiledImage turned up as a significant time-user while
profiling a benchmark created to evaluate
https://gitlab.gnome.org/GNOME/gtk/-/issues/3714. Without this commit
the benchmark is able to perform a mean frame rate of 2.19 frames per
second with a standard deviation of 0.09; with the commit the mean frame
rate is 2.37 fps, s.d. 0.30, both over 15 10-second samples. Student's
t-test reports a 9.8% likelyhood that the two represent the same
distribution.
2022-02-24 17:00:07 -08:00
Uli Schlachter
01c93c7f36 Fix bug #535 in cairo-script
cairo-script has a special case for drawing a set of rectangles. The
rectangle detection can trip over a "degenerate rectangle": Just a
horizontal line. It detects the line as the beginning of a rectangle and
then claims CAIRO_STATUS_INVALID_PATH_DATA when the other sides of the
rectangle are missing.

This commit simply changes the return value to
CAIRO_INT_STATUS_UNSUPPORTED to trigger a fallback to the generate case.

Test case is a straight-forward adaption from the original bug report.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Fixes: https://gitlab.freedesktop.org/cairo/cairo/-/issues/535
2022-02-16 17:53:49 +01:00
Behdad Esfahbod
a62eea4aec [user-font] Implement subpixel-positioning
See:

https://github.com/harfbuzz/harfbuzz/pull/3411#issuecomment-1033118545
https://github.com/harfbuzz/harfbuzz/pull/3411#issuecomment-1033125311
https://github.com/harfbuzz/harfbuzz/pull/3411#issuecomment-1037765840

Basically the code in cairo-image-compositor.c:composite_glyphs()
is flooring glyph positions and putting some phase in the glyph-id.
This was being lost in the user-font backend. Fetch that and put it
in the recording-surface's device-transform translation, to be applied.
2022-02-13 14:34:24 -06:00
Uli Schlachter
d6180c2457 Add missing ref image for clip-unbounded
This commit copies clip-unbounded.base.rgb24.ref.png to
clip-unbounded.rgb24.ref.png. This makes the test pass for rgb24
targets.

This failure goes back to commits 6647511 / 049060 which changed the
image comparison in the test suite. Previously, transparent "nothing"
and black compared equal, but said commits fixed that. Thus, having a
special reference image with black instead of transparency is the right
fix.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2021-10-19 18:41:47 +02:00
Adrian Johnson
8ea4ae5413 Allow user fonts to use the foreground color 2021-09-18 07:05:35 +09:30
Tim-Philipp Müller
b1135db014 test: update quartz ref image to fix macos pthread test failure
The proper pthread check activated some tests that weren't active
before, which resulted in a test failure apparently caused by
inexact test rendering.

Update the quartz reference image accordingly.
2021-08-28 12:57:17 +01:00
Adrian Johnson
e73f236da6 Update user-font-mask ref images 2021-08-28 09:19:09 +09:30
Adrian Johnson
c773060195 Merge branch 'HairlineStroke' into 'master'
Added hairline support to cairo

See merge request cairo/cairo!21
2021-08-15 06:58:54 +00:00
Rick Yorgason
ecec0419f8 Added hairline support to cairo 2021-08-15 06:58:54 +00:00
Adrian Johnson
62cc53f9b8 Add color user-font support
Adds new API cairo_user_font_face_set_render_color_glyph_func()
to set a color glyph renderer.
2021-08-14 06:06:19 +00:00
Adrian Johnson
7c6f2d4f24 Add ft-color-font test 2021-07-31 08:56:59 +09:30
Adrian Johnson
6fbfc9d927 pdf: use floating point widths when emitting fonts 2021-07-27 20:13:23 +00:00
afdw
9ab52c9131 Merge branch 'master' into 'svg-backend-work'
# Conflicts:
#   .gitlab-ci.yml
#   test/Makefile.sources
#   test/meson.build
2021-05-29 18:32:53 +02:00
Anton Danilkin
c2bf6e8ae4 Fix remaining tests 2021-05-05 00:51:01 +02:00
Anton Danilkin
42128f1742 Fix reference images 2021-05-03 22:13:16 +02:00