Commit graph

12188 commits

Author SHA1 Message Date
Adrian Johnson
b63dc83c8b Merge branch 'ci-update-windows-image' into 'master'
ci: update windows image and fix pixman build on android

Closes #515

See merge request cairo/cairo!257
2021-10-04 02:35:50 +00:00
Tim-Philipp Müller
ccb57d21ce ci: disable aarch64 neon asm in pixman to fix android build
To work around build failures, see #515
2021-10-03 13:17:49 +01:00
Tim-Philipp Müller
e3ba30bf7e ci: update windows image
Some root certs expired, which causes problems with letsencrypt
certificates, so update to latest image with updated certificates.

https://letsencrypt.org/docs/dst-root-ca-x3-expiration-september-2021/

Fixes #515
2021-10-03 12:47:31 +01:00
Adrian Johnson
d87fe096b9 Merge branch 'user-font-foreground-color' into 'master'
Support user fonts that use the foreground color

See merge request cairo/cairo!249
2021-09-20 09:01:58 +00:00
Adrian Johnson
8ea4ae5413 Allow user fonts to use the foreground color 2021-09-18 07:05:35 +09:30
Uli Schlachter
4f761bd5aa Merge branch 'fix-core-diff' into 'master'
Explicitly handle image formats in buffer_diff_core and pdiff_compare

Closes #25

See merge request cairo/cairo!243
2021-09-17 13:48:46 +00:00
Adrian Johnson
994e33215e Merge branch 'color-font-foreground-color' into 'master'
Support color fonts that use the foreground color

See merge request cairo/cairo!246
2021-09-16 21:47:25 +00:00
Adrian Johnson
23815978cc Merge branch 'master' into color-font-foreground-color 2021-09-17 06:25:07 +09:30
Adrian Johnson
4c520fea21 Merge branch 'custom-metadata' into 'master'
Add cairo_pdf_surface_set_custom_metadata()

See merge request cairo/cairo!240
2021-09-16 20:47:50 +00:00
Adrian Johnson
ffa2374b05 Merge branch 'large-pdf-file' into 'master'
Allow > 2GB PDF files on platforms with 32-bit long

See merge request cairo/cairo!251
2021-09-16 20:47:08 +00:00
Tim-Philipp Müller
224b44e9d4 Merge branch 'fix-no-png-dep' into 'master'
meson: fix build without libpng

See merge request cairo/cairo!252
2021-09-12 15:49:13 +00:00
Tim-Philipp Müller
08cd1fdebe meson: fix build without libpng
meson.build:966:2: ERROR: Expected 1 arguments, got 0.
2021-09-12 15:55:31 +01:00
Adrian Johnson
918fe02666 Merge branch 'ming-warnings' into 'master'
Fix some MinGW warnings

See merge request cairo/cairo!247
2021-09-02 20:36:19 +00:00
Adrian Johnson
2822728f2a Fix some MinGW warnings
The FT change is because my MinGW build is using a more recent version
of FT.

Remove the disabled _cairo_win32_scaled_font_text_to_glyphs() code to
fix the defined but not used warning.

_cairo_win32_scaled_font_text_to_glyphs() was diabled in d9408041aa with
the comment:

  "Currently disable the win32-font text_to_glyphs(), until that one
   is updated.  Or better yet, remove it and implement
   ucs4_to_index().  It's the toy font API afterall."

_cairo_win32_scaled_font_ucs4_to_index() was added in d1c619bc7d.
2021-09-02 21:14:51 +09:30
Adrian Johnson
6e3c7431ff Allow > 2GB PDF files on platforms with 32-bit long 2021-09-02 18:39:53 +09:30
Manuel Stoeckl
6647511593 test: explicitly handle image formats in buffer_diff_core
In practice, the A and B images may be any mixture of RGB24 and
ARGB32 formats, so this change accepts all combinations of these
types, and converts the pixel values to a common (ARGB32) format
as needed.

Some of the newly added test failures are cases where the image
output is RGB24, but the matching reference image is ARGB32 with
noticeable transparency. Some of the newly passing tests are cases
where the unused 'alpha' channel of an RGB24 image was not equal
to 0xff, and the previous code had incorrectly used this channel
in max_diff calculations.
2021-08-29 11:57:30 -04:00
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
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