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>
This avoids the risk of encountering undefined behavior when computing the `pixel` pointer (even though it won't actually be used) in the case where the image width or height is zero and the data is NULL. (Observed when called from cairo_pdf_surface code when an extreme scaling transform was present, though I guess there are probably other ways to end up with such an image.)
With the last commit, these became pointless. Just switch the code to
call the underlying function directly.
Signed-off-by: Uli Schlachter <psychon@znc.in>
cairo-xcb kept a cache of free xid to avoid calling xcb_generate_id()
later. However, this is unsafe: When libxcb runs out of ids, it asks the
X11 server for an empty range of ids to use. The X11 server of course
does not know about cairo's cache and could hand out an id that cairo
will use again later. This would then result in BadIdChoice errors
later.
Fix this by simply removing the whole cache.
Fixes: https://gitlab.freedesktop.org/cairo/cairo/-/issues/434
Signed-off-by: Uli Schlachter <psychon@znc.in>
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.
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().
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.
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.
This adds the necessary commands to run the test suite on MacOS in CI
and to also ignore the current failures.
Signed-off-by: Uli Schlachter <psychon@znc.in>
The create-for-stream test verifies that writing something to a file and
writing it to an in-memory surface produces the same output. The test
currently fails when the svg backend is tested with:
TEST: create_for_stream TARGET: pdf RESULT: PASS
svg: Stream based output differ from file output for output/create-for-stream.out.svg.
TEST: create_for_stream TARGET: svg RESULT: FAIL
I guess this is because svg uses unique IDs for surfaces, meaning that
drawing two times the same thing in the same process can produce
different outputs. However, this is just a guess and I didn't
investigate further.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This adds a special hack to the test suite to ignore the crashes for
self-copy and self-copy-overlap for the svg backend in CI.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This hopefully fixes the raster-source test case crashing:
cairo-svg-surface.c:2269: _cairo_svg_surface_emit_pattern: Assertion `!"reached"' failed.
I cannot / did not test this change locally and rely on CI to tell me
whether this works.
Signed-off-by: Uli Schlachter <psychon@znc.in>