Commit graph

12551 commits

Author SHA1 Message Date
Uli Schlachter
7b1de369dd Merge branch 'gstate-font-options' into 'master'
[gstate] Fix cairo_font_options_t memory management

See merge request cairo/cairo!414
2023-01-19 16:10:03 +00:00
Behdad Esfahbod
a32ddef9d9 [gstate] Fix cairo_font_options_t memory management
cairo_font_options_t has grown to have malloc'ed memory,
so the previous code was leaking, and double-freeing.
2023-01-18 23:19:12 -07:00
Adrian Johnson
2c557d7cea Merge branch 'colrv1-stack-variable' into 'master'
[COLRv1] Allocate context variable on the stack

See merge request cairo/cairo!410
2023-01-17 20:26:50 +00:00
Adrian Johnson
f133b4be13 Merge branch 'optimize-paint-composite' into 'master'
[COLRv1] Optimize paint-composite

See merge request cairo/cairo!411
2023-01-17 20:25:07 +00:00
Adrian Johnson
68ee427b66 Merge branch 'colr-foreground-alpha' into 'master'
[COLRv1] Apply alpha to foreground color

See merge request cairo/cairo!409
2023-01-17 20:24:16 +00:00
Adrian Johnson
1c544160b9 Merge branch 'colrv1-fixes' into 'master'
COLR v1 font render fixes

Closes #624 and #623

See merge request cairo/cairo!407
2023-01-17 20:22:50 +00:00
Emmanuele Bassi
ec107d5698 Merge branch 'fix-device-scaling-doc-comments' into 'master'
Fix docs for cairo_surface_[sg]et_device_scale

Closes #616

See merge request cairo/cairo!396
2023-01-17 15:19:52 +00:00
Behdad Esfahbod
0f8bd754ae [COLRv1] Optimize paint-composite
See https://github.com/googlefonts/colr-gradients-spec/issues/369
2023-01-17 08:10:36 -07:00
Behdad Esfahbod
9e6c1e479f [COLRv1] Allocate context variable on the stack 2023-01-17 07:58:38 -07:00
Behdad Esfahbod
ef9ea14352 [COLRv1] Apply alpha to foreground color 2023-01-17 06:48:28 -07:00
Adrian Johnson
f642714473 colrv1: Fix palette alpha
Fixes #624
2023-01-17 23:08:22 +10:30
Adrian Johnson
4da39d34a7 colrv1: Don't use EM size when hint metrics is off
Fixes #623
2023-01-17 23:00:37 +10:30
Adrian Johnson
ded2092e20 Ensure outline font is used when CAIRO_COLOR_MODE_NO_COLOR is set 2023-01-17 22:57:15 +10:30
Adrian Johnson
745c3717aa Merge branch 'fix-shared-recording-surface' into 'master'
Fix shared use of recording surfaces

See merge request cairo/cairo!391
2023-01-16 08:59:32 +00:00
Adrian Johnson
6abc8076c9 Merge branch 'meson-and-doc-fixes' into 'master'
Meson and documentation fixes

See merge request cairo/cairo!406
2023-01-16 08:57:45 +00:00
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
Adrian Johnson
7146358250 Fix shared use of recording surface with paginated targets
The problem is _cairo_recording_surface_replay_and_create_regions()
stores the cairo_recording_region_type_t in the same structure as the
recording commands. This does not work well when the recording surface
is used as source by multiple surfaces

Fix this by moving the cairo_recording_region_type_t into a separate
struct cairo_recording_regions_array_t. This struct is stored in a
list that allows multiple create regions results to be store in the
surface.

The new function _cairo_recording_surface_region_array_attach() is
used to create a new cairo_recording_regions_array_t, attach it to the
recording surface and return a unique region id.

The _cairo_recording_surface_replay_and_create_regions() and
_cairo_recording_surface_replay_region() functions use this region id
to identify the cairo_recording_regions_array_t.

To handle nested recording surfaces, when replaying a recording, the
region id is passed to the target as an extra parameter in the surface
pattern. The wrapper surface makes a temporary copy of the pattern to
ensure the snapshot pattern in the recording surface is not modified.

cairo_recording_regions_array_t has a reference count so the target
can hold on to the cairo_recording_regions_array_t after the paginated
surface has called _cairo_recording_surface_region_array_remove().
2023-01-15 19:29:28 +10:30
Adrian Johnson
a2b376ed78 pdf-tagged-text depends on PDF 2023-01-15 19:29:28 +10:30
Adrian Johnson
c9187c529e Add a test that demonstrates a recording surface bug when re-used on different surfaces
There is a bug in the recording surface where if one recording surface
is used as the same source on different paginated targets that support
fine grained fallbacks, the output may be incorrect because the
analysis results of a previous target are re-used on another target.
2023-01-15 19:29:28 +10:30
Adrian Johnson
d027f15075 Documentation fixes 2023-01-15 19:00:22 +10:30
Adrian Johnson
5b13659d72 Add emacs modeline to CODING_STYLE 2023-01-15 19:00:22 +10:30
Adrian Johnson
d5e8a8c02e We don't use HAVE_CONFIG_H anymore 2023-01-15 19:00:22 +10:30
Adrian Johnson
bdbc10077e README fixes 2023-01-15 19:00:22 +10:30
Adrian Johnson
c80cd3a0c6 Merge branch 'defining-windows-version-macros-in-meson-build' into 'master'
Defining Windows version macros in meson.build

See merge request cairo/cairo!404
2023-01-12 21:33:19 +00:00
Adrian Johnson
7698cf546c Merge branch 'eps' into 'master'
PS: Wrap embedded EPS in %%BeginDocument/%%EndDocument as required by EPS spec

Closes #620

See merge request cairo/cairo!403
2023-01-12 21:06:56 +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
Adrian Johnson
dc4a887e7f PS: Wrap embedded EPS in %%BeginDocument/%%EndDocument as required by EPS spec
Fixes #620
2023-01-12 07:32:44 +10:30
Adrian Johnson
1e0249ae0d Merge branch 'bug-606' into 'master'
sizeof(cairo_atomic_int_t) should be sizeof(int)

Closes #606

See merge request cairo/cairo!401
2023-01-11 21:02:00 +00:00
Manuel Stoeckl
39f8be09f8 Add test for loading 16 bit PNG images
The base image has 16 bits per channel, with colors that do not
have an exact corresponding 8 bit representation. The reference
image uses 8bpc, like the rgb24/argb32 formatted images which
the test outputs.
2023-01-11 06:39:23 -05: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
Manuel Stoeckl
39179681d4 Add array bounds check for xrender format lookup
Before this change, images with RGB30, RGB96F, and RGBA128F formats
would have been given garbage xrender formats; now such images
use the fallback path and are converted to formats with an xrender
equivalent.
2023-01-11 06:38:43 -05:00
Adrian Johnson
08194cef53 Merge branch 'bug-619' into 'master'
Remove the unbounded recording surface assertion

Closes #619

See merge request cairo/cairo!399
2023-01-11 07:53:11 +00:00
Adrian Johnson
ad04670971 Merge branch 'bug-566' into 'master'
DWrite: Don't call _controlfp_s with MCW_PC

Closes #566

See merge request cairo/cairo!400
2023-01-10 21:31:05 +00:00
Fujii Hironori
2135fd4a49 sizeof(cairo_atomic_int_t) should be sizeof(int)
`_cairo_status_set_error` was using `_cairo_atomic_int_cmpxchg` to set
a `cairo_status_t` variable by casting a `cairo_status_t*` to
`cairo_atomic_int_t*`. `cairo_atomic_int` has a generic implementation
which is using a mutex. In the implementation, `cairo_atomic_int_t`
was typedef-ed to `cairo_atomic_intptr_t`. In a typical 64bit system,
cairo_atomic_intptr_t is 64bit and cairo_status_t is 32bit,
_cairo_status_set_error didn't work as expected.

Define `cairo_atomic_int_t` as an alias of `int`.
Added an assertion in `_cairo_status_set_error` to ensure
that `*err` has the same size with `cairo_atomic_int_t`.

Fixes cairo/cairo#606
2023-01-11 06:11:28 +09:00
Fujii Hironori
a599720c88 DWrite: Don't call _controlfp_s with MCW_PC
GeometryRecorder class was calling _controlfp_s with MCW_PC to reset
the floating point precision to default. However, MCW_PC isn't
supported for ARM or x64 platforms. It reports an assertion failure
for them. And, Cairo isn't changing the MCW_PC setting. Removed the
calls. Also, removed `GetFixedX` and `GetFixedY` methods because they
called only `_cairo_fixed_from_double`.

Fixes cairo/cairo#566
2023-01-11 05:39:13 +09:00
Uli Schlachter
5ecfc2eb5d Merge branch 'bug-607' into 'master'
Don't leave a font face in an error state after a scaled font creation failure

Closes #607

See merge request cairo/cairo!402
2023-01-10 17:10:10 +00:00
Adrian Johnson
72cc5ae5fa Merge branch 'pr/Fix617' into 'master'
Fix wrong paginated surface size (issue #617)

Closes #617

See merge request cairo/cairo!395
2023-01-10 11:10:08 +00:00
Adrian Johnson
1cfea7d979 Merge branch 'colr-v1' into 'master'
COLRv1 glyph renderer

See merge request cairo/cairo!397
2023-01-10 11:09:11 +00:00
Fujii Hironori
5e73c107f5 Don't leave a font face in an error state after a scaled font creation failure
Scaled font creation may fail if the font size is very large on
win32. But, don't leave the font face in an error state in such
case.

Fixes cairo/cairo#607
2023-01-10 16:01:20 +09:00
Fujii Hironori
7eff124d09 Remove the unbounded recording surface assertion
There was an assertion in
`_cairo_recording_surface_acquire_source_image` to ensure the surface
isn't unbounded. However, this assertion was failing for
`record-paint` test on Windows.

Removed the assertion and return `CAIRO_INT_STATUS_UNSUPPORTED` if the
surface is unbounded.

Fixes cairo/cairo#619
2023-01-10 13:15:31 +09:00
Tim-Philipp Müller
c76a699f6c Merge branch 'no-more-autotools' into 'master'
Remove autotools

See merge request cairo/cairo!398
2023-01-09 00:25:48 +00:00
Adrian Johnson
c756836dbe Rename INSTALL.meson and README.meson 2023-01-08 22:28:29 +10:30
Adrian Johnson
efe303d9db Remove autotools build 2023-01-08 22:27:47 +10:30
Adrian Johnson
7471a323a7 Enable error log output of meson test --no-suite=slow in CI
So the cause of the failure can be seen.
2023-01-08 15:15:13 +10:30
Adrian Johnson
dd8f55100a Require -DDEBUG_ENABLE_COLR_V1 to enable the COLR v1 renderer
Once there is a FreeType release where the COLR v1 API is no longer
marked experimental, we can change this to a version check.
2023-01-08 15:15:13 +10:30
Adrian Johnson
89d004432b COLRv1: Use cairo style and types 2023-01-08 15:15:13 +10:30
Adrian Johnson
2dfc52064e Use cairo-ft-font.c decompose function 2023-01-08 15:15:13 +10:30
Adrian Johnson
1129b194b5 Render COLRv1 to a recording surface 2023-01-08 15:15:13 +10:30
Adrian Johnson
9ed34574a6 Fix a couple of bugs and add a #define to enable debug 2023-01-08 15:15:13 +10:30
Adrian Johnson
3c8dec60e5 Integrate COLR v1 renderer with cairo-ft-font.c 2023-01-08 15:15:13 +10:30