Commit graph

2310 commits

Author SHA1 Message Date
Tim-Philipp Müller
9732f4e80f meson: use encoding=utf-8 when reading/writing files in helper script
Fixes errors such as

Traceback (most recent call last):
  File "C:\Users\...\cairo\test\make-cairo-test-constructors.py", line 19, in <module>
    for l in f.readlines():
  File "c:\python39\lib\encodings\cp1253.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x98 in position 6694: character maps to <undefined>

on non-English-language Windows locales/installations.
2021-02-23 23:42:11 +00:00
Heiko Lewin
9e84988f41 Merge branch 'fix-448-test' into 'master'
Make the test case for bug 448 pass

See merge request cairo/cairo!123
2021-02-21 16:09:28 +00:00
Uli Schlachter
92fa421261 Merge branch 'small-build-system-fixes' into 'master'
Small build system fixes

See merge request cairo/cairo!111
2021-02-14 09:18:27 +00: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
fb017cc73a test/path-precision.c: Correct initialization, error margin for comparisons 2021-02-04 01:39:15 +01:00
Heiko Lewin
a88696ed15 Merge branch 'extend-test-pdf-tagged-text' into 'master'
Add tests for PDF metadata

See merge request cairo/cairo!100
2021-01-19 11:12:27 +00:00
Uli Schlachter
414d0aee10 Merge branch 'fix-compiler-warnings-in-test-suite' into 'master'
Fix compiler warnings in test suite

See merge request cairo/cairo!98
2021-01-06 13:41:30 +00:00
Sven Neumann
4e02f705e4 Add tests for PDF metadata
Extend the "pdf-tagged-text" test so that it does some basic checks
on the PDF file it creates. This covers the date fields as well as
some other metadata. More checks can and should be added.
2021-01-04 18:04:27 +01:00
Sven Neumann
a9ea73ae0c Fix compiler warnings in test suite
Fix some enum mixups, mostly cairo_status_t vs cairo_test_status_t.
2021-01-04 14:08:38 +01:00
Uli Schlachter
a1dc600a07 Fix copying tags in a recording surface
The code was copying from the wrong member of an union. This caused a
huge num_dashes value to be read, which then caused a so large memory
allocation that malloc returned an error.

Fixes: https://gitlab.freedesktop.org/cairo/cairo/-/issues/448
Signed-off-by: Uli Schlachter <psychon@znc.in>
2020-12-26 19:11:31 +01:00
Uli Schlachter
8481452510 test/meson.build: Add missing tests
These are entries that are present in test/Makefile.sources, but are
missing from test/meson.build.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2020-12-15 18:59:31 +01:00
Uli Schlachter
3a77858dbd test/Makefile.sources: Use tabs for indentation
Signed-off-by: Uli Schlachter <psychon@znc.in>
2020-12-15 18:59:10 +01:00
Heiko Lewin
0677e0a949 Add meson support 2020-12-15 18:14:35 +01:00
Heiko Lewin
8bc14a6bba Minor cleanups 2020-12-15 17:14:18 +01:00
Heiko Lewin
03a820b173 Fix mask usage in image-compositor 2020-12-15 16:48:19 +01:00
Tim-Philipp Müller
4ea2991a40 Retire dummy cairo-version.h header to fix meson subproject build
It was originally added to make bisecting easier,
but has outlived its usefuleness now.

Going forward we'll have just a single cairo-version.h
header file, the one with the real version numbers.

This is needed to fix the case where cairo is being
built as a Meson subproject, but also simplifies
things in general.

Fixes #421
2020-09-29 15:50:53 +00:00
George Matsumura
9a3ad1df1c build: Include correct poll.h
Including sys/poll.h when poll.h is available produces a compile
warning on some systems, but only sys/poll.h is present on others
such as AIX. This makes sure the most suitable poll.h is included
in each situation.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-09-05 12:15:57 +00:00
George Matsumura
c8d82cffdf svg2png: Remove deprecated handle closing function call
rsvg_handle_close is no longer required after creating a handle with
rsvg_handle_new_from_file. It causes a deprecation warning during
compilation as well. This change removes it.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-09-02 10:29:04 +00:00
George Matsumura
f2cb9ba49a meson: Fix musl build
This constitutes few fixes that are necessary to compile correctly
and reduce errors when using musl libc.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-09-02 10:29:04 +00:00
Mathieu Duponchelle
596a82f2d1 Add meson build definitions
Co-Authored by:
Nirbheek Chauhan <nirbheek@centricular.com>
lb90 <luca.bacci982@gmail.com>
Tim-Philipp Müller <tim@centricular.com>
2020-07-31 12:21:50 +01:00
Mathieu Duponchelle
a75f8df957 Fix build on Windows with recent versions of MSVC
- vsnprintf and snprintf are available since vs2015
- define ISREG if not provided
- guard unistd.h include with HAVE_UNISTD_H
- isnan() is available after vs2010
2020-07-31 01:21:01 +01:00
Uli Schlachter
4777f9cd5f Merge branch 'fix-build-rule-for-font-variations' of gitlab.freedesktop.org:mpsuzuki/cairo 2020-07-20 18:32:33 +02:00
Uli Schlachter
e0f9db9459 Merge branch 'master' of gitlab.freedesktop.org:ffontaine/cairo 2020-07-20 18:30:45 +02:00
Mathieu Duponchelle
1676935768 raster-source: fix when builddir != srcdir
When the build dir is different from the source dir,
"png.png" is not a valid path. As we can't dispose of
an allocated filename, we add an atexit handler.
2020-07-18 19:47:27 +01:00
Mathieu Duponchelle
4645ecf3f8 record tests: fix when builddir != srcdir
When builddir != srcdir, cairo_test_create_pattern_from_png
needs a non-NULL ctx to work with.
2020-07-18 19:47:17 +01:00
Fabrice Fontaine
cb2357f481 test: fix build when SHOULD_FORK is false
The code in test/cairo-test-runner.c properly takes into account
platforms that do have fork() support, and uses the SHOULD_FORK define
to know whether fork is available or not.

However, this SHOULD_FORK macro is used to guard the inclusion of
<unistd.h>, which is needed to get the prototype of other functions
(namely readlink and getppid), that are used in portions of this file
not guarded by SHOULD_FORK.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
[Retrieved from:
https://git.buildroot.net/buildroot/tree/package/cairo/0001-fix-nofork-build.patch]
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2020-02-03 21:24:25 +01:00
Matthias Clasen
6fd4222ab0 Add a testcase for subpixel positioning
With the image compositor, you can see different
phases. The XLib compositor always uses the same
glyph rendering.
2019-07-18 14:38:47 -07:00
Massimo Valentini
82a2477a4a add a test to exercise tor22 spans allocation code path 2019-05-10 15:02:54 +00:00
suzuki toshiya
c93ca40f60 regrouping of test sources with new 'fc_font_test_sources' group 2019-04-10 01:07:16 +00:00
suzuki toshiya
d331c69f65 Makefile.sources: move font-variations.c (a test code for
Variation Font with FreeType2 functions) from test_sources
to ft_font_test_sources, to restrict the test to the case
with FreeType2 backend. See discussion in
https://lists.cairographics.org/archives/cairo/2019-April/028858.html
2019-04-08 03:05:00 +00:00
Federico Mena Quintero
250ae25b0a Don't use deprecated rsvg_set_default_dpi()
Use rsvg_handle_set_dpi() instead.
2019-03-12 10:20:26 -06:00
luz.paz
6d93bddbd6 Misc. typos
Found via `codespell -i 3 -w -I ../cairo-word-whitelist.txt -L tim,ned,uint`
Follow up of 12cb59be7d

Reviewed-by: Bryce Harrington <bryce@bryceharrington.org>
2019-01-31 17:37:15 -08:00
Maarten Lankhorst
a34cb719cd Add support for RGBA128F and RGB96F formats.
IGT wants to add support for planes with a bit depth >10, which
requires a higher precision format than we have currently.

I'm using RGBA as format, because of its existence in OpenGL.
With the new formats we can directly convert our bytes to half float,
or multiply a colro vector with a matrix to go to the Y'CbCr colorspace.

This requires pixman 0.36.0, so bump the version requirement.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Bryce Harrington <bryce@bryceharrington.org>
2019-01-07 19:10:44 -08:00
Uli Schlachter
4804d073e6 Remove all traces of NUM_THREADS
The code that looked at CAIRO_TEST_NUM_THREADS was removed seven years
ago in commit 6ef9779a6f, because it was dead code. I have not
managed to figure out how long exactly this code was dead already.

This commit removes the last traces of NUM_THREADS.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-12-16 09:53:07 +01:00
Bryce Harrington
6059f5f260 test: Free resources in pdf2png
Patch proposed by Bofa.

Fixes: https://gitlab.freedesktop.org/cairo/cairo/issues/317
Reviewed-by: Bryce Harrington <bryce@bryceharrington.org>
2018-10-17 17:53:12 -07:00
Paul Menzel
1c9201721d Use HTTPS URLs for freedesktop.org domains
Run the command below suggested by geirha in ##sed@irc.freenode.net.

    git grep -l 'http://.*freedesktop.org' | xargs sed -i 's|http\(://\([[:alnum:].-]*\.\)\{0,1\}freedesktop\.org\)|https\1|g'

Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
2018-10-16 10:03:07 -07:00
Paul Menzel
15ad6ca3e1 Use HTTPS URLs for cairographics.org domains
Run the command below suggested by geirha in ##sed@irc.freenode.net.

    git grep -l 'http://.*cairographics.org' | xargs sed -i 's|http\(://\([[:alnum:].-]*\.\)\{0,1\}cairographics\.org\)|https\1|g'

Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
2018-10-16 10:03:01 -07: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
Federico Mena Quintero
78a5d543b6 test/extended-blend.c: Remove obsolete comments about buggy librsvg
The comment said that using CAIRO_OPERATOR_SOURCE for the background
triggered a librsvg bug, but the relevant commit message does not even
include a link to a librsvg bug.

Also, changing it from OVER to SOURCE completely breaks these
tests (the reference images don't match at all), so this comment is
stale.  Just remove it.

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2018-09-05 17:00:44 -07:00
Bryce Harrington
dc93ea7711 test: Use C comment syntax, not C++ 2018-06-13 15:20:34 -07:00
Alexandre Bique
ccdb8e2307 Fix test compilation when font-config is disabled
Building cairo without font-config fails because test/font-variations.c
was getting compiled without freetype2.

Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2018-05-31 18:39:51 -07:00
Unknown
12cb59be7d Cairo trivial typos
Found using `codespell -q 3 -I cairo-whitelist.txt`
whereby whitelist contained:
```
amin
iff
lod
writen
```

Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2018-04-02 17:46:58 -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
Uli Schlachter
fba7a7ca27 Skip font-variations test for missing fonts
Signed-off-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2018-04-02 11:08:46 -07:00
Behdad Esfahbod
14f5b98d22 Fixup on previous commit 2018-01-19 11:10:13 -08:00
Bryce Harrington
4a09fec668 test: Fix compile with older FreeType without FT_Get_Var_Design_Coordinates
Extend earlier fix to the tests as well.
2018-01-18 21:02:12 -08:00