Commit graph

12760 commits

Author SHA1 Message Date
Emmanuele Bassi
ff02c2c268 Add surface-to-png in the quartz boilerplate
The cairo-boilerplate static library cannot use private API defined in
the main Cairo shared library, because it has no access to those
symbols.

Since the code is small, we can just dump it into the boilerplate
library.
2023-08-16 16:33:04 +01:00
Emmanuele Bassi
77c2820840 Drop "slim" symbols
The original "slim" symbol rewriting was added without any shred of a
set of performance evaluation, and mostly copy-pasted from a very early
version of pixman. Pixman itself never used them, and most C
libraries—like GLib and GTK—have dropped similar mechanisms over the
past 15 years, as linkers have improved considerably in the meantime.

Modern linkers provide functionality to avoid intra-library PLT jump
through flags like `-Bsymbolic-functions`; we should use that, instead,
and keep the code base more maintainable and debuggable.
2023-08-16 16:33:04 +01:00
Emmanuele Bassi
8dbc2fd5ae Merge branch 'ebassi/drop-autotools-check' into 'master'
build: Drop legacy build

See merge request cairo/cairo!502
2023-08-13 23:00:56 +00:00
Emmanuele Bassi
c68766370d build: Drop legacy build
It's been a while since we dropped the Autotools build; it's time to let
go of the past.
2023-08-13 16:45:24 +01:00
Adrian Johnson
542bfac286 Merge branch 'big-endian-swap' into 'master'
Fix FT color glyphs on big endian systems

Closes #787

See merge request cairo/cairo!500
2023-07-30 10:45:38 +00:00
Uli Schlachter
05ba8e9751 Fix FT color glyphs on big endian systems
Andreas Falkenhahn reported the issue below and indicated that the color
channels are swapped. This commit fixes the byte swap.

The problem is that be32_to_cpu() is a no-op on big endian systems.
However, we also have a bswap_32() function available that always works.

Testing done: None by me, but Andreas Falkenhahn reported that his patch
fixes colors on a PowerPC system.

Fixes: https://gitlab.freedesktop.org/cairo/cairo/-/issues/787
Signed-off-by: Uli Schlachter <psychon@znc.in>
2023-07-30 11:15:49 +02:00
Tim-Philipp Müller
00d8d3117d Merge branch 'ci-remove-meson-prefix-from-job-names' into 'master'
ci: remove meson from job names

See merge request cairo/cairo!499
2023-07-29 10:00:57 +00:00
Tim-Philipp Müller
711f71e21d ci: remove meson from job names
Autotools is gone after all, it's all meson now.
2023-07-29 10:17:01 +01:00
Uli Schlachter
89f272e3d9 Merge branch 'master' into 'master'
fix SEGV in cairo_type1_font functioons

See merge request cairo/cairo!497
2023-07-22 06:08:22 +00:00
iasunsea
35da42b681 fix SEGV in cairo_type1_font functioons 2023-07-22 11:58:20 +08:00
Adrian Johnson
0560aa5819 Merge branch 'master' into 'master'
fix read memory access

See merge request cairo/cairo!496
2023-07-20 22:24:05 +00:00
iasunsea
9a2385d412 fix read memory access 2023-07-21 00:46:44 +08:00
Tim-Philipp Müller
48a4466631 Merge branch 'fix-pulling-ft2-and-fc' into 'master'
Don't pull in FreeType and Fontconfig on Windows and Darwin

See merge request cairo/cairo!495
2023-07-20 14:50:07 +00:00
Adrian Johnson
3f732bd3d9 Merge branch 'master' into 'master'
cairo truetype reverse cmap detected memory leaks

See merge request cairo/cairo!494
2023-07-18 21:53:09 +00:00
Adrian Johnson
35a38406f5 Merge branch '5898791338508288' into 'master'
Fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=56152

See merge request cairo/cairo!493
2023-07-18 21:33:01 +00:00
Alex
af83da70f5 Refix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=56152 according to recommendations 2023-07-18 12:04:59 +00:00
Sergey Bugaev
7fe4f00721 Apply 1 suggestion(s) to 1 file(s) 2023-07-17 15:28:32 +00:00
Sergey Bugaev
bcb7937545 Consistently spell "FreeType" with capital T
Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2023-07-17 15:35:40 +03:00
Sergey Bugaev
a3a7ca452f meson: Don't pull in FreeType and Fontconfig by default
Commit f6a3f6d8ad
"Don't build fontconfig on Windows" made an attempt to prevent Meson
from automatically building Fontconfig as a subproject on Windows when
the 'fontconfig' option has its default value of 'auto'.

Unfortunately, this only made things worse instead of fixing them.

Meson feature options can have three states: 'enabled', 'auto', and
'disabled'. They are primarily intended to be used as a value for the
'required' option of the 'dependency()' function. When the system
dependency is not found, but a fallback subproject is provided
explicitly with the 'fallback' option, a feature option in the 'auto'
state still causes the subproject to get built.

Since there's no apparent way to produce a value of the "feature option
object" type in a specific state, commit f6a3f6d8ad instead
set fontconfig_option = false (when it wasn't set to 'enabled', i.e. it
was either 'auto' or 'disabled') in an attempt to disable building the
subproject. However, a boolean value of false is equivalent to 'auto',
not to 'disabled'. This is documented at
https://mesonbuild.com/Build-options.html#features

So commit f6a3f6d8ad wanted to convert
'auto' to 'disabled', but instead effectively converted 'disabled' to
'auto', causing the Fontconfig subproject to be always built on Windows,
even when explicitly turned off with -D fontconfig=disabled.

A way to accomplish the original goal is available since Meson 0.59;
feature option objects gained the '.disable_auto_if()' method that
exactly converts 'auto' to 'disabled' if the boolean condition is true.
So make use of this method to properly turn off building Fontconfig on
Windows, unless explicitly enabled with -D fontconfig=enabled.

Apply the same for FreeType, which is also not very useful on Windows.

See also: 7f8135bfeb

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2023-07-17 15:34:44 +03:00
iasunsea
e2e826b0b1 cairo truetype reverse cmap detected memory leaks 2023-07-14 23:01:14 +08:00
Alex
90e38be99d Fix warning 2023-07-10 19:01:32 +00:00
Alex
2ecbfbce46 Fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=56152 memory read access because of incorrect size 2023-07-10 18:36:53 +00:00
Emmanuele Bassi
e97cfe0b73 Merge branch 'readme-gl' into 'master'
readme: drop reference to OpenGL backend

See merge request cairo/cairo!492
2023-07-10 11:58:50 +00:00
Simon Ser
0ccaf5bd68 readme: drop reference to OpenGL backend
The experimental OpenGL backend has been removed in [1]. Let's drop the
stale reference from the README.

[1]: https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/287
2023-07-10 12:50:38 +02:00
Adrian Johnson
2919f392d3 Merge branch 'check-def-arches' into 'master'
meson-check-def: Exclude sections from symbol list seen on ARM & MIPS

See merge request cairo/cairo!488
2023-07-03 21:34:58 +00:00
Adrian Johnson
718e577adf Merge branch 'fix-no-png-build' into 'master'
Disable svg glyph renderer when PNG is disabled

Closes #784

See merge request cairo/cairo!489
2023-07-03 21:27:48 +00:00
Uli Schlachter
5ef0375a7d Disable svg glyph renderer when PNG is disabled
When trying to build with -Dpng=disabled with a new enough FreeType
version, the build would fail in cairo-svg-glyph-renderer.c:

    src/cairo-svg-glyph-render.c:1841:15: error: implicit declaration of
    function ‘cairo_image_surface_create_from_png_stream’; did you mean
    ‘cairo_image_surface_create_for_data’?
    [-Werror=implicit-function-declaration]

Fix this by disabling HAVE_FT_SVG_DOCUMENT when png is not enabled.

Fixes: https://gitlab.freedesktop.org/cairo/cairo/-/issues/784
Signed-off-by: Uli Schlachter <psychon@znc.in>
2023-07-03 18:06:17 +02:00
Uli Schlachter
e7aa3a4c09 Merge branch 'hurd' into 'master'
Hurd has no MAP_NORESERVE so don't use it there

See merge request cairo/cairo!486
2023-07-03 15:06:14 +00:00
Jeremy Bícha
5118007b06 meson-check-def: Exclude sections from symbol list seen on mips 2023-07-03 09:30:51 -04:00
Jeremy Bícha
67c0202674 meson-check-def: Exclude sections from symbol list seen on ARM 2023-07-03 09:30:48 -04:00
Sebastian Dröge
baf2593852 Hurd has no MAP_NORESERVE so don't use it there 2023-07-02 10:19:06 -04:00
Uli Schlachter
0317aafd3f Merge branch 'fix-signed-left-shift' into 'master'
Avoid undefined signed left shift

See merge request cairo/cairo!484
2023-07-01 07:49:34 +00:00
Adrian Johnson
afac8b0e7d Avoid undefined signed left shift
Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1841190
2023-06-30 18:43:00 +09:30
Uli Schlachter
42555cb0a7 Merge branch 'tag_stack' into 'master'
Fix use-after-free in _cairo_tag_stack_pop

See merge request cairo/cairo!483
2023-06-29 15:11:17 +00:00
Jonathan Kew
4e0f76473f Fix use-after-free in _cairo_tag_stack_pop 2023-06-29 12:52:33 +00:00
Adrian Johnson
d68eb3c8df Merge branch 'fix-colrv0-handling' into 'master'
Fix rendering of COLRv0 fonts

See merge request cairo/cairo!482
2023-06-06 22:01:01 +00:00
Matthias Clasen
05c6bb4ce1 Fix rendering of COLRv0 fonts
This was found while debugging why The Twemoji Mozilla
font renders a white-on-while in pango.

We need to call _render_glyph_bitmap, since we want
FT_Render_Glyph to handle the COLRv0 layers for us.
2023-06-06 14:44:52 -04:00
Adrian Johnson
111095d9dd Merge branch 'update-to-fedora-38' into 'master'
Update CI to Fedora 38

See merge request cairo/cairo!474
2023-06-05 22:18:33 +00:00
Adrian Johnson
90fda58934 Fix PS crash with color font and CAIRO_COLOR_MODE_NO_COLOR 2023-06-05 22:04:46 +09:30
Adrian Johnson
c381a773de Update CI to Fedora 38 2023-06-05 22:04:33 +09:30
Uli Schlachter
38873d2568 Merge branch 'fix-leftover' into 'master'
Remove stray #error in dw-extra.h

See merge request cairo/cairo!481
2023-05-31 15:06:51 +00:00
Luca Bacci
50225f55ba Remove stray #error in dw-extra.h 2023-05-31 12:28:56 +02:00
Adrian Johnson
a2def1bd06 Merge branch 'ci-bump-windows-image' into 'master'
ci: bump windows image to latest

See merge request cairo/cairo!480
2023-05-30 22:00:03 +00:00
Tim-Philipp Müller
bb5577616c ci: bump windows image to latest 2023-05-29 11:06:06 +01:00
Adrian Johnson
0d7e0dcb17 Merge branch 'issue-782' into 'master'
Use a spinlock to prevent race condition when initializing mutexes

Closes #782

See merge request cairo/cairo!478
2023-05-27 10:20:57 +00:00
Adrian Johnson
46e538ddbb Use a spinlock to prevent race condition when initializing mutexes
Fixes #782
2023-05-27 19:01:47 +09:30
Adrian Johnson
9831eba0ec Merge branch 'issue-778' into 'master'
ft: don't use scaled_glyph->dev_private to store data

Closes #778

See merge request cairo/cairo!476
2023-05-13 22:07:36 +00:00
Adrian Johnson
10cc34f521 ft: don't use scaled_glyph->dev_private to store data
It is also used by the xlib surface.

Fixes #778
2023-05-13 18:53:16 +09:30
Adrian Johnson
8d6586f49f Merge branch 'issue-777' into 'master'
Don't assume HAVE_FT_PALETTE_SELECT is defined when HAVE_FT_SVG_DOCUMENT is defined

Closes #777

See merge request cairo/cairo!475
2023-04-30 08:35:19 +00:00
Adrian Johnson
b86f24634c Don't assume HAVE_FT_PALETTE_SELECT is defined when HAVE_FT_SVG_DOCUMENT is defined
Fixes #777
2023-04-30 17:26:36 +09:30