Commit graph

12574 commits

Author SHA1 Message Date
Manuel Stoeckl
0490607584 pdiff: convert RGB24 image values to ARGB32 on read
To avoid reading a potentially garbage alpha channel when users
of pdiff_compare pass in RGB24 images, if the format is RGB24,
force the alpha channel to be 0xff.

This commit also updates CI to adjust for the new tests that have
started/stopped failing. New failures often are cases where
the reference image has alpha transparency, but the test output
does not; new passing tests may indicate that the unused alpha
channel of an RGB24 image was garbage, but now is ignored.
2021-08-29 11:56:27 -04:00
Manuel Stoeckl
a8012953ed ci: sort lists of ignored tests 2021-08-29 11:54:36 -04:00
Tim-Philipp Müller
42d3f4cc29 Merge branch 'meson-pthread-tests' into 'master'
meson: enable pthread tests if 'real pthread' is available

Closes #477

See merge request cairo/cairo!176
2021-08-28 12:49:37 +00:00
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
Tim-Philipp Müller
e78a90ed98 meson: enable pthread tests if 'real pthread' is available
Fixes #477
2021-08-28 12:53:43 +01:00
Tim-Philipp Müller
187fd83aaa Merge branch 'meson-rely-on-subproject-wrap-promotion-for-indirectly-needed-wraps' into 'master'
meson: rely on automatic wrap promotion from subprojects

Closes #445

See merge request cairo/cairo!131
2021-08-28 11:52:26 +00:00
Adrian Johnson
fea2463107 Support color fonts that use the foreground color
COLR fonts can have a layer with the same color as the current text
color. This change passes the current color (if solid) through to
the font backend where it can be used to render color fonts.

scaled_glyph_lookup checks if the foreground color has changed (for
glyph that require it) and requests a new color surface if required.

This also fixes a bug where scaled_glyph_lookup would always request a
color surface for glyphs for glyphs in color fonts that do not have
color.
2021-08-28 18:07:01 +09:30
Adrian Johnson
6d169c6995 Merge branch 'cairo-fix-glyph-clipping' into 'master'
Remove the approximate glyph bounds check - with updated ref images

See merge request cairo/cairo!245
2021-08-28 07:55:49 +00:00
Adrian Johnson
e73f236da6 Update user-font-mask ref images 2021-08-28 09:19:09 +09:30
Matthias Clasen
4c7a8afb3b Remove the approximate glyph bounds check
We are trying to get an approximate bounding box for
the extents of a glyph string and use it for bailing
early if there's nothing to do, but the code computing
that approximation makes invalid assumptions: It assumes
that a glyph never extends further than max-advance-width
before or after its position. That is not true in general,
as can be seen in https://gitlab.gnome.org/GNOME/gtk/-/issues/4132
In the example there, we have a monospace fonts with ligatures
that have a negative lsb of two or three times the glyph width.

The optimization here could theoretically be fixed by iterating
over the font once to determine suitable values for how far
glyphs can extend before or after their position, but this
patch just removes it.
2021-08-28 09:19:09 +09:30
Adrian Johnson
5e76dd7a5c Merge branch 'fix-comparison-warning' into 'master'
Fix comparison is always false in malloc overflow check

See merge request cairo/cairo!236
2021-08-27 23:44:08 +00:00
Adrian Johnson
9bb1cbf724 Merge branch 'fix-warnings' into 'master'
Fix build warnings

See merge request cairo/cairo!239
2021-08-27 23:41:56 +00:00
Tim-Philipp Müller
38f0186560 meson: rely on automatic wrap promotion from subprojects
Don't ship wrap files for things that are only dependencies
of dependencies, such as gperf (for fontconfig), or
libffi + proxy-libintl (for glib).

Instead, let Meson use the wraps that these subprojects ship,
which Meson will pick up automatically since v56, so there's
no need for us to ship these wraps any more.

Bump the Meson requirement to 0.56 accordingly.

Fix expat package dep for fedora ci and bump the tag so it gets
picked up.

See https://mesonbuild.com/Release-notes-for-0-56-0.html#wraps-from-subprojects-are-automatically-promoted

Closes #445
2021-08-26 23:40:12 +01:00
Adrian Johnson
a8c8363e35 Add overflow to Makefile.sources 2021-08-26 21:05:55 +09:30
Adrian Johnson
068e9b2eb4 Fix malloc overflow check warning
To fix this warning:

../src/cairo-malloc-private.h:83:32: warning: comparison is always false due to limited range of data type [-Wtype-limits]
   83 |   ((size) != 0 && (size_t) (a) >= SIZE_MAX / (size_t) (size) ? NULL : \
      |                                ^~

Create two new macros to do the overflow checks:
_cairo_addl_size_t_overflow and _cairo_mul_size_t_overflow. Implement
them using compiler builtins where available.

Update cairo-malloc-private to use these fuctions and add an overflow
test to test the functions.
2021-08-24 07:26:35 +09:30
Adrian Johnson
0d809e8051 Fix file mode of mime_unqiue-id.c 2021-08-24 07:26:35 +09:30
Uli Schlachter
923715f2e9 Merge branch 'fix-png-write-endian' into 'master'
Read/write 16-bpc PNG data in native endian

Closes #501

See merge request cairo/cairo!230
2021-08-23 16:31:57 +00:00
Adrian Johnson
9f44d4c7c5 Merge branch 'ps-image' into 'master'
Fix PS emit image for 16-bit images

See merge request cairo/cairo!242
2021-08-22 06:48:10 +00:00
Adrian Johnson
ca3e776abe Fix PS emit image for 16-bit images 2021-08-22 15:19:47 +09:30
Adrian Johnson
0ce4c0fc29 Add cairo_pdf_surface_set_custom_metadata() 2021-08-22 13:43:34 +09:30
Adrian Johnson
78d267ee7a Fix some warnings 2021-08-22 12:07:36 +09:30
Adrian Johnson
ba3823e6b8 Fix cast between incompatible function types warnings
warning: cast between incompatible function types from ‘cairo_status_t (*)(void *, const cairo_point_t *)’ {aka ‘enum _cairo_status (*)(void *, const struct _cairo_point *)’} to ‘cairo_status_t (*)(void *, const cairo_point_t *, const cairo_slope_t *)’ {aka ‘enum _cairo_status (*)(void *, const struct _cairo_point *, const struct _cairo_slope *)’} [-Wcast-function-type]
2021-08-22 12:07:36 +09:30
Adrian Johnson
2dec76ddfe Merge branch 'warning-level' into 'master'
meson: Use warning_level

See merge request cairo/cairo!237
2021-08-16 20:09:59 +00:00
Emmanuele Bassi
e2f83446f9 Merge branch 'glib-volatile' into 'master'
gobject: Remove the use of volatile

See merge request cairo/cairo!238
2021-08-15 19:25:58 +00:00
Emmanuele Bassi
4c38b3db99 gobject: Remove the use of volatile
It is pointless, and it has been deprecated by GLib:

  https://gitlab.gnome.org/GNOME/glib/-/issues/600
  http://c.isvolatileusefulwiththreads.com/

Now we're just getting compiler warnings with recent versions of GCC.
2021-08-15 19:29:53 +01:00
Emmanuele Bassi
8ee4d5f1d3 meson: Enable _FORTIFY_SOURCE for optimized builds
Otherwise we are going to get warnings from the C library.
2021-08-15 19:12:49 +01:00
Emmanuele Bassi
8b5e285e26 meson: Use warning_level
Instead of using `-Wall` and `-Wextra` as compiler flags, set
`warning_level=2` as the default warning option.
2021-08-15 19:06:10 +01:00
Uli Schlachter
919178f1e9 Merge branch 'ebassi/build-fixes' into 'master'
build: Use subdir-objects

See merge request cairo/cairo!180
2021-08-15 13:57:42 +00:00
Uli Schlachter
3dc9607f8d Merge branch 'color-user-font-getter' into 'master'
Add cairo_user_font_face_get_render_color_glyph_func

See merge request cairo/cairo!233
2021-08-15 13:56:42 +00:00
Uli Schlachter
b166db8ad9 test/hairline.c: Add copyright header
Signed-off-by: Uli Schlachter <psychon@znc.in>
2021-08-15 10:11:28 +02:00
Uli Schlachter
0e468cf921 test/hairline.c: Use Unix line endings
Signed-off-by: Uli Schlachter <psychon@znc.in>
2021-08-15 10:10:31 +02:00
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
Tim-Philipp Müller
9f973bc433 Merge branch 'meson-update-wrap-versions' into 'master'
Meson: update wrap versions

Closes #416

See merge request cairo/cairo!133
2021-08-14 22:41:45 +00:00
Tim-Philipp Müller
61aa6dc0e1 ci: make sure existing subproject checkouts are in sync with wraps 2021-08-14 22:56:20 +01:00
Tim-Philipp Müller
34038cc773 meson: subprojects: use upstream freetype meson port and use latest release
Closes #416
2021-08-14 22:56:00 +01:00
Tim-Philipp Müller
e502f70399 meson: subprojects: update zlib wrap to latest revision 1.2.11-5 2021-08-14 22:54:05 +01:00
Tim-Philipp Müller
b6025e96c6 meson: subprojects: update glib wrap to latest stable 2.66.7 2021-08-14 22:54:05 +01:00
Tim-Philipp Müller
fb5e816c31 meson: subprojects: update expat wrap to latest version 2021-08-14 22:54:05 +01:00
Adrian Johnson
112349719b Merge branch 'ebassi/meson-gtk-doc' into 'master'
meson: Build the API reference

See merge request cairo/cairo!168
2021-08-14 21:35:07 +00:00
Emmanuele Bassi
6c3b7a487b meson: Build the API reference
The Meson build system should build the API reference using gtk-doc,
like the Autotools build does.

The option is called `gtk_doc`, which matches the existing practices in
various projects using Meson and gtk-doc.
2021-08-14 15:34:23 +01:00
Adrian Johnson
d0a2031c5c Merge branch 'fix-color-glyph-compositing' into 'master'
Fix compositing non-color glyphs in one case

See merge request cairo/cairo!224
2021-08-14 12:08:32 +00:00
Adrian Johnson
8c3c41ca73 Add cairo_user_font_face_get_render_color_glyph_func 2021-08-14 18:26:09 +09:30
Adrian Johnson
48d6061149 Merge branch 'meson-warnings' into 'master'
copy all autotools compiler warnings to meson build

See merge request cairo/cairo!215
2021-08-14 07:24:41 +00:00
Adrian Johnson
ebac15cb04 copy all autotools compiler warnings to meson build 2021-08-14 07:24:40 +00:00
Adrian Johnson
87cf0fc285 Merge branch 'issue-404' into 'master'
Fix color fonts when antialias == SUBPIXEL or NONE

Closes #404

See merge request cairo/cairo!229
2021-08-14 07:06:35 +00:00
Adrian Johnson
1e446cb31e Fix color fonts when antialias == SUBPIXEL or NONE 2021-08-14 07:06:34 +00:00
Adrian Johnson
773236010f Merge branch 'endian' into 'master'
meson: add BIGENDIAN

See merge request cairo/cairo!214
2021-08-14 06:25:15 +00:00
Adrian Johnson
6ea9ec75ed Merge branch 'issue-389' into 'master'
Add color user-font support

See merge request cairo/cairo!223
2021-08-14 06:06:20 +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