Commit graph

2132 commits

Author SHA1 Message Date
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
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
Behdad Esfahbod
a7a0085713 Merge branch 'font-variations' 2018-01-03 12:35:12 +00:00
Uli Schlachter
6b0593827b Add test for error handling with broken PNG streams
Would-have-caught: https://bugs.freedesktop.org/show_bug.cgi?id=104325
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-12-24 13:23:13 +01:00
Matthias Clasen
46034b0547 Make the font-variations test pass
Not sure what I was thinking - the test is checking the width
axis, but the font we're using has only weight and contrast
as axes...
2017-12-19 15:18:57 -05:00
Behdad Esfahbod
34047d11db [variations] Fix test
This does not exercise merging of variations from font-options and from
pattern.  Before this commit the code was more towards doing that.
2017-12-19 15:17:01 -05:00
Behdad Esfahbod
6accf16093 [variations] Towards fixing test 2017-12-19 15:17:01 -05:00
Matthias Clasen
38b6e23609 Add a test for font variations
This test checks that passing font variation settings via
font options has the desired effect. It checks this by reading
the effective axis values out of the FT_Face after creating
a font with these options.
2017-12-19 15:17:01 -05: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
7d3ba77b6c ps: use Reusable streams for forms in Level 3
to avoid emitting image data as strings
2017-11-09 22:01:40 +10:30
Adrian Johnson
b1c7a087b5 ps: use forms for surfaces with UNIQUE_ID mime type
to ensure the surfaces are emitted only once.

fixes mime-unique-id PS output
2017-11-09 22:01:40 +10:30
Adrian Johnson
d5cb45013b pdf: fix mime-unique-id jpeg attached to recording test
- Restructure the emit_surface code so that mime types are checked first.

- Add a test parameter to emit_surface to test if the surface will be emitted
  as an image or recording instead checking the surface type as the attached
  mime may override this.

- Mark surface as not clear when mime is attached to avoid optimizing away
  "clear" surfaces that have mime attached.

- Include entire surface in analysis if mime attached (also fixes bug with
  calculating the extents CONTENT_COLOR surfaces)
2017-11-09 22:01:40 +10:30
Adrian Johnson
5e4707a10d Add mime-unique-id test
to check that PS/PDF embeds images with CAIRO_MIME_TYPE_UNIQUE_ID only
once.
2017-11-09 20:52:36 +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
Adrian Johnson
27990e3910 fix unused function warnings 2017-10-16 20:18:49 +10:30
Adrian Johnson
1d58e0f818 svg2png: remove unused headers 2017-10-15 19:42:08 +10:30
Adrian Johnson
609261bcbc pdf: use explicit dest instead of named dest when 'internal' attribute is set 2017-08-29 21:43:07 +09:30
Adrian Johnson
12b875aef3 pdf: use link attributes instead of dest name for cairo_pdf_surface_add_outline
In PDF outline targets are specified the same way as link targets so
there is no need to restrict the target to dest names.
2017-08-26 16:32:48 +09:30
Adrian Johnson
bb4ab5a8be tests: fix bug in pdf-tagged-text that was introduced in 4790a36 2017-08-19 10:52:18 +09: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
Kouhei Sutou
dd4706d0a9 pdf: Fix wrong cairo_pdf_outline_flags_t item prefix 2017-01-05 08:33:07 +10:30
Adrian Johnson
4790a3663d strndup is not avuilable with MSVC 2016-10-07 07:38:37 +10:30
Adrian Johnson
55f8c6d9f4 fix compiler warnings 2016-10-04 12:00:30 +10:30
Adrian Johnson
23fd706bd1 add test for PDF document interchange features such as tagged text and links 2016-10-01 22:48:05 +09:30
darxus@chaosreigns.com
cbbd02f9c5 Add example to run specific tests by name to the test/README
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Uli Schlachter <psychon@znc.in>
2016-08-31 20:29:57 -07:00
darxus@chaosreigns.com
66205ad48e Remove closed poppler bugs from test/README
These bugs have all been closed resolved / fixed for years.

Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-08-31 18:22:10 -07:00
Adrian Johnson
deb994488f test: refresh text-rotate ref images 2016-07-05 20:26:47 +09:30
Adrian Johnson
d92015e4f9 add test text-unhinted-metrics
Based on bug report in https://lists.cairographics.org/archives/cairo/2016-April/027334.html
2016-07-05 20:26:47 +09:30