Commit graph

425 commits

Author SHA1 Message Date
Emmanuele Bassi
47a932bffc Merge branch 'no-more-gl' into 'master'
Drop cairo-gl

See merge request cairo/cairo!287
2023-01-29 01:32:55 +00:00
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
Behdad Esfahbod
25b6775cc6 [malloc-stats] Measure calloc 2023-01-26 14:20:12 -07:00
Adrian Johnson
cbcf962da2 svg-font: return SVG_FONT_ERROR on error 2023-01-20 20:37:45 +10:30
Uli Schlachter
b23ecf6322 Merge branch 'test-png16-load' into 'master'
Add test for loading 16 bit PNG images

See merge request cairo/cairo!241
2023-01-15 19:54:04 +00:00
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
Manuel Stoeckl
b0a5c3a11f Add remaining image formats to cairo-script constants table
This makes it possible to read cairo-script files which embed
RGB30/RGB96F/RGBA128F images.
2023-01-11 06:38:43 -05:00
Adrian Johnson
efe303d9db Remove autotools build 2023-01-08 22:27:47 +10:30
Adrian Johnson
82aa3fb80e Fix bug in strndup implementation
The strlen() could go past the n bytes and into a memory address we
don't have read access to.
2023-01-03 15:27:05 +10:30
Behdad Esfahbod
71c4443139 [malloc-stats] Fix to not crash
Can't use constructor as malloc might be called before that.
2022-12-30 10:34:46 -07: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
Emmanuele Bassi
74f2da7b70 Merge branch 'fix-build-with-newer-libbfd' into 'master'
Fix build with newer binutils-dev installed

Closes #581

See merge request cairo/cairo!342
2022-07-14 10:41:29 +00:00
Simon McVittie
24996e6ee2 Fix build with newer binutils-dev installed
It seems the PTR typedef (or macro?) has been removed from newer versions
of libbfd.

Resolves: https://gitlab.freedesktop.org/cairo/cairo/-/issues/581
Signed-off-by: Simon McVittie <smcv@debian.org>
2022-07-14 10:27:41 +01:00
Simon McVittie
f02f70d88e util: Don't expose _csi_stack_push in public ABI
This wasn't previously marked as private because it was initially
static inline, and only became extern later.

Fixes: 9ffbf63d "fix warning: inlining failed in call to '_csi_stack_push'"
Resolves: https://gitlab.freedesktop.org/cairo/cairo/-/issues/580
Signed-off-by: Simon McVittie <smcv@debian.org>
2022-07-14 10:21:57 +01:00
Pierre Labastie
c087722141 Update util/cairo-script/cairo-script-interpreter.pc.in 2022-05-14 16:56:17 +00:00
Adrian Johnson
5b18aeffbb Replace use of ctype functions with internal version where only ASCII chars are used
In !309 Taylor R Campbell found a number of instances of ctype
incorrectly passed a signed char. In many cases, where only ASCII
characters are used, the code should have been using the cairo version
of the ctype function to avoid locale issues.
2022-04-09 22:08:57 +09:30
Adrian Johnson
9bb2036369 Fix warning
../util/malloc-stats.c:295:1: warning: no previous declaration for ‘malloc_stats’ [-Wmissing-declarations]
2022-03-09 19:43:48 +10:30
Adrian Johnson
d2f1827cde Replace deprecated malloc_hook 2022-03-09 06:58:28 +10:30
Adrian Johnson
989d368dc5 DWrite font docs 2022-03-05 16:56:56 +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
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
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
Rick Yorgason
ecec0419f8 Added hairline support to cairo 2021-08-15 06:58:54 +00:00
Adrian Johnson
9fbf427548 Use uintptr_t for all casts between pointer and integer
On 64-bit windows, long is 32-bit. When compiling there are a large
number of warnings about mismatched sizes when casting long to/from a
pointer.

Use the (u)intptr_t type for any integer that will have a pointer stored
in it. Use a (u)intptr_t cast when integers are stored in pointers to
silence warnings.

Fixes #263
2021-07-25 11:01:20 +09:30
Uli Schlachter
1e34651420 Fix meson build without zlib
Trying to build with meson with -Dzlib=disabled failed with the
following error message:

cairo/test/meson.build:599:2: ERROR: Unknown variable
"libcairoscript_dep".

This commit fixes that problem by adding a not-found dependency if
cairo-script is not built.

Additionally, follow-up problems are fixed:

- any2ppm.c still tried to include cairo-script-interpreter.h, which was
  not found
- Building cairo-test-trace was attempted, but that also failed because
  of missing script support.

Fixes: https://gitlab.freedesktop.org/cairo/cairo/-/issues/475
Signed-off-by: Uli Schlachter <psychon@znc.in>
2021-05-22 08:16:47 +02: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
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
bd13841257 Drop the conditional inclusion of config.h
We *always* generate this file, and we depend on its existence.

The idea behind HAVE_CONFIG_H was being able to include random files
from different projects, back in a time where "libraries" were literally
just random files instead of actual shared objects.

Since we're not in the '80s any more, and our build system(s) define
HAVE_CONFIG_H *and* generate the config.h header file, we don't need a
conditional guard around its inclusion.
2021-05-01 17:05:29 +01:00
Emmanuele Bassi
bfd1602db9 Remove stray _GNU_SOURCE definitions
We define _GNU_SOURCE globally in both the Autotools build, through the
use of the AC_USE_SYSTEM_EXTENSIONS macro; and in the Meson build, with
add_project_arguments().
2021-05-01 16:58:15 +01: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
Uli Schlachter
64e1fd70ec Merge branch 'ebassi/warnings-fixes' into 'master'
Avoid a bunch of compiler warnings

See merge request cairo/cairo!166
2021-04-27 16:30:44 +00:00
Emmanuele Bassi
efab74f5a1 Drop volatile from the GType registration
The `volatile` is unnecessary, and newer versions of GLib and GCC will
complain if you use it.
2021-04-27 16:59:35 +01:00
Emmanuele Bassi
b7d38e048f Use g_memdup2() with newer versions of GLib
The g_memdup() function has been deprecated, as it takes the size of the
memory area as an unsigned integer. The g_memdup2() replacement uses the
more appropriate size_t type, instead.
2021-04-27 16:54:22 +01:00
Tim-Philipp Müller
ca478e0327 meson: make cairo-trace executable
Install with exec flag set and make sure tool is
executable in build directory as well (by making
the input file in the source directory executable).

Fixes #462
2021-03-09 10:59:57 +00:00
Tim-Philipp Müller
0ed1053d8f utils: remove hacky replacement for backtrace_symbols in glibc
Doesn't build any more, is very much non-essential, and hasn't
been touched in any meaningful way since it was added 13 years
ago, so just remove it for now until someone steps up. Chances
are the glibc version has improved since then.
2021-02-23 12:29:58 +00:00
Tim-Philipp Müller
e30259f623 cairo-trace: fix build with newer versions of bfd
And update configure/meson checks to check for the new function.

Drop libiberty.h check since it's only needed by backtrace-symbols.c
which we're about to remove.

Closes #391, #460
2021-02-23 12:29:58 +00:00
Tim-Philipp Müller
51d50621be meson: only build cairo-boilerplate and cairo-missing helper libs if needed
Used by tests and the sphinx utility, which may or may not be built,
and if they're not built we don't need to build those libs either.
2021-01-15 18:47:08 +00:00
Xavier Claessens
ebbaebdec1 meson: Generate cairo-script-interpreter.pc needed by GTK+ 2020-12-22 13:16:05 -05:00
Tim-Philipp Müller
e9ccb1d8d0 meson: fix library versioning
Fixes #442
2020-12-15 00:22:37 +00:00
George Matsumura
08c76f4cbf cairo-trace: Fix escape character encoding in string literals
This fixes a typo wherein both a return character and a tab character
were encoded when only a return character was specified for encoding.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-11-20 16:07:53 +00:00
George Matsumura
ed98414686 build: Fix various compiler warnings
This fixes a few compiler warnings that were encountered with gcc 9.3.0.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-11-07 06:45:01 -07:00
Xavier Claessens
70c01fb9d1 cairo-gobject: Missing cairo include directories
When cairo is a subproject and application uses libcairogobject_dep, it
was missing include directories set in libcairo_dep.
2020-10-07 11:50:07 -04:00
Xavier Claessens
084404cd15 meson: Use pkgmod.generate() for all cairo pc files
Also override each dependency so they can be used when cairo is used as
subproject.
2020-10-06 10:58:04 -04:00
Xavier Claessens
e2c1b76d71 meson: Fix build when libpng is not found
trace-to-xml.c needs cairo-xml.h which is only available when
CAIRO_HAS_XML_SURFACE feature is built which is only available when both
zlib and png are found. CAIRO_HAS_INTERPRETER only requires zlib.
2020-10-03 22:42:56 -04:00
Xavier Claessens
6a6ab24759 meson: Fix cross build with Android NDK
Android NDK does not contain execinfo.h so malloc-stats.c cannot be
built.
2020-10-02 17:29:07 -04:00
George Matsumura
9a3ad1df1c build: Include correct poll.h
Including sys/poll.h when poll.h is available produces a compile
warning on some systems, but only sys/poll.h is present on others
such as AIX. This makes sure the most suitable poll.h is included
in each situation.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-09-05 12:15:57 +00:00
George Matsumura
f2cb9ba49a meson: Fix musl build
This constitutes few fixes that are necessary to compile correctly
and reduce errors when using musl libc.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-09-02 10:29:04 +00:00
Ting-Wei Lan
b87e53dc1c meson: Fix undefined reference when bfd library is installed
Add the missing file which is necessary when symbol lookup is enabled.
2020-08-31 23:20:49 +08:00
Tim-Philipp Müller
7cb362d586 meson: fix cairo-script-interpreter library name
Fixes #418
2020-08-07 00:18:17 +01:00
Mathieu Duponchelle
596a82f2d1 Add meson build definitions
Co-Authored by:
Nirbheek Chauhan <nirbheek@centricular.com>
lb90 <luca.bacci982@gmail.com>
Tim-Philipp Müller <tim@centricular.com>
2020-07-31 12:21:50 +01:00