Commit graph

12580 commits

Author SHA1 Message Date
Emmanuele Bassi
b5793081d0 Drop cairo-gl
The GL support in Cairo has always been a prototype, and
nothing happened in the past 10+ years to make it work as
it was meant to.

GL support is not enabled by any downstream packagers of
Cairo, so nobody should notice its absence.
2023-01-27 19:21:46 +00:00
Adrian Johnson
407bb0a478 Merge branch 'dwrite-custom-palette' into 'master'
dwrite: use custom palette when rendering COLRv0

See merge request cairo/cairo!424
2023-01-27 10:44:31 +00:00
Adrian Johnson
22d0cd1ec3 Merge branch 'doc-fixes' into 'master'
Some documentation fixes

See merge request cairo/cairo!428
2023-01-27 10:26:44 +00:00
Adrian Johnson
119ce21b2c Merge branch 'dwrite-docs' into 'master'
Simplify generating dwrite-fonts docs

See merge request cairo/cairo!426
2023-01-27 10:16:55 +00:00
Khaled Hosny
f05f2b3955 Fix gtk-doc syntax 2023-01-26 18:27:56 +02:00
Adrian Johnson
055ca7fb09 Merge branch 'fix-user-fonts-foreground' into 'master'
Add new cairo_user_scaled_font_get_foreground_source() function

See merge request cairo/cairo!422
2023-01-26 11:55:40 +00:00
Khaled Hosny
3cea38c02c doc: fix generation of API indices
The index id is expected to be "api-index-*" not just "index-*", and for
some reason newer versions of gtk-doc don’t like these "role" attributes
and will not generate the index if they are present. Also add missing
indices for 1.0 and 1.18.
2023-01-26 13:39:36 +02:00
Khaled Hosny
0cc13eb894 Simplify generating dwrite-fonts docs
Tell gtk-doc to scan .cpp files instead of making a proxy .c file.
2023-01-26 13:08:45 +02:00
Adrian Johnson
f35f757e8f Update user font tests to test foreground colors 2023-01-26 19:49:06 +10:30
Adrian Johnson
e93d175aac Add new cairo_user_scaled_font_get_foreground_source() function
The previous approach using foreground colors in user fonts does not
work for gradients since the foreground color is not available at the
time of recording.

Add a new function cairo_user_scaled_font_get_foreground_source() that
can be called by the color render function to retrieve the foreground
pattern. Calling this function signals to cairo that the foreground
color is used. In this case cairo will call the render function
whenever the foreground color has changed.
2023-01-26 19:49:06 +10:30
Adrian Johnson
75d876ee29 dwrite: use custom palette when rendering COLRv0 2023-01-26 13:19:53 +10:30
Adrian Johnson
0151a67e33 Merge branch 'svg-font-palette' into 'master'
Add svg font test for custom palette colors

See merge request cairo/cairo!418
2023-01-26 01:12:20 +00:00
Adrian Johnson
9ed9cfcf36 Merge branch 'fix-clear-color-glyphs' into 'master'
surface: Don't optimize away color glyphs

See merge request cairo/cairo!419
2023-01-26 01:07:44 +00:00
Behdad Esfahbod
2490c8bc0e Merge branch 'colrv1-fix-crash' into 'master'
[colrv1] Fix crash in get_palette_color

See merge request cairo/cairo!421
2023-01-24 00:27:24 +00:00
Behdad Esfahbod
3b807c1d7e [colrv1] Fix crash in get_palette_color
is_foreground_color can be NULL.
2023-01-23 16:50:48 -07:00
Matthias Clasen
ad667d4afd surface: Don't optimize away color glyphs
The surface code was optimizing away show_text_glyphs
based on the operator when the source pattern is clear.
But if we are rendering color glyphs, that is not
correct since we are using the glyphs as source.
2023-01-21 10:47:54 -05:00
Adrian Johnson
ea51a5d66a Merge branch 'fix-svg-crash' into 'master'
Fix svg renderer crash

See merge request cairo/cairo!416
2023-01-21 08:39:29 +00:00
Adrian Johnson
b68583ee54 Add test for SVG font palettes 2023-01-21 17:46:18 +10:30
Adrian Johnson
3cc9e198fd Silence make-cairo-def.sh output
This removes the following output:

  Generating src/cairo.def
  <stdin>:6:9: warning: #pragma once in main file
  <stdin>:4377:9: warning: #pragma once in main file
2023-01-21 17:19:17 +10:30
Adrian Johnson
7072f62611 Merge branch 'custom-color-palette-2' into 'master'
Add custom palettes for COLRv1 and SVG fonts

See merge request cairo/cairo!417
2023-01-21 02:13:06 +00:00
Matthias Clasen
733e298bea Reshuffle code for clarity
Only loop over custom colors if we got
a palette selected successfully.
2023-01-20 20:39:23 -05:00
Matthias Clasen
be1d41f001 Use the custom palette for COLv1 renderer
When the font options contain a custom palette,
overwrite the palette we got from freetype with
the custom entries.
2023-01-20 15:20:22 -05:00
Matthias Clasen
67eeed44cd Add a custom palette to font options
Add a way to define a custom color palette as
part of cairo_font_options_t. To use the custom
palette when rendering color fonts, set the palette
index to CAIRO_COLOR_PALETTE_CUSTOM.
2023-01-20 15:20:22 -05:00
Matthias Clasen
2e4afeb4bc cairo-ft: Pass the palette to the COLRv1 renderer
It an unnecessary complication for use to pass
the palette index, and have the COLRv1 renderer
pull the palette out of the FT_Face, after we
just selected it.
2023-01-20 14:58:27 -05:00
Matthias Clasen
8992e26f07 cairo-ft: Fix palette handling
We were returning the number of palettes where
the number of palette entries was expected,
leading to array overruns. Oops
2023-01-20 14:55:52 -05:00
Adrian Johnson
ae256003fb svg-font: fix parse bug on empty tags 2023-01-20 20:39:29 +10:30
Adrian Johnson
cbcf962da2 svg-font: return SVG_FONT_ERROR on error 2023-01-20 20:37:45 +10:30
Behdad Esfahbod
45a1317aa4 Merge branch 'scaled-font-options' into 'master'
[scaled-font] Clean up font-options before copy

See merge request cairo/cairo!415
2023-01-19 21:19:41 +00:00
Behdad Esfahbod
8fbfb7f377 [scaled-font] Clean up font-options before copy 2023-01-19 13:42:23 -07:00
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