Commit graph

226 commits

Author SHA1 Message Date
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
Adrian Johnson
a8c8363e35 Add overflow to Makefile.sources 2021-08-26 21:05:55 +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
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
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
fa5179e9fd Add a test with operator samples from https://cairographics.org/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
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
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
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
03a820b173 Fix mask usage in image-compositor 2020-12-15 16:48:19 +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
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
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
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
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
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
Adrian Johnson
23fd706bd1 add test for PDF document interchange features such as tagged text and links 2016-10-01 22:48:05 +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
Adrian Johnson
8e4d4de2a3 test: replay record surface with negative extents for each extend mode
image fails for repeat, reflect, and pad.
2016-06-05 20:43:36 +09:30
Adrian Johnson
58df191946 Add recording-ink-extents test
bounded_fill fails returning extents origin of (0, 0) instead of (-150, -100)
2016-06-05 20:43:36 +09:30
Adrian Johnson
9fff6f0be3 test: add record-neg-extents
Test case for bug 89232 - painting a recording surface to a
pdf/ps surface omits objects on the recording surface with negative
coordinates even though the pattern matrix has transformed the objects
to within the page extents.

The image surface also fails when the recording surface is bounded.
2016-06-05 20:43:36 +09:30
Adrian Johnson
30eb1b0e97 Add test case for thin lines
Bug 77298
2015-10-17 18:39:19 +10:30
Chris Wilson
50b41e2145 test: Add a simple rasteriser to check fidelity of edge rendering
In order to check the behaviour of the analytic rasteriser inside tor,
let's compare it against a very simple rasteriser that uses a rectiliner
256x256 sample grid.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-02 00:06:27 +01:00
Ravi Nanjundappa
93c21e3fd3 test: Add test for egl-surface-source
This test file attempts to use a EGL backend surface as a source
surface for all other backends.

Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
2014-09-29 16:08:23 -07:00
Chris Wilson
80359e73d8 test: Exercise stroking bugs with xlib/trapezoids
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84115
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-24 12:35:47 +01:00
Ravi Nanjundappa
8479b60867 test: Add test oversized egl surfaces
This test exercises error scenario when creating over sized egl surface
that is larger than maximum framebuffer or texture dimensions of the
context

Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
2014-09-19 15:46:14 -07:00
Behdad Esfahbod
8d2e24479a [tests] Add path-currentpoint
Checks whether copy_path()/append_path() preserves current-point.
Currently failing.
2014-01-27 17:32:58 -05:00
Adrian Johnson
2974416dfc Add test for paint with alpha and clipping bug
Add test case for https://bugs.freedesktop.org/show_bug.cgi?id=68382

Something has regressed in the recording surface. All the recording
surface based backends lose the alpha from the paint_With_alpha.
2013-12-26 17:18:41 +10:30
Adrian Johnson
acd78d721e Add test for rectangle path optimization with non rectilinear pen
This fails on pdf/ps.
2013-12-26 15:27:30 +10:30
Bryce Harrington
642b6d8091 test: Add test for image downscaling
This adds pixman-downscale.c, which tests correctness of PNG images
scaled down using pixman routines.

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2013-09-11 19:32:08 +02:00
Martin Robinson
95f320e3f2 gl: Return surface in error when creating oversized texture surfaces
When creating a texture surface that is larger than the maximum
framebuffer or texture dimensions of the context, return a surface in
error. Previously the code failed an assertion, but this prevents an
application from easily detecting when to fall back.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-19 14:54:28 -07:00
Uli Schlachter
9058e9ae28 Add new test for bug 61592
This test exercises some clipping-related failure that Seongwon Cho reported.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61592
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-07-04 21:57:12 +02:00
Chris Wilson
02b467a287 test: Exercise replaying a recording surface through a flip matrix 2013-02-12 10:46:42 +00:00
Martin Robinson
d1184b69e8 gl: Do less work when acquiring and releasing devices
After acquiring a GL device and the same GL context, surface, and
display combination is already active outside of Cairo, do not ask EGL
or GLX to change the current context as that may cause a flush on some
drivers. Also do not unset the context when releasing the device for the
same reason.
2013-01-08 15:09:33 -08:00
Uli Schlachter
5fb364287f test: Add xcb-huge-subimage
This creates an image surface with a non-natural stride and paints it to a
similar surface.

In the xcb backend, this causes a call to _cairo_xcb_connection_put_subimage()
which tries to send a huge PutImage request. As a result, xcb kills the X11
connection.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-12-17 18:37:10 +01:00
Chris Wilson
2dd4ff3206 test: Add stroke-clipped
Exercise a bug in the determine of clip-bounds when stroking, as
reported by ed44.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-02 14:48:40 +00:00
Chris Wilson
3969f2c687 test: Add clip-disjoint-quad
Exercises a bug in the polygon intersection code demonstrated by Søren
Sandmann.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-27 09:58:50 +01:00