Commit graph

11737 commits

Author SHA1 Message Date
Tim-Philipp Müller
c3e48e63a2 meson: extract meson version from cairo-version.h
Same as autotools does. Arguably it would be better to do
it the other way round and generate cairo-version.h from
the version in meson.build or configure.ac but for now
let's do this so it's at least in sync with the autotools
build and only one file has to be edited for releases.
2020-10-21 11:45:54 +00:00
Michal Sudolsky
a67735010d fix double free and failed assertions in cairo_scaled_font_destroy 2020-10-21 11:14:28 +00:00
Xavier Claessens
f896701502 meson: cairo-ft depends on fontconfig if available
cairo-ft.h includes fontconfig.h when CAIRO_HAS_FC_FONT is defined, so
it must appear in the pc file and the corresponding
declare_dependency(). This fix build issue in harfbuzz when cairo and
fontconfig are built as subproject.
2020-10-07 12:04:35 -04: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
Tim-Philipp Müller
4ea2991a40 Retire dummy cairo-version.h header to fix meson subproject build
It was originally added to make bisecting easier,
but has outlived its usefuleness now.

Going forward we'll have just a single cairo-version.h
header file, the one with the real version numbers.

This is needed to fix the case where cairo is being
built as a Meson subproject, but also simplifies
things in general.

Fixes #421
2020-09-29 15:50:53 +00:00
Jordan Petridis
96017adf65
port the CI setup to freedesktop/citemplates
rework the whole CI setup to take advantage of citemplates
for building managing the docker images.

also add a meson build job and rework the ccache config to be
shared across autotools and meson. The jobs will not share ccache
artifacts though.

https://who-t.blogspot.com/2020/03/its-templates-all-way-down.html
2020-09-29 13:00:39 +03:00
Tim-Philipp Müller
75f6e0cacf ci: add native Windows MSVC build with Meson 2020-09-26 23:38:26 +01:00
Tim-Philipp Müller
b4bbe9970c autotools: dist Meson build system files
So that people can build with Meson when using the tarballs.

Fixes #424
2020-09-24 12:16:39 +01:00
Tim-Philipp Müller
01683a5882 meson: ensure srcdir doesn't contain autotools build artifacts
.. such as config.h or other generated files such as cairo-features.h,
as those might be accidentally included by the meson build and cause
weird to debug build issues.

Fixes #423
2020-09-19 14:07:28 +01: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
Uli Schlachter
3b1bf9d6d3 Fix/silence some warnings in 'make check'
'make check' currently fails with the following in src/test-suite.log
(how can one tell automake not to hide the error message in a file?!?):

FAIL: check-doc-syntax.sh
=========================

Checking documentation for incorrect syntax
./cairo-cogl-surface.c: * cairo_cogl_pipeline_ts. On failure, both pointers will be set to
./cairo-cogl-surface.c:/* Mostly taken from cairo_vg_surface.c */
Error: some function names in the docs are not followed by parentheses.
Fix this by searching for the following regexp in the above files:
	'^[^:]*:[/ ][*]\(\|[ 	].*\)\([^#']\|^\)\<\(cairo_[][<>/0-9a-z_]*\>[^][<>(]\)'
FAIL check-doc-syntax.sh (exit status: 1)

This commit silences that. The fix is likely not correct, but since
these are normal comments and not actual doc comments, it does not
matter much.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2020-09-05 08:57:23 +00:00
Uli Schlachter
881e2579f0 Make the test suite succeed on GitLab CI
This commit makes the test suite pass by simply ignoring failures. Not
pretty, but better than teaching people to just ignore CI failures. At
least some kinds of problems can still be caught.

Originally, I wanted to only run a single test, but while investigating
how to do this, I stumbled upon this undocumented environment variable.
This seems less ugly and might allow looking at older build logs to
figure out when something first broke.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2020-09-05 08:50:59 +00:00
George Matsumura
47881a965e cogl: Add build version requirement
This ensures that build configuration for the cogl backend will fail
if an insufficiently new version of cogl is present, making it easier
to find the root cause of a build failure.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-09-04 20:44:53 -06:00
George Matsumura
c8d82cffdf svg2png: Remove deprecated handle closing function call
rsvg_handle_close is no longer required after creating a handle with
rsvg_handle_new_from_file. It causes a deprecation warning during
compilation as well. This change removes it.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-09-02 10:29:04 +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
George Matsumura
2f39018c2c meson: Remove unconditional disable of cogl backend build 2020-08-25 03:26:27 -06:00
George Matsumura
e47d0de8d2 cogl: Remove filling with cogl-path
This removes code that uses the cogl-path library, which was not
used except when manually modifying a preprocessor flag. It could
not use path caching, was slightly broken, and all of its
functionality was provided better by different code paths.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-08-25 02:30:58 -06:00
George Matsumura
ecbd7ed174 cogl: Add new path cache
This redesigns the path cache so that it does not mess with the
context functions, thereby hopefully making it much more resilient
to changes in the rest of cairo that change the way the default
context works. It is also much simpler, and it is anticipated that
it will be more maintainable. Performance in contrast to the old
cache design speeds up most traces in cairo-perf-trace, and slows
down only a lesser few by <20%.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-08-25 02:30:58 -06:00
George Matsumura
939da43c44 cogl: Add minimal font support
This adds very basic path-based font support to the cogl backend,
improving cairo-perf-trace performance by 6x or more on many traces.
This still is not the most desirable form of font support, which
would resemble the texture-based glyph caching in the gl backend or
use cogl-pango to automatically cache glyphs.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-08-25 02:30:58 -06:00
George Matsumura
26c7103750 cogl: Fix reference counting bugs
Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-08-25 02:30:58 -06:00
George Matsumura
20d475042c cogl: Increase reading performance of RGB-only surfaces
This makes it so that RGB24 surfaces are represented in such a way
that does not require expensive format conversions during pixel
packing and unpacking.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-08-25 02:30:58 -06:00
George Matsumura
4068fe0026 cogl: Support mirroring of gradients if no hardware support exists
This mirrors a linear gradient by dobling its size and reflecting it
in the case that hardware does not support mirrored repeating.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-08-25 02:30:58 -06:00
George Matsumura
9b07a5379b cogl: Limit size of journal
This makes sure the journal is flushed after it reaches a certain
size, so that very large amounts of memory are not consumed if an
explicit flush is not triggered.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-08-25 02:30:58 -06:00
George Matsumura
08d6c7de2d cogl: Support source surfaces without an alpha component
This ensures that if the source surface does not have an alpha
component (such as those with format RGB24), it is not blended
as if it does.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-08-25 02:30:58 -06:00
George Matsumura
bb84bb650d cogl: Ensure onscreen framebuffers have an alpha component if required
Prior to this change, cogl often queried GLX so that it returned
a framebuffer that could not support an alpha component.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-08-25 02:30:58 -06:00
George Matsumura
02371a714e cogl: Improve support for hardware without mirrored repeating
Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-08-25 02:30:58 -06:00
George Matsumura
916408481f cogl: Move framebuffer creation functionality out of boilerplate
In order to be more consistent with backends such as gl, support for
creating a surface from content, width, and height parameters was
moved into the backend itself. The option to pass cairo-cogl a
framebuffer to create a texture from still exists, just now it is
not the only option.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-08-25 02:30:58 -06:00
George Matsumura
9248ba1419 cogl: Properly support unbounded operators
This makes it so that operators requiring transparent values to be
used outside of the bounds of the source and/or mask textures will
trigger a second rendering of transparent pixels.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-08-25 02:30:58 -06:00
George Matsumura
b258f0203c cogl: Handle negative stride images correctly
This adds correct support for negative stride images by uploading
them to a texture in their upside-down orientation and then
vertically inverting the matrix with which they are read, which
is required because OpenGL (and therefore cogl) cannot pack pixels
with a negative stride.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-08-25 02:30:58 -06:00
George Matsumura
20cc7ad16e cogl: Avoid duplicate representations of the path
Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-08-25 02:30:58 -06:00
George Matsumura
9e473db58d cogl: Flush the path before calling functions that require it
Prior to this change, API functions like path_exents returned
incorrect results if the cogl-specific representation of rectangular
paths was being used.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-08-25 02:30:58 -06:00
George Matsumura
b7e1551814 cogl: Fix rectangular filling fast path
Prior to this, the rectangular filling fast path passed arguments to
_cairo_cogl_journal_log_rectangle as if they represented the
coordinates of two opposite points on the rectangle, when the arguments
actually represent a rectangle with the x and y coordinates of one
point and the width and height of the rectangle.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-08-25 02:30:58 -06:00
George Matsumura
1bb048af24 cogl: Support raster sources
This adds supporte for raster sources using the same method that
is used to support radial gradient and mesh sources.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-08-25 02:30:58 -06:00
George Matsumura
f3d2623046 cogl: Fix very small surfaces in boilerplate
Prior to this change, the boilerplate code crashed when given surface
dimensions less than 1. This fixes such behaviour by rounding the
dimensions up to 1, which is also done by the boilerplate code for
several other backends.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-08-25 02:30:58 -06:00
George Matsumura
8f0f371b87 cogl: Use less memory during recording surface replaying
Many of the tests in the test suite do many replays of different
small parts of a single surface. When combined with the cogl backend's
journaling mechanism, this consumes very large amounts of memory, as
the entire surface is allocated for each replay. This changes this
behaviour so that only the portion of the surface that will be used
is allocated.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-08-25 02:30:57 -06:00
George Matsumura
641ea48b66 cogl: Support more unbounded operators
Due to recent changes, all unbounded Porter-Duff compositing operators
can be properly supported in addition to IN.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-08-25 02:30:57 -06:00
George Matsumura
e2e494b9ff cogl: Fix rectangle filling conditions
Prior to this change, the context functions were using the accelerated
rectangle-filling path even if there was a preexisting rectangular path,
producing incorrect results.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-08-25 02:30:57 -06:00
George Matsumura
bb02ea2b4f cogl: Correct usage of clip boxes
This changes the interpretation of multiple boxes in the clip from
using the intersection of the multiple boxes to using the union of
the multiple boxes, which corrects many results in the test suite.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-08-25 02:30:57 -06:00
George Matsumura
7319feb642 cogl: Support CAIRO_EXTEND_NONE correctly
Prior to this change, CAIRO_EXTEND_NONE was handled the same way as
CAIRO_EXTEND_PAD, which produced incorrect results in many tests.
This fixes such behaviour by created a per-source and per-mask clip
that is applied so that areas outside the bounds of the source or
mask textures are not sampled during drawing.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-08-25 02:30:57 -06:00
George Matsumura
98eaa778b7 cogl: Support combinations of mask and source patterns correctly
Prior to this change, the set of template pipelines did not
properly apply to the full combination of mask and source patterns,
which could be either textures or solids.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-08-25 02:30:57 -06:00
George Matsumura
97a98d9145 cogl: Fix aliased vertex buffer offset
This fixes a bug in which the texture coordinate attributes were
being read from the wrong location in the mapped buffer, due to a
typo in the original code.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-08-25 02:30:57 -06:00
George Matsumura
3e810fe2d1 cogl: Fix handling of translated pattern matrices
Due to how cairo matrix math works, the x0 and y0 elements of the
texture matrix were not being normalized, leading to incorrect
results in several tests.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-08-25 02:30:57 -06:00
George Matsumura
1dce0112ef cogl: Trailing whitespace fix
Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-08-25 02:30:57 -06:00
George Matsumura
fc8e68b37a cogl: Fix crash when specifying only mask surface
Cogl enters into an infinite recursion if a texture is specified
for layer 1 of a pipeline but no texture is specified for layer 0.
This works around the bug by setting the mask texture on layer 0
if there is no source texture.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-08-25 02:30:57 -06:00
George Matsumura
75d843208c cogl: Move context, device, and surface members to most fitting places
The buffer stack was moved from the surface to the device, as
mapped buffers are shared across all surfaces using the device
and more than one surface may be doing so. Stemming from this, if
a surface tries to map a buffer without first unmapping one that
has been mapped by another surface, it will trigger an error.

The parent backend functions were moved from the device to the
context, as it is possible that the context creation function could
be passed a non-cogl device. Prior to this change, many of the
subsurface tests segfaulted.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-08-25 02:30:57 -06:00
George Matsumura
a3233bc5df cogl: Handle recording surface sources properly
Previously, if an unbounded recording surface was given as the
source, the program triggered an assertion failure in the recording
surface code, as acquire_source_image cannot be used on the surface
in this case. This adds a new path to deal with such an unbounded
source surface.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-08-25 02:30:57 -06:00