Commit graph

186 commits

Author SHA1 Message Date
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
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
Anton Danilkin
5b678d8185 Fix applying shifted operators 2021-05-03 16:33:05 +02:00
Uli Schlachter
4f61b765c9 Merge branch 'record-png-offset' into 'master'
Add a test case for commit d07fb41056

See merge request cairo/cairo!122
2021-05-02 14:55:48 +00:00
Anton Danilkin
bd487e64fc Add support for CAIRO_CONTENT_COLOR 2021-05-01 23:14:24 +02:00
Anton Danilkin
917f366ad1 Add a test for #431 2021-04-11 23:59:47 +02:00
Anton Danilkin
ceae137ba6 Finish implementing correct paints in transformed recording patterns 2021-04-11 23:59:47 +02:00
Anton Danilkin
71eef9c8bc Implement the rest of the operators 2021-04-11 23:59:47 +02:00
Anton Danilkin
170f8812fb Add a test for #361 2021-04-11 23:59:47 +02:00
Uli Schlachter
753ea90ac1 Add a test case for commit d07fb41056
Signed-off-by: Uli Schlachter <psychon@znc.in>
2021-04-01 17:02:48 +02:00
Uli Schlachter
ee43299276 Make the test case for bug 448 pass
Someone apparently forgot to actually add the reference image. And also
forgot to add the test to meson. Sigh.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2021-02-06 16:40:48 +01:00
Heiko Lewin
03a820b173 Fix mask usage in image-compositor 2020-12-15 16:48:19 +01:00
Massimo Valentini
82a2477a4a add a test to exercise tor22 spans allocation code path 2019-05-10 15:02:54 +00:00
Bryce Harrington
ad7ac7dbca Normalize one more test image with minor gradient differences
For me, with this fix, the base image test cases now pass 100%, when
running:

  make test TARGETS=image FORMAT=rgba

Signed-off-by: Bryce Harrington <bryce@bryceharrington.org>
2018-09-14 11:34:22 -07:00
Bryce Harrington
53e4775327 Normalize more test reference images with minor text rendering differences
The discrepancies in these tests appear to all be font rendering /
antialiasing, probably due to algorithmic changes in Pixman.

Some of these reference images were updated in Federico's recent patch,
so the fact that they differ on my system may indicate there may be some
system dependencies beyond just pixman, that can cause test result
variation from person to person.  Ideally, these would be isolated and
the tests modified to not have such dependencies.

Signed-off-by: Bryce Harrington <bryce@bryceharrington.org>
2018-09-14 11:34:22 -07:00
Federico Mena Quintero
2b1f096145 Normalize test reference images with minor text rendering differences
[In testing, I was able to reproduce Federico's results for most, but
not all, of the test images.  There might be some additional
platform-specific discrepancies that need ironed out, but this is a
solid step forward in any case.

Results for a quick run against just the image backend on my system:

--bryce]

Signed-off-by: Bryce Harrington <bryce@bryceharrington.org>
Bryce Harrington <bryce@bryceharrington.org>
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2018-09-05 17:00:44 -07:00
Federico Mena Quintero
fb24d7b737 Normalize test images with minor gradient differences
Signed-off-by: Bryce Harrington <bryce@bryceharrington.org>
Bryce Harrington <bryce@bryceharrington.org>
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2018-09-05 17:00:44 -07:00
Federico Mena Quintero
cfc90ca91e Normalize extended-blend-mask.{argb32,rgb24}.ref.png
I don't see how the old reference file could have been generated.
Things I tried:

* Using an old pixman (but it seems that the relevant code for Adobe
  extended blend modes has not changed?)

* Using the Cairo version where the test was first introduced.

* Changing the alpha value from .5 to something else.

Signed-off-by: Bryce Harrington <bryce@bryceharrington.org>
Tested-by: Bryce Harrington <bryce@bryceharrington.org>
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2018-09-05 17:00:44 -07:00
Uli Schlachter
50a6ad5389 pthread-same-source: Refresh reference images
I already did the same thing in commit 3e22a8580a. That commit added
a GENERATE_REFERENCE mode that does not use threads and used that for
generating the reference image.

However, the above commit falls into the range between commits
fb57ea13e0 and 3d94269bd4. The later commit reverts the earlier one,
which changed the way that image downscaling works / is used.

This means that the reference image that were generated back then were
broken. Thus, regenerating the images is the right thing to do.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Acked-by: Bryce Harrington <bryce@osg.samsung.com>
2018-04-02 11:16:34 -07:00
Adrian Johnson
164be89660 test: update some stale ref images 2017-11-10 20:10:01 +10:30
Adrian Johnson
71746c37d4 test: use CAIRO_MIME_TYPE_UNIQUE_ID with record-text-transform
The PS output from this test is > 100MB due to the duplicated images.
Using CAIRO_MIME_TYPE_UNIQUE_ID reduces the PS output to 650k, runs
considerably faster, and now produces correct output.
2017-11-09 22:02:05 +10:30
Adrian Johnson
e1a02b180d Add CCITT_FAX mime type for PDF and PS surfaces
This completes the full set of PDF/PS image filters allowing image
data to be passed though without decompressing then recompresssing in
a less efficient format.

The difficulty with CCITT_FAX is it needs some decoding parameters
that are not stored inside the image data. This is achieved by using
an additional mime type CCITT_FAX_PARAMS that contains the params in
key=value format.
2017-10-22 08:42:36 +10:30
Andrea Canciani
a3cc46d2cc quartz-font: Fix text-glyph-range
The index 0 is a legitimate index used for character codes that do not
correspond to any glyph in the font.  Instead, the API reserves 0xFFFF
(kCGFontIndexInvalid) as the invalid index and defines 0xFFFE
(kCGFontIndexMax = kCGGlyphMax) as the maximum legal index.

Fixes text-glyph-range.
2017-04-25 18:06:14 +02:00
Andrea Canciani
cb9f627378 test: Add a test for characters in the SMP
Unicode characters in the Supplementary Multilingual Plane are encoded
as surrogate pairs in UTF-16. This test tries to verify that backends
do not perform UCS4 to UTF-16 conversion by truncation.
2017-04-25 18:05:40 +02:00