Sync from SUSE:SLFO:Main cairo revision 77e0e19b4e6b5dd6056a7d69cef45412

This commit is contained in:
Adrian Schröter 2024-05-03 11:28:55 +02:00
commit 86beb6b49e
9 changed files with 2046 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

10
baselibs.conf Normal file
View File

@ -0,0 +1,10 @@
libcairo2
provides "cairo-<targettype> = <version>"
obsoletes "cairo-<targettype> < <version>"
libcairo-gobject2
libcairo-script-interpreter2
cairo-devel
requires -cairo-<targettype>
requires "libcairo2-<targettype> = <version>"
requires "libcairo-gobject2-<targettype> = <version>"
requires "libcairo-script-interpreter2-<targettype> = <version>"

View File

@ -0,0 +1,110 @@
From 5e42a5277eddafd312a73e355d7775a4401dae4e Mon Sep 17 00:00:00 2001
From: Emmanuele Bassi <ebassi@gnome.org>
Date: Fri, 3 Feb 2023 15:40:12 +0100
Subject: [PATCH] tee: Fix cairo wrapper functions
Follow-up to !391 to apply the same changes to the (disabled by default)
tee surface.
Fixes: #634
---
src/cairo-tee-surface.c | 24 ++++++++++++++----------
1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/src/cairo-tee-surface.c b/src/cairo-tee-surface.c
index 7a94c9bca..4994a5a60 100644
--- a/src/cairo-tee-surface.c
+++ b/src/cairo-tee-surface.c
@@ -220,12 +220,12 @@ _cairo_tee_surface_paint (void *abstract_surface,
num_slaves = _cairo_array_num_elements (&surface->slaves);
slaves = _cairo_array_index (&surface->slaves, 0);
for (n = 0; n < num_slaves; n++) {
- status = _cairo_surface_wrapper_paint (&slaves[n], op, source, clip);
+ status = _cairo_surface_wrapper_paint (&slaves[n], op, source, 0, clip);
if (unlikely (status))
return status;
}
- return _cairo_surface_wrapper_paint (&surface->master, op, source, clip);
+ return _cairo_surface_wrapper_paint (&surface->master, op, source, 0, clip);
}
static cairo_int_status_t
@@ -244,13 +244,17 @@ _cairo_tee_surface_mask (void *abstract_surface,
slaves = _cairo_array_index (&surface->slaves, 0);
for (n = 0; n < num_slaves; n++) {
status = _cairo_surface_wrapper_mask (&slaves[n],
- op, source, mask, clip);
+ op, source, 0,
+ mask, 0,
+ clip);
if (unlikely (status))
return status;
}
return _cairo_surface_wrapper_mask (&surface->master,
- op, source, mask, clip);
+ op, source, 0,
+ mask, 0,
+ clip);
}
static cairo_int_status_t
@@ -274,7 +278,7 @@ _cairo_tee_surface_stroke (void *abstract_surface,
slaves = _cairo_array_index (&surface->slaves, 0);
for (n = 0; n < num_slaves; n++) {
status = _cairo_surface_wrapper_stroke (&slaves[n],
- op, source,
+ op, source, 0,
path, style,
ctm, ctm_inverse,
tolerance, antialias,
@@ -284,7 +288,7 @@ _cairo_tee_surface_stroke (void *abstract_surface,
}
return _cairo_surface_wrapper_stroke (&surface->master,
- op, source,
+ op, source, 0,
path, style,
ctm, ctm_inverse,
tolerance, antialias,
@@ -310,7 +314,7 @@ _cairo_tee_surface_fill (void *abstract_surface,
slaves = _cairo_array_index (&surface->slaves, 0);
for (n = 0; n < num_slaves; n++) {
status = _cairo_surface_wrapper_fill (&slaves[n],
- op, source,
+ op, source, 0,
path, fill_rule,
tolerance, antialias,
clip);
@@ -319,7 +323,7 @@ _cairo_tee_surface_fill (void *abstract_surface,
}
return _cairo_surface_wrapper_fill (&surface->master,
- op, source,
+ op, source, 0,
path, fill_rule,
tolerance, antialias,
clip);
@@ -361,7 +365,7 @@ _cairo_tee_surface_show_text_glyphs (void *abstract_surface,
for (n = 0; n < num_slaves; n++) {
memcpy (glyphs_copy, glyphs, sizeof (cairo_glyph_t) * num_glyphs);
status = _cairo_surface_wrapper_show_text_glyphs (&slaves[n], op,
- source,
+ source, 0,
utf8, utf8_len,
glyphs_copy, num_glyphs,
clusters, num_clusters,
@@ -374,7 +378,7 @@ _cairo_tee_surface_show_text_glyphs (void *abstract_surface,
memcpy (glyphs_copy, glyphs, sizeof (cairo_glyph_t) * num_glyphs);
status = _cairo_surface_wrapper_show_text_glyphs (&surface->master, op,
- source,
+ source, 0,
utf8, utf8_len,
glyphs_copy, num_glyphs,
clusters, num_clusters,
--
GitLab

View File

@ -0,0 +1,62 @@
From 2766d9feeccd5d66e346b0abab38726b8e0aa1e9 Mon Sep 17 00:00:00 2001
From: Adrian Johnson <ajohnson@redneon.com>
Date: Tue, 7 Mar 2023 19:40:21 +1030
Subject: [PATCH] ft: Use normal font size when detecting the format
The format may depend on the font size.
Fixes #643
---
src/cairo-ft-font.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c
index 22a6a622b..89af6193d 100644
--- a/src/cairo-ft-font.c
+++ b/src/cairo-ft-font.c
@@ -3314,11 +3314,13 @@ _cairo_ft_scaled_glyph_init_metrics (cairo_ft_scaled_font_t *scaled_font,
if (scaled_font->unscaled->have_color && scaled_font->base.options.color_mode != CAIRO_COLOR_MODE_NO_COLOR)
color_flag = FT_LOAD_COLOR;
#endif
+ /* Ensure use_em_size = FALSE as the format (bitmap or outline)
+ * may change with the size. */
status = _cairo_ft_scaled_glyph_load_glyph (scaled_font,
scaled_glyph,
face,
load_flags | color_flag,
- !hint_metrics,
+ FALSE,
vertical_layout);
if (unlikely (status))
return status;
@@ -3344,6 +3346,18 @@ _cairo_ft_scaled_glyph_init_metrics (cairo_ft_scaled_font_t *scaled_font,
glyph_priv->format = CAIRO_FT_GLYPH_TYPE_BITMAP;
}
+ /* If hinting is off, load the glyph with font size set the the em size. */
+ if (!hint_metrics) {
+ status = _cairo_ft_scaled_glyph_load_glyph (scaled_font,
+ scaled_glyph,
+ face,
+ load_flags | color_flag,
+ TRUE,
+ vertical_layout);
+ if (unlikely (status))
+ return status;
+ }
+
_cairo_ft_scaled_glyph_get_metrics (scaled_font,
face,
vertical_layout,
@@ -3369,6 +3383,7 @@ _cairo_ft_scaled_glyph_init_metrics (cairo_ft_scaled_font_t *scaled_font,
}
if (glyph_priv->format == CAIRO_FT_GLYPH_TYPE_COLR_V1) {
+ /* Restore font size if previously loaded at em_size. */
if (!hint_metrics) {
status = _cairo_ft_scaled_glyph_load_glyph (scaled_font,
scaled_glyph,
--
GitLab

BIN
cairo-1.17.8.tar.xz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,13 @@
Index: cairo-1.17.6/src/cairo-ft-font.c
===================================================================
--- cairo-1.17.6.orig/src/cairo-ft-font.c
+++ cairo-1.17.6/src/cairo-ft-font.c
@@ -1223,7 +1223,7 @@ _get_bitmap_surface (FT_Bitmap *bi
width = bitmap->width;
height = bitmap->rows;
- if (width == 0 || height == 0) {
+ if (width == 0 || height == 0 || bitmap->buffer == NULL) {
*surface = (cairo_image_surface_t *)
cairo_image_surface_create_for_data (NULL, format, 0, 0, 0);
return (*surface)->base.status;

View File

@ -0,0 +1,17 @@
Index: cairo-1.17.6/src/cairo-xlib-render-compositor.c
===================================================================
--- cairo-1.17.6.orig/src/cairo-xlib-render-compositor.c
+++ cairo-1.17.6/src/cairo-xlib-render-compositor.c
@@ -1325,10 +1325,10 @@ _cairo_xlib_surface_add_glyph (cairo_xli
}
n = new;
d = (uint32_t *) data;
- do {
+ while (c--) {
*n++ = bswap_32 (*d);
d++;
- } while (--c);
+ }
data = (uint8_t *) new;
}
break;

1609
cairo.changes Normal file

File diff suppressed because it is too large Load Diff

199
cairo.spec Normal file
View File

@ -0,0 +1,199 @@
#
# spec file for package cairo
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define build_xcb_backend 1
Name: cairo
Version: 1.17.8
Release: 0
Summary: Vector Graphics Library with Cross-Device Output Support
License: LGPL-2.1-or-later OR MPL-1.1
Group: Development/Libraries/C and C++
URL: https://cairographics.org/
Source0: https://cairographics.org/snapshots/%{name}-%{version}.tar.xz
Source99: baselibs.conf
# PATCH-FIX-UPSTREAM cairo-xlib-endianness.patch fdo#63461 bnc#882951 fcrozat@suse.com -- Fix crash when client and server have different endianness
Patch0: cairo-xlib-endianness.patch
# PATCH-FIX-UPSTREAM cairo-get_bitmap_surface-bsc1036789-CVE-2017-7475.diff alarrosa@suse.com -- Fix segfault in get_bitmap_surface
Patch1: cairo-get_bitmap_surface-bsc1036789-CVE-2017-7475.diff
# PATCH-FIX-UPSTREAM cairo-1.17.8-fix-tee-compilation.patch -- https://gitlab.freedesktop.org/cairo/cairo/-/issues/634 tee: Fix cairo wrapper functions
Patch2: cairo-1.17.8-fix-tee-compilation.patch
# PATCH-FIX-UPSTREAM cairo-1.17.8-ft-font-missing-glyph.patch -- https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/467 ft: Use normal font size when detecting the format
Patch3: cairo-1.17.8-ft-font-missing-glyph.patch
BuildRequires: c++_compiler
BuildRequires: c_compiler
BuildRequires: gtk-doc
BuildRequires: meson
BuildRequires: pkgconfig
BuildRequires: pkgconfig(fontconfig)
BuildRequires: pkgconfig(freetype2)
BuildRequires: pkgconfig(gobject-2.0)
BuildRequires: pkgconfig(libpng)
BuildRequires: pkgconfig(pixman-1) >= 0.36.0
BuildRequires: pkgconfig(x11)
BuildRequires: pkgconfig(xext)
BuildRequires: pkgconfig(xrender)
BuildRequires: pkgconfig(zlib)
# These libraries are needed only for tests.
# Do not enable tests in build systems, it causes build loop!
#BuildRequires: librsvg-devel poppler-devel
%if %{build_xcb_backend}
BuildRequires: pkgconfig(xcb) >= 1.6
BuildRequires: pkgconfig(xcb-render) >= 1.6
BuildRequires: pkgconfig(xcb-shm)
%endif
%description
Cairo is a vector graphics library with cross-device output support.
Currently supported output targets include the X Window System,
in-memory image buffers, and PostScript. Cairo is designed to produce
identical output on all output media while taking advantage of display
hardware acceleration when available.
%package -n libcairo2
Summary: Vector Graphics Library with Cross-Device Output Support
License: LGPL-2.1-or-later OR MPL-1.1
Group: System/Libraries
Provides: cairo = %{version}
Obsoletes: cairo < %{version}
%description -n libcairo2
Cairo is a vector graphics library with cross-device output support.
Currently supported output targets include the X Window System,
in-memory image buffers, and PostScript. Cairo is designed to produce
identical output on all output media while taking advantage of display
hardware acceleration when available.
%package -n libcairo-gobject2
Summary: Vector Graphics Library with Cross-Device Output Support
License: LGPL-2.1-or-later OR MPL-1.1
Group: System/Libraries
%description -n libcairo-gobject2
Cairo is a vector graphics library with cross-device output support.
Currently supported output targets include the X Window System,
in-memory image buffers, and PostScript. Cairo is designed to produce
identical output on all output media while taking advantage of display
hardware acceleration when available.
This library contains GType declarations for Cairo types. It is also
meant to support gobject-introspection binding creation.
%package -n libcairo-script-interpreter2
Summary: Vector Graphics Library with Cross-Device Output Support
License: LGPL-2.1-or-later OR MPL-1.1
Group: System/Libraries
%description -n libcairo-script-interpreter2
Cairo is a vector graphics library with cross-device output support.
Currently supported output targets include the X Window System,
in-memory image buffers, and PostScript. Cairo is designed to produce
identical output on all output media while taking advantage of display
hardware acceleration when available.
%package tools
Summary: Utilities for cairo, a Vector Graphics Library with Cross-Device Output Support
# We need an explicit requires since nothing links to the cairo library
License: GPL-3.0-or-later
Group: Development/Libraries/X11
Requires: libcairo2 = %{version}
# Named changed during development of 11.4
Provides: %{name}-utils = %{version}
Obsoletes: %{name}-utils < %{version}
%description tools
Cairo is a vector graphics library with cross-device output support.
Currently supported output targets include the X Window System,
in-memory image buffers, and PostScript. Cairo is designed to produce
identical output on all output media while taking advantage of display
hardware acceleration when available.
This package contains various cairo utilities.
%package devel
Summary: Development environment for cairo
License: LGPL-2.1-or-later OR MPL-1.1
Group: Development/Libraries/X11
Requires: libcairo-gobject2 = %{version}
Requires: libcairo-script-interpreter2 = %{version}
Requires: libcairo2 = %{version}
Provides: cairo-doc = %{version}
Obsoletes: cairo-doc < %{version}
%description devel
This package contains all files necessary to build binaries using
cairo.
%prep
%autosetup -p1
%build
%meson \
%if %{build_xcb_backend}
-D xcb=enabled \
%endif
-D freetype=enabled \
-D fontconfig=enabled \
-D glib=enabled \
-D gtk_doc=true \
-D spectre=disabled \
-D symbol-lookup=disabled \
-D tee=enabled \
-D tests=disabled \
-D xlib=enabled \
-D xml=disabled
%{nil}
%meson_build
%install
%meson_install
%ldconfig_scriptlets -n libcairo2
%ldconfig_scriptlets -n libcairo-gobject2
%ldconfig_scriptlets -n libcairo-script-interpreter2
%files -n libcairo2
%license COPYING COPYING-LGPL-2.1 COPYING-MPL-1.1
%{_libdir}/libcairo.so.*
%files -n libcairo-gobject2
%{_libdir}/libcairo-gobject.so.2*
%files -n libcairo-script-interpreter2
%license util/cairo-script/COPYING
%{_libdir}/libcairo-script-interpreter.so.*
%files tools
%license util/cairo-trace/COPYING util/cairo-trace/COPYING-GPL-3
%{_bindir}/cairo-sphinx
%{_bindir}/cairo-trace
%dir %{_libdir}/cairo
%{_libdir}/cairo/libcairo-fdr.so
%{_libdir}/cairo/libcairo-sphinx.so
%{_libdir}/cairo/libcairo-trace.so
%files devel
%doc AUTHORS NEWS README.md
%doc %{_datadir}/gtk-doc/html/cairo
%{_includedir}/cairo/
%{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc
%changelog