Commit graph

12252 commits

Author SHA1 Message Date
Adrian Johnson
fa76ebec03 Fix some warnings and use _cairo_malloc where applicable 2022-02-27 15:44:58 +10:30
Adrian Johnson
28ce8463af Fix check doc errors 2022-02-27 15:44:58 +10:30
Adrian Johnson
ed36d85bf6 Fix msvc c++ compile error 2022-02-27 15:44:58 +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
Adrian Johnson
1a799577b2 Merge branch 'issue-526' into 'master'
pdf: ensure urls and filename strings are correctly encoded

Closes #526

See merge request cairo/cairo!266
2022-02-27 03:51:50 +00:00
Uli Schlachter
b0b294b827 Merge branch 'chrstphrchvz-master-patch-12648' into 'master'
quartz: Fix spelling in comment

See merge request cairo/cairo!286
2022-02-26 10:11:56 +00:00
Christopher Chavez
5e1dd84796 quartz: Fix spelling in comment 2022-02-26 09:17:28 +00:00
Uli Schlachter
1781e59c57 Merge branch 'drop-backends' into 'master'
Remove old backends

See merge request cairo/cairo!285
2022-02-25 15:44:51 +00:00
Uli Schlachter
ebba42b191 Merge branch 'quartz-snapshot' into 'master'
quartz: Improve use of images for better performance.

See merge request cairo/cairo!282
2022-02-25 15:30:40 +00:00
Emmanuele Bassi
9cfa510464 ci: Make Windows jobs manual
The CI runners for Windows are currently timing out on the fd.o
infrastructure. The issue is being worked on, but we should avoid
blocking our entire CI pipeline until it's fixed, as it sounds it is
going to take a while.
2022-02-25 12:54:11 +00:00
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
1fa3b10cce Remove boilerplate for the Skia surface
The Skia surface is not there any more.
2022-02-25 01:41:15 +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
John Ralls
2e0075e265 [quartz] Don't use CGContextDrawTiledImage for tiled patterns.
CGContextDrawTiledImage turned up as a significant time-user while
profiling a benchmark created to evaluate
https://gitlab.gnome.org/GNOME/gtk/-/issues/3714. Without this commit
the benchmark is able to perform a mean frame rate of 2.19 frames per
second with a standard deviation of 0.09; with the commit the mean frame
rate is 2.37 fps, s.d. 0.30, both over 15 10-second samples. Student's
t-test reports a 9.8% likelyhood that the two represent the same
distribution.
2022-02-24 17:00:07 -08:00
John Ralls
a502280fcd [quartz] extract function _cairo_quartz_setup_pattern_source
To simplify _cairo_quartz_setup_state.
2022-02-24 17:00:07 -08:00
John Ralls
b6e0f36ee5 [quartz]Cleanup _cairo_quartz_cairo_repeating_surface_pattern_to_quartz 2022-02-24 17:00:07 -08:00
John Ralls
ae320c4d75 [quartz] Use CoreGraphics instead of Qt to write debug png file. 2022-02-24 17:00:07 -08:00
John Ralls
bacbe9bb2d [quartz] Create similar surfaces using a CGLayer for faster drawing. 2022-02-24 17:00:07 -08:00
John Ralls
76e6a0ddf7 [quartz] Remove cached image_surface on quartz surfaces.
Caching doesn't really do anything and removing it provides a 50%
speedup and gets pdf-operators-text to pass on argb32.
2022-02-24 17:00:07 -08:00
John Ralls
64786613ee [quartz] Snapshot CGBitmapContext-mapped surfaces to cache CGImages.
Motivation: Avoid need to recreate CGImages for unchanged surfaces,
an expensive operation, while ensuring that the CGImages are properly
freed and new ones created when the surface does change.

Thanks to Uli Schlacter for suggestion and coding guidance.
2022-02-24 16:59:56 -08:00
Uli Schlachter
4fc72919e1 Merge branch 'mempool-overflow' into 'master'
Fix integer overflows in cairo-mempool

Closes #510

See merge request cairo/cairo!253
2022-02-24 14:35:17 +00:00
Uli Schlachter
2c24c18b14 Merge branch 'test-hairline' into 'master'
test/hairline.c: Use Unix line endings & add copyright header

See merge request cairo/cairo!234
2022-02-24 14:34:04 +00:00
Uli Schlachter
c2005c22e2 Merge branch 'chrstphrchvz-master-patch-67648' into 'master'
quartz: Fix spelling in comment

See merge request cairo/cairo!284
2022-02-23 16:18:51 +00:00
Christopher Chavez
04394d5b15 quartz: Fix spelling in comment 2022-02-23 13:12:35 +00:00
Uli Schlachter
2ec0a87403 Merge branch 'develop3' into 'master'
miscellaneous math fixes

See merge request cairo/cairo!280
2022-02-20 12:09:02 +00:00
Ayman El Didi
f83e0ed4e6 removed redundant casts in cairoint.h
In a couple of instances, ints are being casted to int before use.
2022-02-19 12:04:21 -07:00
Ayman El Didi
915dd79422 fixed some multiplications prone to overflowing their type
In a couple of instances, code is present where two numbers are being
multiplied in a type like unsigned int, but immediately being casted
to a wider type like size_t.

This means, although the result can be any size_t value, the
multiplication can potentially overflow before it's used because
unsigned int has a smaller range of values.

In another more niche case, I also cast to size_t before multiplying
a signed integer, since the result is immediately used as an argument
to memcpy, which would give memory corruption if the value was negative
anyway.
2022-02-19 11:59:41 -07:00
Uli Schlachter
cf75083941 Merge branch 'develop4' into 'master'
added missing documentation to cairo_font_options_status

See merge request cairo/cairo!281
2022-02-19 09:42:15 +00:00
Ayman El Didi
c932bb7ae7 added missing documentation to cairo_font_options_status
The documentation for cairo_font_options_status says it can return
either CAIRO_STATUS_SUCCESS or CAIRO_STATUS_NO_MEMORY, but the
implementation can also return CAIRO_STATUS_NULL_POINTER, which wasn't
mentioned.
2022-02-18 15:14:57 -07:00
Ayman El Didi
8f7d039801 fixed some comparisons between signed and unsigned integers
In some places, there were int variables being compared to unsigned
ints when they would never take a negative value, exposing some edge
cases that didn't need to be there.
2022-02-18 15:00:53 -07:00
Emmanuele Bassi
4d68059656 Merge branch 'meson-xml-option' into 'master'
meson: Add xml option and disable by default

See merge request cairo/cairo!275
2022-02-16 17:04:37 +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
Uli Schlachter
bdb4d05868 Merge branch 'user-font-subpixel-position' into 'master'
[user-font] Implement subpixel-positioning

See merge request cairo/cairo!274
2022-02-14 17:19:50 +00:00
Behdad Esfahbod
a62eea4aec [user-font] Implement subpixel-positioning
See:

https://github.com/harfbuzz/harfbuzz/pull/3411#issuecomment-1033118545
https://github.com/harfbuzz/harfbuzz/pull/3411#issuecomment-1033125311
https://github.com/harfbuzz/harfbuzz/pull/3411#issuecomment-1037765840

Basically the code in cairo-image-compositor.c:composite_glyphs()
is flooring glyph positions and putting some phase in the glyph-id.
This was being lost in the user-font backend. Fetch that and put it
in the recording-surface's device-transform translation, to be applied.
2022-02-13 14:34:24 -06:00
Behdad Esfahbod
c90faeb749 Merge branch 'mixed-color-clusters' into 'master'
Fix mixed color clusters

See merge request cairo/cairo!273
2022-02-13 05:08:03 +00:00
Matthias Clasen
65d4325e6f Fix mixed color clusters
When rendering clusters that have colored and non-colored
glyphs, we were falling back to using show_text_glyphs,
rendering all glyphs in the cluster without color.
Instead, make composite_one_color_glyph smart enough
to handle non-color glyphs, and only skip clusters
that are entirely non-color.

Testcase: hb-view AmiriQuranColored.otf -u 627,64e
2022-02-12 21:19:39 -06:00
Emmanuele Bassi
cd21fa0814 Merge branch 'fix-user-font-leaks' into 'master'
user-font: Plug some memory leaks

See merge request cairo/cairo!271
2022-02-11 11:59:03 +00:00
Emmanuele Bassi
396d258e41 Merge branch 'fix-rtl-color-glyphs' into 'master'
Fix rtl handling for color glyphs

Closes #533

See merge request cairo/cairo!272
2022-02-11 11:43:02 +00:00
Emmanuele Bassi
1bc922d045 Apply 1 suggestion(s) to 1 file(s) 2022-02-11 10:58:39 +00:00
Matthias Clasen
603cdf939f Fix rtl handling for color glyphs
When the run contains a mix of color and non-color
glyphs, composite_color_glyphs returns the non-color
glyphs unhandled in the same array. In the rtl case,
the glyphs are processed from the end and the unhandled
glyphs are accumulated at the end as well, and we
need to move them to the beginning of the array before
we return. Add the missing memmove call to do that.

Fixes: #533
2022-02-11 05:47:01 -05:00
Matthias Clasen
139f3f25b1 Plug another memory leak 2022-02-10 22:19:10 -05:00
Matthias Clasen
537445c4f0 user-font: Plug some memory leaks
We were leaking a cairo_t and a surface here, in
some code paths.
2022-02-10 21:17:58 -05:00
Emmanuele Bassi
fb3734fac0 Merge branch 'fix-build-when-pdf-is-disabled' into 'master'
meson: Fix build when PDF backend is disabled

See merge request cairo/cairo!269
2022-01-21 14:14:23 +00:00
Nirbheek Chauhan
57498b301c meson: Fix build when PDF backend is disabled
Symbols from cairo-tag-stack.c are used by cairo-tag-attributes.c, so
this should be in the same list of sources as that. Fixes this build
error:

```
/usr/bin/ld: src/libcairo.so.2.11705.0.p/cairo-tag-attributes.c.o: in function `parse_array':
/path/to/cairo/_build/../src/cairo-tag-attributes.c:347: undefined reference to `_cairo_tag_error'
/usr/bin/ld: src/libcairo.so.2.11705.0.p/cairo-tag-attributes.c.o: in function `parse_name':
/path/to/cairo/cairo/_build/../src/cairo-tag-attributes.c:359: undefined reference to `_cairo_tag_error'
/usr/bin/ld: src/libcairo.so.2.11705.0.p/cairo-tag-attributes.c.o: in function `parse_attributes':
/path/to/cairo/cairo/_build/../src/cairo-tag-attributes.c:410: undefined reference to `_cairo_tag_error'
/usr/bin/ld: /path/to/cairo/cairo/_build/../src/cairo-tag-attributes.c:431: undefined reference to `_cairo_tag_error'
/usr/bin/ld: /path/to/cairo/cairo/_build/../src/cairo-tag-attributes.c:441: undefined reference to `_cairo_tag_error'
/usr/bin/ld: src/libcairo.so.2.11705.0.p/cairo-tag-attributes.c.o:/path/to/cairo/cairo/_build/../src/cairo-tag-attributes.c:455: more undefined references to `_cairo_tag_error' follow
/usr/bin/ld: src/libcairo.so.2.11705.0: hidden symbol `_cairo_tag_error' isn't defined
```
2022-01-21 11:59:36 +05:30
Adrian Johnson
895b249b0a pdf: ensure filenames are correctly encoded 2022-01-16 13:49:53 +10:30