Commit graph

11689 commits

Author SHA1 Message Date
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
George Matsumura
97c766f8fe cogl: Convert int to fixed-point in rectangle painting fallback
Previously, the rectangle fallback path in surface_paint was
incorrectly passing and int to a function that required a
fixed-point number.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-08-25 02:30:57 -06:00
George Matsumura
ceffa65fb0 cogl: Account for new representations of framebuffer types
With the new cogl API, casting the framebuffer into offscreen
and onscreen types with the provided macros is a deprecated
behavior.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-08-25 02:30:57 -06:00
George Matsumura
1ada7c9aa6 cogl: Fix push_group and pop_group context functions
Before this change, there was the possibility of context functions
only meant for the cogl surface backend being used on a non-cogl
surface.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-08-25 02:30:57 -06:00
George Matsumura
d1dec1b384 cogl: Fix passing wrong type to _cairo_cogl_clip_push_box
Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-08-25 02:30:57 -06:00
George Matsumura
bda0f90d6e cogl: Correct behavior of boilerplate surface finishing functions
Without this, a buffer-swapping function only usable on onscreen
framebuffers would have been used on offscreen framebuffers.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-08-25 02:30:57 -06:00
George Matsumura
78b00a3213 cogl: Handle framebuffer formats better in case contents are unknown
Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-08-25 02:30:57 -06:00
George Matsumura
fd6de9820e cogl: Accommodate new context functions
In order to satisfy the runtime check that accounts for new
API functions that modify the transformation matrix, the new
functions for translation from backend to user coordinates must
be accounted for.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-08-25 02:30:57 -06:00
George Matsumura
09092bf884 cogl: Add dependency on cogl-path
The path functions in the cogl API have now been split into a
separate one which builds from the same codebase. In order to
compile with this change, the new library has to be added as
an explicit dependency.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-08-25 02:30:57 -06:00
George Matsumura
6250e1a843 cogl: Use new separate functions for offscreen and onscreen framebuffers
The old boilerplate code no longer worked due to the deprecation of
functions for swapping the buffers that it used.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-08-25 02:30:57 -06:00
George Matsumura
7135ca2091 cogl: Futher changes to match new cogl-experimental public API
These are more changes required to match the new backwards-incompatible
API of cogl-experimental.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-08-25 02:30:57 -06:00
George Matsumura
418ad9db62 cogl: Update to match changed cogl-experimental public API
This is the first part of updates to match the backwards-incompatible
changes that have been made in the cogl-experimental public API
since this backend last worked.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-08-25 02:30:57 -06:00
Tim-Philipp Müller
88d773e627 meson: add summary and flip some options to disabled by default
.. to match autotools.
2020-08-14 14:22:27 +00:00
Tim-Philipp Müller
89d4c22140 meson: update fontconfig wrap and add gperf wrap
Update fontconfig wrap to upstream now that it's been merged.
Add gperf wrap which is needed for fontconfig, same as in the
upstream fontconfig repo (this can't be put into wrapdb yet
because it requires changes to source files).
2020-08-07 12:13:10 +01:00
Tim-Philipp Müller
7cb362d586 meson: fix cairo-script-interpreter library name
Fixes #418
2020-08-07 00:18:17 +01:00
Nirbheek Chauhan
efc508bdb9 meson: Fix win32 libs in cairo-win32*.pc files
Fixes https://gitlab.freedesktop.org/cairo/cairo/-/issues/419
2020-08-06 02:06:45 +05:30
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
Mathieu Duponchelle
a75f8df957 Fix build on Windows with recent versions of MSVC
- vsnprintf and snprintf are available since vs2015
- define ISREG if not provided
- guard unistd.h include with HAVE_UNISTD_H
- isnan() is available after vs2010
2020-07-31 01:21:01 +01:00
Uli Schlachter
91b5761acd Merge branch 'master' of gitlab.freedesktop.org:sgerwk/cairo 2020-07-20 18:42:01 +02:00
Uli Schlachter
b55e491d67 Merge branch 'invalid-free-crash' of gitlab.freedesktop.org:psychon/cairo 2020-07-20 18:33:46 +02:00
Uli Schlachter
4777f9cd5f Merge branch 'fix-build-rule-for-font-variations' of gitlab.freedesktop.org:mpsuzuki/cairo 2020-07-20 18:32:33 +02:00
Uli Schlachter
e0f9db9459 Merge branch 'master' of gitlab.freedesktop.org:ffontaine/cairo 2020-07-20 18:30:45 +02:00
Uli Schlachter
bf12199196 Merge branch 'master' of gitlab.freedesktop.org:trofi/cairo 2020-07-20 18:29:39 +02:00
Mathieu Duponchelle
c4fd00c2c4 script-surface: Fix unitialized variable compiler warning
gcc doesn't warn about this because status is potentially
initialized in a loop.
2020-07-18 19:43:43 +00:00
Mathieu Duponchelle
bfa00bc3d7 cairo-qt-surface: fix arguments of _cairo_surface_init()
This is broken since b1192beac7 (2015!)
2020-07-18 19:43:43 +00:00
Mathieu Duponchelle
1676935768 raster-source: fix when builddir != srcdir
When the build dir is different from the source dir,
"png.png" is not a valid path. As we can't dispose of
an allocated filename, we add an atexit handler.
2020-07-18 19:47:27 +01:00
Mathieu Duponchelle
4645ecf3f8 record tests: fix when builddir != srcdir
When builddir != srcdir, cairo_test_create_pattern_from_png
needs a non-NULL ctx to work with.
2020-07-18 19:47:17 +01:00
Sergei Trofimovich
23b6e8bb57 build/aclocal.float.m4: detect 'strings' with AC_CHECK_TOOL
This way all binutils tools are detected with $CHOST prefix
if exist. And strings is allowed to be substituted with
STRINGS environment override, so 'llvm-strings' (or other)
alternative can be used.

Bug: https://bugs.gentoo.org/726200
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
2020-06-14 09:58:52 +01:00
Uli Schlachter
aee96d175d Initialize mutexes in _cairo_ft_unscaled_font_map_lock()
This function is reachable via cairo_ft_font_face_create_for_ft_face()
-> _cairo_ft_unscaled_font_create_from_face() ->
_cairo_ft_unscaled_font_create_internal() ->
_cairo_ft_unscaled_font_map_lock(). Thus, it could happen that nothing
initialized mutexes before this code runs.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2020-02-27 17:01:07 +00:00
Uli Schlachter
0ae4e6a855 Merge branch 'ft-leak' of gitlab.freedesktop.org:carlosgc/cairo 2020-02-14 16:58:15 +01:00
Uli Schlachter
d66baf8ecd Merge branch 'fix-xml-unclosed-scaled-font-element' of gitlab.freedesktop.org:mpsuzuki/cairo 2020-02-12 17:44:18 +01:00
Fabrice Fontaine
cb2357f481 test: fix build when SHOULD_FORK is false
The code in test/cairo-test-runner.c properly takes into account
platforms that do have fork() support, and uses the SHOULD_FORK define
to know whether fork is available or not.

However, this SHOULD_FORK macro is used to guard the inclusion of
<unistd.h>, which is needed to get the prototype of other functions
(namely readlink and getppid), that are used in portions of this file
not guarded by SHOULD_FORK.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
[Retrieved from:
https://git.buildroot.net/buildroot/tree/package/cairo/0001-fix-nofork-build.patch]
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2020-02-03 21:24:25 +01:00
luzpaz
2982adec76 Fix documentation typo in src/cairo-surface.c 2019-12-20 11:10:19 +00:00
sgerwk
1a6a26be56 a surface may also be checked for status after finishing 2019-10-14 12:25:43 +02:00
Heiko Lewin
f93fc72c0c Delete fill_rectangles_shader on device finish 2019-10-12 07:45:29 +00:00
Jan Alexander Steffens (heftig)
d0dccb92c5
image compositor: Remove the right glyph from pixman's cache
We need to use the index including the phase. Otherwise we leave glyphs
in the cache that cause problems later as indices are reused.
2019-10-05 14:07:28 +02:00
Matthias Clasen
52a7c79fd4 Fix vertical subpixel positioning
We need to apply the Y subpixel phase negated,
since we flip the Y axis later.
2019-07-26 17:29:17 -04:00
Matthias Clasen
aa263f881f Fix a thinko in composite_color_glyphs
We can't just move around the contents of the
passed-in string, we need to make a copy. This
was showing up as memory corruption in pango.

See https://gitlab.gnome.org/GNOME/pango/issues/346
2019-07-18 14:38:47 -07:00
Matthias Clasen
e4a79db010 xlib compositor: Support subpixel positioning
As for the image compository, support a 4x4
subpixel grid.
2019-07-18 14:38:47 -07:00
Matthias Clasen
6fd4222ab0 Add a testcase for subpixel positioning
With the image compositor, you can see different
phases. The XLib compositor always uses the same
glyph rendering.
2019-07-18 14:38:47 -07:00
Matthias Clasen
ea9329215d image compositor: Support subpixel positioning
Support subpixel positioning with a 4x4 subpixel grid.

When compositing glyphs in the image compositor,
we store the subpixel phases in the high bits of the
glyph index. The _cairo_scaled_glyph_index() macro
has been updated to discard these bits. By storing
the phases in the glyph index, the glyph cache just
keeps working. When loading a glyph, the Freetype
font backend shifts the outline according to the
phases.
2019-07-18 14:38:47 -07:00
Florian Müllner
bab53d91a8 ft-font: Fix color font support
FT_PIXEL_MODE_BGRA is an enum member, not a define, so it always appears
as 0 in the preprocessor conditions added in commit c0ed8ce1a1.

There is an existing define for color font support, use that instead.
2019-05-30 17:38:59 +00:00
Antony Lee
dfe3aa6d88 Fix off-by-one bug in tor22-scan-converter.
This makes the implementation in tor22-scan-converter match the one in
tor-scan-converter.
2019-05-10 15:02:54 +00:00
Massimo Valentini
82a2477a4a add a test to exercise tor22 spans allocation code path 2019-05-10 15:02:54 +00:00
suzuki toshiya
c93ca40f60 regrouping of test sources with new 'fc_font_test_sources' group 2019-04-10 01:07:16 +00:00
suzuki toshiya
10760d29d1 xml: fix unclosed <scaled-font> element
a closing tag </scaled-font> has been missing,
mistakenly an opening tag <scaled-font> has been emitted.

See discussion in:
https://lists.cairographics.org/archives/cairo/2018-December/028822.html
https://lists.cairographics.org/archives/cairo/2019-January/028828.html
2019-04-08 03:06:06 +00:00
suzuki toshiya
d331c69f65 Makefile.sources: move font-variations.c (a test code for
Variation Font with FreeType2 functions) from test_sources
to ft_font_test_sources, to restrict the test to the case
with FreeType2 backend. See discussion in
https://lists.cairographics.org/archives/cairo/2019-April/028858.html
2019-04-08 03:05:00 +00:00
Uli Schlachter
269522fbe9 .gitlab-ci.yml: Temporarily switch to Fedora rawhide
Since commit a34cb719cd, we need pixman >= 0.36, which is not yet
in the latest Fedora. Thus, this switches to Fedora rawhide to make
things work again.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-03-25 17:02:13 +00:00
Vasilij Schneidermann
81102cc214 Disable sphinx build if PNG support is disabled 2019-03-14 17:42:28 +00:00