Commit graph

68 commits

Author SHA1 Message Date
Adrian Johnson
1585587668 dwrite: create C++ dwrite header 2023-01-31 06:54:32 +10:30
Emmanuele Bassi
b5793081d0 Drop cairo-gl
The GL support in Cairo has always been a prototype, and
nothing happened in the past 10+ years to make it work as
it was meant to.

GL support is not enabled by any downstream packagers of
Cairo, so nobody should notice its absence.
2023-01-27 19:21:46 +00:00
Adrian Johnson
d5e8a8c02e We don't use HAVE_CONFIG_H anymore 2023-01-15 19:00:22 +10:30
Fujii Hironori
8520ef5221 Defining Windows version macros in meson.build
WINVER and _WIN32_WINNT macros were defined in each source files and
headers that were including <windows.h>. However, because DirectWrite
requires new Windows API, some files included <windows.h> without the
version macros. This inconsistency sometimes caused troubles.

Define the version macros in meson.build.
2023-01-13 05:47:03 +09:00
Adrian Johnson
dd8f55100a Require -DDEBUG_ENABLE_COLR_V1 to enable the COLR v1 renderer
Once there is a FreeType release where the COLR v1 API is no longer
marked experimental, we can change this to a version check.
2023-01-08 15:15:13 +10:30
Adrian Johnson
3c8dec60e5 Integrate COLR v1 renderer with cairo-ft-font.c 2023-01-08 15:15:13 +10:30
Adrian Johnson
252ff60f1e SVG font test using cairo logo 2022-12-28 13:22:00 +10:30
Adrian Johnson
31700fed4f Support SVG fonts in FT backend 2022-12-28 13:22:00 +10:30
Benjamin Gilbert
6ec9cd3096 meson: allow disabling DWrite
When building with MinGW-w64, DWrite introduces a libstdc++ dependency
which may not be desired.
2022-12-24 20:18:46 -05:00
Luca Bacci
c75220fe08 Remove explicit dependency on libssp
It's not needed anymore.

Linking explicitly with libssp was required for toolchains where the
target libc doesn't implement stack smashing protection routines on
its own, and instead delegates to the generic implementations provided
by libssp. Notably, this was the case of mingw-w64 toolchains.

After discussion upstream with Meson developers [1], the stance taken
is that Meson users (and Meson itself) shall have no knowledge of the
libc internals and whether libssp is required. instead, libc's should
declare a dependency on the generic libssp on their own by means of
.spec files [2].

Following the discussion in Meson Github, the issue was then fixed in
mingw-w64 upstream [3].

References:
 * https://github.com/mesonbuild/meson/issues/10673
 * https://gcc.gnu.org/onlinedocs/gcc/Spec-Files.html
 * https://github.com/msys2/MINGW-packages/issues/13401
2022-10-28 12:44:45 +02:00
Simon McVittie
179c27b1d7 meson: Only link cairo-script-interpreter with liblzo
The rest of cairo (and therefore most external packages that depend
on cairo) doesn't make any use of liblzo.

Signed-off-by: Simon McVittie <smcv@debian.org>
2022-07-18 10:01:38 +01:00
Luca Bacci
c479479b69 Meson: use an array to provide multiple arguments 2022-07-06 12:05:00 +02:00
Adrian Johnson
f0ba2165a6 Add color palette option 2022-06-17 20:42:43 +09:30
Luca Bacci
c3fc772948 Meson: link to -lssp when enabling _FORTIFY_SOURCE
This is required for MinGW GCC
2022-06-07 19:35:57 +02:00
John Ralls
77a8d0f9e4 [quartz] Require at least Mac OS X 10.7 Lion
Allows removal of most conditional compilation and dlsym lookups.
2022-04-24 13:08:48 -07:00
luz paz
25d588e6c0 Fix typos in doxygen and source comments 2022-03-28 16:43:03 -04:00
Adrian Johnson
5635c75a2c dwrite: add color font support 2022-02-27 20:20:24 +10:30
Adrian Johnson
90ca635472 Import win32 dwrite font backend from
https://hg.mozilla.org/mozilla-central/file/7338d7d940913147f8a1b1e8bd2b25ab255f4373/gfx/cairo/cairo/src

and add to the meson build. I've omitted the
cairo_surface_set_subpixel_antialiasing() API and its use in quartz
and dwrite. Not sure if that is needed.

It compiles. Not tested.
2022-02-27 15:44:58 +10:30
Emmanuele Bassi
9b9028c160 Drop cairo-vg surface
OpenVG is a failed experiment from 10 years ago, and nobody has been
using the cairo-vg surface in pretty much the same amount of time.
2022-02-25 02:09:58 +00:00
Emmanuele Bassi
fc3437128d Remove cairo-directfb
Nobody cares about DirectFB any more, not even the people that registered
and maintained the DirectFB domain.
2022-02-25 02:03:35 +00:00
Emmanuele Bassi
803afe6edd tanis: Remove cairo-cogl
Cogl's upstream is unmaintained, and has been for the past 6 years.
2022-02-25 01:58:24 +00:00
Emmanuele Bassi
1409079eef Remove cairo-drm
The DRM backend has always been a science experiment, but now it hasn't
been built in more than 10 years, and it's completely broken.
2022-02-25 01:54:29 +00:00
Emmanuele Bassi
64db153c43 Drop OS/2 support
OS/2 support was last built in Cairo 1.12, which was released 10 years
ago.

Additionally, OS/2 is not supported by Meson.
2022-02-25 01:44:57 +00:00
Emmanuele Bassi
81ecff3800 Remove BeOS support
Nobody cares about BeOS in 2022, and it cannot be built with Meson anyway.

Removing the BeOS backend also allows us to drop the dependency on a C++
compiler and simplify the Autotools build considerably by removing all
the extra CXX targets.
2022-02-25 01:39:29 +00:00
Emmanuele Bassi
64ece6d545 Remove Qt surface
It's disabled by default, and unsupported as it depends on Qt4, which
has been EOL since 2015.
2022-02-25 01:19:58 +00:00
David King
627aa65674 meson: Add xml option and disable by default
Just like autotools does.
2022-02-15 13:32:13 +00:00
Nirbheek Chauhan
e3b4db1645 meson: Remove useless version_compare()
We require meson 0.56 in project() now, all these are redundant.
2022-01-09 17:17:28 +05:30
Adrian Johnson
23815978cc Merge branch 'master' into color-font-foreground-color 2021-09-17 06:25:07 +09:30
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
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
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
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
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
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
ebac15cb04 copy all autotools compiler warnings to meson build 2021-08-14 07:24:40 +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
Rick Yorgason
3ee18ffc28 Added extra check for HAVE_STRNDUP in Win32 Mingw Meson build
Mingw on Windows defines the strndup function, but it's not actually usable because string.h doesn't exist. See details on the Meson bug here: https://github.com/mesonbuild/meson/issues/3672

Note that although Meson marked this bug as "fixed", it's only fixed in the case where you're using `prefix : '#include <string.h>'`.
2021-08-01 17:30:06 -07:00
Adrian Johnson
e2c002c570 meson: add endian check
Fixes #464
2021-07-31 06:34:30 +09:30
Uli Schlachter
43a48fb6a5 Merge branch 'more-meson' into 'master'
Add more of the auto-foo build to meson

See merge request cairo/cairo!183
2021-06-17 14:25:16 +00:00
Uli Schlachter
1981fb6dfb meson: Use more dependency objects
For example, to depend on cairo-script, inccairoscript was added to
"include_directories:" and libcairoscript was added to "link_with:".
This commit instead uses the libcairoscript_dep dependency everywhere.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2021-05-22 07:59:52 +02:00
Uli Schlachter
339671c787 meson: Add perf/ directory
This adds the code under perf/ to meson. The only testing I did was "it
builds for me". I do not have gtk+2 installed and so I did not even try
whether that thing builds. Besides that, I mostly tried to stay close to
the autofoo build.
2021-05-15 10:53:08 +02:00
Uli Schlachter
45cca0c984 meson: Move CAIRO_HAS_INTERPRETER to config.h
This is what autoconf does and hopefully that means this is the correct
thing to do.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2021-05-02 21:25:48 +02:00
Emmanuele Bassi
8336309794 meson: Define HAVE_CONFIG_H as a project flag
Precisely what Autotools does, instead of adding it as per-target C
argument.

Once we remove HAVE_CONFIG_H checks in every source file, we'll be able
to drop it.
2021-05-01 16:55:38 +01:00
Emmanuele Bassi
0f39b79575 Define _GNU_SOURCE in order to use memmem
The memmem() function is a GNU extension, which means we need to define
_GNU_SOURCE in order to avoid a compiler warning about a missing
declaration.
2021-04-27 16:59:35 +01:00
Matthias Clasen
f6a3f6d8ad Don't build fontconfig on Windows
mesons 'auto' is too eager to build things. Building
fontconfig as a subproject on Windows is not the right
thing, unless it was explictly requested.
2021-04-19 11:49:31 -04:00
Uli Schlachter
7788000be0 Merge branch 'meson-allow-skipping-of-run-check-for-ipc-rmid-deferred-release-in-cross-build' into 'master'
meson: allow skipping of run check for IPC_RMID_DEFERRED_RELEASE

Closes #408

See merge request cairo/cairo!134
2021-03-05 08:08:55 +00:00
Uli Schlachter
55a5951742 meson: Move libspectre to test_deps
libspectre is only used for ps tests. Adding it to "deps" needlessly
makes it show up in cairo.pc's Requires.private.

Fixes: https://gitlab.freedesktop.org/cairo/cairo/-/issues/425
Signed-off-by: Uli Schlachter <psychon@znc.in>
2021-03-01 14:06:02 +01:00
Tim-Philipp Müller
1bec56ea8a meson: allow skipping of run check for IPC_RMID_DEFERRED_RELEASE
The run check is particularly annoying in cross-compile scenarios,
so allow bypassing the check by having the user provide the value
via a cross file or native file:

  [properties]
  ipc_rmid_deferred_release = true

Closes #408
2021-02-25 10:56:45 +00:00