diff options
Diffstat (limited to 'external/cairo/cairo')
-rw-r--r-- | external/cairo/cairo/0025-libtool-pass-use-ld.patch | 16 | ||||
-rw-r--r-- | external/cairo/cairo/cairo-1.10.2.ios.patch | 27 | ||||
-rw-r--r-- | external/cairo/cairo/cairo-1.10.2.no-atsui.patch | 22 | ||||
-rw-r--r-- | external/cairo/cairo/cairo-libtool-rpath.patch.1 | 12 | ||||
-rw-r--r-- | external/cairo/cairo/cairo.GL_RGBA.patch | 49 | ||||
-rw-r--r-- | external/cairo/cairo/cairo.RGB24_888.patch | 105 | ||||
-rw-r--r-- | external/cairo/cairo/cairo.buildfix.patch | 122 | ||||
-rw-r--r-- | external/cairo/cairo/cairo.ofz46165.patch.1 | 16 | ||||
-rw-r--r-- | external/cairo/cairo/cairo.oldfreetype.patch | 42 | ||||
-rwxr-xr-x | external/cairo/cairo/dummy_pkg_config | 3 | ||||
-rw-r--r-- | external/cairo/cairo/san.patch.0 | 103 |
11 files changed, 517 insertions, 0 deletions
diff --git a/external/cairo/cairo/0025-libtool-pass-use-ld.patch b/external/cairo/cairo/0025-libtool-pass-use-ld.patch new file mode 100644 index 000000000..c5558ff73 --- /dev/null +++ b/external/cairo/cairo/0025-libtool-pass-use-ld.patch @@ -0,0 +1,16 @@ +--- a/cairo/build/ltmain.sh 2022-05-04 16:12:17.409012360 +0100 ++++ b/cairo/build/ltmain.sh 2022-05-04 16:12:42.510870063 +0100 +@@ -7273,11 +7273,12 @@ + # --sysroot=* for sysroot support + # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization + # -specs=* GCC specs files ++ # -fuse-ld=* Linker select flags for GCC + # -stdlib=* select c++ std lib with clang + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ + -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ +- -specs=*) ++ -specs=*|-fuse-ld=*) + func_quote_for_eval "$arg" + arg=$func_quote_for_eval_result + func_append compile_command " $arg" diff --git a/external/cairo/cairo/cairo-1.10.2.ios.patch b/external/cairo/cairo/cairo-1.10.2.ios.patch new file mode 100644 index 000000000..c61faf333 --- /dev/null +++ b/external/cairo/cairo/cairo-1.10.2.ios.patch @@ -0,0 +1,27 @@ +--- misc/cairo-1.10.2/configure 2011-12-16 10:02:39.626077757 +0100 ++++ misc/build/cairo-1.10.2/configure 2011-12-16 10:02:23.518237109 +0100 +@@ -22766,11 +22766,13 @@ + + + ac_fn_c_check_header_mongrel "$LINENO" "ApplicationServices/ApplicationServices.h" "ac_cv_header_ApplicationServices_ApplicationServices_h" "$ac_includes_default" ++if false; then + if test "x$ac_cv_header_ApplicationServices_ApplicationServices_h" = x""yes; then : + + else + use_quartz="no (requires ApplicationServices framework)" + fi ++fi + + + if test "x$use_quartz" != "xyes" ; then +--- misc/cairo-1.10.2/src/cairo-quartz.h 2011-12-16 10:02:39.639079241 +0100 ++++ misc/build/cairo-1.10.2/src/cairo-quartz.h 2011-12-16 10:01:18.404789245 +0100 +@@ -40,7 +40,7 @@ + + #if CAIRO_HAS_QUARTZ_SURFACE + +-#include <ApplicationServices/ApplicationServices.h> ++#include <CoreGraphics/CoreGraphics.h> + + CAIRO_BEGIN_DECLS + diff --git a/external/cairo/cairo/cairo-1.10.2.no-atsui.patch b/external/cairo/cairo/cairo-1.10.2.no-atsui.patch new file mode 100644 index 000000000..51b98afa5 --- /dev/null +++ b/external/cairo/cairo/cairo-1.10.2.no-atsui.patch @@ -0,0 +1,22 @@ +--- misc/cairo-1.10.2/src/cairo-quartz-font.c 2010-12-25 15:21:34.000000000 +0100 ++++ misc/build/cairo-1.10.2/src/cairo-quartz-font.c 2011-12-16 09:54:18.672445207 +0100 +@@ -777,7 +777,7 @@ + return ffont->cgFont; + } + +-#ifndef __LP64__ ++#if 0 + /* + * compat with old ATSUI backend + */ +--- misc/cairo-1.10.2/src/cairo-quartz.h 2010-06-18 13:47:13.000000000 +0200 ++++ misc/build/cairo-1.10.2/src/cairo-quartz.h 2011-12-16 09:52:53.081501547 +0100 +@@ -66,7 +66,7 @@ + cairo_public cairo_font_face_t * + cairo_quartz_font_face_create_for_cgfont (CGFontRef font); + +-#ifndef __LP64__ ++#if 0 + cairo_public cairo_font_face_t * + cairo_quartz_font_face_create_for_atsu_font_id (ATSUFontID font_id); + #endif diff --git a/external/cairo/cairo/cairo-libtool-rpath.patch.1 b/external/cairo/cairo/cairo-libtool-rpath.patch.1 new file mode 100644 index 000000000..18a3507a9 --- /dev/null +++ b/external/cairo/cairo/cairo-libtool-rpath.patch.1 @@ -0,0 +1,12 @@ +Prevent libtool from adding annoying stuff to RPATH + +--- cairo/configure.orig 2018-10-19 22:20:08.000000000 +0200 ++++ cairo/configure 2019-09-04 17:53:00.927539686 +0200 +@@ -10432,6 +10432,7 @@ + else + ld_shlibs=no + fi ++hardcode_libdir_flag_spec= + ;; + + netbsd*) diff --git a/external/cairo/cairo/cairo.GL_RGBA.patch b/external/cairo/cairo/cairo.GL_RGBA.patch new file mode 100644 index 000000000..b1a05feb4 --- /dev/null +++ b/external/cairo/cairo/cairo.GL_RGBA.patch @@ -0,0 +1,49 @@ +--- misc/cairo-1.10.2/src/cairo-image-surface.c ++++ misc/cairo-1.10.2/src/cairo-image-surface.c +@@ -97,11 +97,11 @@ + return CAIRO_FORMAT_RGBA128F; + case PIXMAN_rgb_float: + return CAIRO_FORMAT_RGB96F; +- case PIXMAN_a8r8g8b8: ++ case PIXMAN_a8b8g8r8: //tweaked + return CAIRO_FORMAT_ARGB32; + case PIXMAN_x2r10g10b10: + return CAIRO_FORMAT_RGB30; +- case PIXMAN_x8r8g8b8: ++ case PIXMAN_x8b8g8r8: //tweaked + return CAIRO_FORMAT_RGB24; + case PIXMAN_a8: + return CAIRO_FORMAT_A8; +@@ -117,7 +117,7 @@ + #if PIXMAN_VERSION >= PIXMAN_VERSION_ENCODE(0,27,2) + case PIXMAN_a8r8g8b8_sRGB: + #endif +- case PIXMAN_a8b8g8r8: case PIXMAN_x8b8g8r8: ++ case PIXMAN_a8r8g8b8: case PIXMAN_x8r8g8b8: //tweaked + case PIXMAN_b8g8r8: case PIXMAN_b5g6r5: + case PIXMAN_a1r5g5b5: case PIXMAN_x1r5g5b5: case PIXMAN_a1b5g5r5: + case PIXMAN_x1b5g5r5: case PIXMAN_a4r4g4b4: case PIXMAN_x4r4g4b4: +@@ -320,7 +320,7 @@ + ret = PIXMAN_a8; + break; + case CAIRO_FORMAT_RGB24: +- ret = PIXMAN_x8r8g8b8; ++ ret = PIXMAN_x8b8g8r8; //tweaked + break; + case CAIRO_FORMAT_RGB30: + ret = PIXMAN_x2r10g10b10; +@@ -335,12 +335,12 @@ + ret = PIXMAN_rgba_float; + break; + case CAIRO_FORMAT_RGB24_888: +- ret = PIXMAN_r8g8b8; ++ ret = PIXMAN_b8g8r8; // tweaked + break; + case CAIRO_FORMAT_ARGB32: + case CAIRO_FORMAT_INVALID: + default: +- ret = PIXMAN_a8r8g8b8; ++ ret = PIXMAN_a8b8g8r8; //tweaked + break; + } + return ret; diff --git a/external/cairo/cairo/cairo.RGB24_888.patch b/external/cairo/cairo/cairo.RGB24_888.patch new file mode 100644 index 000000000..6b2befabc --- /dev/null +++ b/external/cairo/cairo/cairo.RGB24_888.patch @@ -0,0 +1,105 @@ +diff -ru cairo-1.17.4.orig/src/cairo.h cairo-1.17.4/src/cairo.h +--- misc/cairo-1.17.4.orig/src/cairo.h 2021-08-29 19:43:26.976435721 +0100 ++++ misc/build/cairo-1.17.4/src/cairo.h 2021-08-29 19:47:41.373919330 +0100 +@@ -407,6 +407,8 @@ + * @CAIRO_FORMAT_RGB30: like RGB24 but with 10bpc. (Since 1.12) + * @CAIRO_FORMAT_RGB96F: 3 floats, R, G, B. (Since 1.17.2) + * @CAIRO_FORMAT_RGBA128F: 4 floats, R, G, B, A. (Since 1.17.2) ++ * @CAIRO_FORMAT_RGB24_888: each pixel is a 24-bit quantity, ++ * with Red, Green, Blue taking 8-bits each, in that order. (Since 1.1x) + * + * #cairo_format_t is used to identify the memory format of + * image data. +@@ -424,9 +426,16 @@ + CAIRO_FORMAT_RGB16_565 = 4, + CAIRO_FORMAT_RGB30 = 5, + CAIRO_FORMAT_RGB96F = 6, +- CAIRO_FORMAT_RGBA128F = 7 ++ CAIRO_FORMAT_RGBA128F = 7, ++ CAIRO_FORMAT_RGB24_888 = 8 + } cairo_format_t; + ++/** ++ * Need this until CAIRO_FORMAT_RGB24_888 is in some official release. ++ * Otherwise we can't reliably check if this is available or we should ++ * convert from 24-bit RGB to 32-bit RGB before passing to Cairo. ++ **/ ++#define HAVE_CAIRO_FORMAT_RGB24_888 + + /** + * cairo_write_func_t: +diff -ru cairo-1.17.4.orig/src/cairo-image-source.c cairo-1.17.4/src/cairo-image-source.c +--- misc/cairo-1.17.4.orig/src/cairo-image-source.c 2021-08-29 19:43:26.979435585 +0100 ++++ misc/build/cairo-1.17.4/src/cairo-image-source.c 2021-08-29 19:43:47.501506559 +0100 +@@ -509,6 +509,20 @@ + color.blue = expand_channel(pixel & 0x3fff, 10); + return pixman_image_create_solid_fill (&color); + ++ case CAIRO_FORMAT_RGB24_888: ++ pixel = *(uint32_t *) (image->data + y * image->stride + 3 * x); ++ pixel &= 0x00ffffff; /* ignore next pixel bits */ ++ if (pixel == 0) ++ return _pixman_black_image (); ++ if (pixel == 0x00ffffff) ++ return _pixman_white_image (); ++ ++ color.alpha = 0xffff; ++ color.red = (pixel >> 16 & 0xff) | (pixel >> 8 & 0xff00); ++ color.green = (pixel >> 8 & 0xff) | (pixel & 0xff00); ++ color.blue = (pixel & 0xff) | (pixel << 8 & 0xff00); ++ return pixman_image_create_solid_fill (&color); ++ + case CAIRO_FORMAT_ARGB32: + case CAIRO_FORMAT_RGB24: + pixel = *(uint32_t *) (image->data + y * image->stride + 4 * x); +diff -ru cairo-1.17.4.orig/src/cairo-image-surface.c cairo-1.17.4/src/cairo-image-surface.c +--- misc/cairo-1.17.4.orig/src/cairo-image-surface.c 2021-08-29 19:43:26.982435449 +0100 ++++ misc/build/cairo-1.17.4/src/cairo-image-surface.c 2021-08-29 19:43:47.501506559 +0100 +@@ -109,13 +109,15 @@ + return CAIRO_FORMAT_A1; + case PIXMAN_r5g6b5: + return CAIRO_FORMAT_RGB16_565; ++ case PIXMAN_r8g8b8: ++ return CAIRO_FORMAT_RGB24_888; + #if PIXMAN_VERSION >= PIXMAN_VERSION_ENCODE(0,22,0) + case PIXMAN_r8g8b8a8: case PIXMAN_r8g8b8x8: + #endif + #if PIXMAN_VERSION >= PIXMAN_VERSION_ENCODE(0,27,2) + case PIXMAN_a8r8g8b8_sRGB: + #endif +- case PIXMAN_a8b8g8r8: case PIXMAN_x8b8g8r8: case PIXMAN_r8g8b8: ++ case PIXMAN_a8b8g8r8: case PIXMAN_x8b8g8r8: + case PIXMAN_b8g8r8: case PIXMAN_b5g6r5: + case PIXMAN_a1r5g5b5: case PIXMAN_x1r5g5b5: case PIXMAN_a1b5g5r5: + case PIXMAN_x1b5g5r5: case PIXMAN_a4r4g4b4: case PIXMAN_x4r4g4b4: +@@ -332,6 +334,9 @@ + case CAIRO_FORMAT_RGBA128F: + ret = PIXMAN_rgba_float; + break; ++ case CAIRO_FORMAT_RGB24_888: ++ ret = PIXMAN_r8g8b8; ++ break; + case CAIRO_FORMAT_ARGB32: + case CAIRO_FORMAT_INVALID: + default: +@@ -736,6 +741,8 @@ + case CAIRO_FORMAT_RGB30: + case CAIRO_FORMAT_RGB24: + return 32; ++ case CAIRO_FORMAT_RGB24_888: ++ return 24; + case CAIRO_FORMAT_RGB16_565: + return 16; + case CAIRO_FORMAT_A8: +diff -ru cairo-1.17.4.orig/src/cairoint.h cairo-1.17.4/src/cairoint.h +--- misc/cairo-1.17.4.orig/src/cairoint.h 2021-08-29 19:43:26.973435857 +0100 ++++ misc/build/cairo-1.17.4/src/cairoint.h 2021-08-29 19:48:08.396696027 +0100 +@@ -1539,7 +1539,7 @@ + * in cairo-xlib-surface.c--again see -Wswitch-enum). + */ + #define CAIRO_FORMAT_VALID(format) ((format) >= CAIRO_FORMAT_ARGB32 && \ +- (format) <= CAIRO_FORMAT_RGBA128F) ++ (format) <= CAIRO_FORMAT_RGB24_888) + + /* pixman-required stride alignment in bytes. */ + #define CAIRO_STRIDE_ALIGNMENT (sizeof (uint32_t)) diff --git a/external/cairo/cairo/cairo.buildfix.patch b/external/cairo/cairo/cairo.buildfix.patch new file mode 100644 index 000000000..5b64dfb59 --- /dev/null +++ b/external/cairo/cairo/cairo.buildfix.patch @@ -0,0 +1,122 @@ +diff -ru cairo-1.17.4.orig/build/Makefile.win32.features cairo-1.17.4/build/Makefile.win32.features +--- misc/cairo-1.17.4.orig/build/Makefile.win32.features 2021-08-29 19:43:27.093430425 +0100 ++++ misc/build/cairo-1.17.4/build/Makefile.win32.features 2021-08-29 19:43:47.496506785 +0100 +@@ -30,7 +30,7 @@ + CAIRO_HAS_FC_FONT=0 + CAIRO_HAS_PS_SURFACE=1 + CAIRO_HAS_PDF_SURFACE=1 +-CAIRO_HAS_SVG_SURFACE=1 ++CAIRO_HAS_SVG_SURFACE=0 + CAIRO_HAS_TEST_SURFACES=0 + CAIRO_HAS_TEE_SURFACE=0 + CAIRO_HAS_XML_SURFACE=0 +diff -ru cairo-1.17.4.orig/configure cairo-1.17.4/configure +--- misc/cairo-1.17.4.orig/configure 2021-08-29 19:43:26.966436173 +0100 ++++ misc/build/cairo-1.17.4/configure 2021-08-29 19:43:47.500506604 +0100 +@@ -17149,61 +17149,12 @@ + rm -f confcache + + +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compress in -lz" >&5 +-$as_echo_n "checking for compress in -lz... " >&6; } +-if ${ac_cv_lib_z_compress+:} false; then : +- $as_echo_n "(cached) " >&6 +-else +- ac_check_lib_save_LIBS=$LIBS +-LIBS="-lz $LIBS" +-cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +- +-/* Override any GCC internal prototype to avoid an error. +- Use char because int might match the return type of a GCC +- builtin and then its argument prototype would still apply. */ +-#ifdef __cplusplus +-extern "C" +-#endif +-char compress (); +-int +-main () +-{ +-return compress (); +- ; +- return 0; +-} +-_ACEOF +-if ac_fn_c_try_link "$LINENO"; then : +- ac_cv_lib_z_compress=yes +-else +- ac_cv_lib_z_compress=no +-fi +-rm -f core conftest.err conftest.$ac_objext \ +- conftest$ac_exeext conftest.$ac_ext +-LIBS=$ac_check_lib_save_LIBS +-fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_compress" >&5 +-$as_echo "$ac_cv_lib_z_compress" >&6; } +-if test "x$ac_cv_lib_z_compress" = xyes; then : +- ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" +-if test "x$ac_cv_header_zlib_h" = xyes; then : + + have_libz=yes + + $as_echo "#define HAVE_ZLIB 1" >>confdefs.h + + +-else +- have_libz="no (requires zlib http://www.gzip.org/zlib/)" +-fi +- +- +-else +- have_libz="no (requires zlib http://www.gzip.org/zlib/)" +-fi +- +- + save_LIBS="$LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lzo2a_decompress in -llzo2" >&5 + $as_echo_n "checking for lzo2a_decompress in -llzo2... " >&6; } +@@ -24319,7 +24270,7 @@ + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_VERSION - OK" >&5 + $as_echo "$FREETYPE_VERSION - OK" >&6; } + ft_NONPKGCONFIG_CFLAGS=`$FREETYPE_CONFIG --cflags` +- ft_NONPKGCONFIG_LIBS=`$FREETYPE_CONFIG --libs` ++ ft_NONPKGCONFIG_LIBS=`$FREETYPE_CONFIG --libs | $SED -e 's/-lz//g'` + else { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_VERSION - Too old" >&5 + $as_echo "$FREETYPE_VERSION - Too old" >&6; } + use_ft="no ($FREETYPE_VERSION found; version $FREETYPE_MIN_VERSION from release $FREETYPE_MIN_RELEASE required)" +@@ -24329,7 +24280,7 @@ + fi + + ft_CFLAGS="$FREETYPE_CFLAGS" +- ft_LIBS="$FREETYPE_LIBS" ++ ft_LIBS=`echo "$FREETYPE_LIBS" | $SED -e 's/-lz//g'` + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cairo's FreeType font backend feature could be enabled" >&5 +@@ -24962,7 +24913,7 @@ + + # The ps backend requires zlib. + use_ps=$have_libz +- ps_NONPKGCONFIG_LIBS=-lz ++ ps_NONPKGCONFIG_LIBS=$ZLIB3RDLIB + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cairo's PostScript surface backend feature could be enabled" >&5 +@@ -25355,7 +25306,7 @@ + + # The pdf backend requires zlib. + use_pdf=$have_libz +- pdf_NONPKGCONFIG_LIBS=-lz ++ pdf_NONPKGCONFIG_LIBS=$ZLIB3RDLIB + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cairo's PDF surface backend feature could be enabled" >&5 +@@ -27218,7 +27169,7 @@ + use_xml="no (requires --enable-png)" + else + use_xml=$have_libz +- xml_NONPKGCONFIG_LIBS=-lz ++ xml_NONPKGCONFIG_LIBS=$ZLIB3RDLIB + fi + + diff --git a/external/cairo/cairo/cairo.ofz46165.patch.1 b/external/cairo/cairo/cairo.ofz46165.patch.1 new file mode 100644 index 000000000..948313c2a --- /dev/null +++ b/external/cairo/cairo/cairo.ofz46165.patch.1 @@ -0,0 +1,16 @@ +--- a/src/cairo-pen.c 2022-03-30 09:48:14.702456922 +0100 ++++ b/src/cairo-pen.c 2022-03-30 09:50:40.011793460 +0100 +@@ -289,7 +289,12 @@ + } else if (tolerance >= major_axis) { + num_vertices = 4; + } else { +- num_vertices = ceil (2*M_PI / acos (1 - tolerance / major_axis)); ++ double divisor = acos (1 - tolerance / major_axis); ++ ++ if (divisor == 0.0) ++ return 4; ++ ++ num_vertices = ceil (2*M_PI / divisor); + + /* number of vertices must be even */ + if (num_vertices % 2) diff --git a/external/cairo/cairo/cairo.oldfreetype.patch b/external/cairo/cairo/cairo.oldfreetype.patch new file mode 100644 index 000000000..a25c8bbdd --- /dev/null +++ b/external/cairo/cairo/cairo.oldfreetype.patch @@ -0,0 +1,42 @@ +--- a/cairo/src/cairo-ft-font.c 2020-09-23 15:27:09.114619562 +0200 ++++ b/cairo/src/cairo-ft-font.c 2020-09-23 15:27:22.602808705 +0200 +@@ -2838,7 +2838,7 @@ + goto cleanup; + } + +-#if FREETYPE_MAJOR > 2 || ( FREETYPE_MAJOR == 2 && FREETYPE_MINOR >= 8) ++#if 0 + /* If FT_Get_Var_Blend_Coordinates() is available, we can check if the + * current design coordinates are the default coordinates. In this case + * the current outlines match the font tables. +--- a/cairo/src/cairo-ft-font.c 2020-09-24 10:35:25.391941702 +0200 ++++ b/cairo/src/cairo-ft-font.c 2020-09-24 10:35:39.900126419 +0200 +@@ -451,7 +451,7 @@ + unscaled->have_color = FT_HAS_COLOR (face) != 0; + unscaled->have_color_set = TRUE; + +-#ifdef HAVE_FT_GET_VAR_DESIGN_COORDINATES ++#if 0 + { + FT_MM_Var *ft_mm_var; + if (0 == FT_Get_MM_Var (face, &ft_mm_var)) +@@ -2377,7 +2377,7 @@ + } + + current_coords = malloc (sizeof (FT_Fixed) * ft_mm_var->num_axis); +-#ifdef HAVE_FT_GET_VAR_DESIGN_COORDINATES ++#if 0 + ret = FT_Get_Var_Design_Coordinates (face, ft_mm_var->num_axis, current_coords); + if (ret == 0) { + for (i = 0; i < ft_mm_var->num_axis; i++) { +--- a/cairo/test/font-variations.c 2020-09-24 10:36:01.592402635 +0200 ++++ b/cairo/test/font-variations.c 2020-09-24 10:36:08.728493510 +0200 +@@ -117,7 +117,7 @@ + return CAIRO_TEST_FAILURE; + } + +-#ifdef HAVE_FT_GET_VAR_DESIGN_COORDINATES ++#if 0 + ret = FT_Get_Var_Design_Coordinates (ft_face, 20, coords); + if (ret != 0) { + cairo_test_log (ctx, "Failed to get coords"); diff --git a/external/cairo/cairo/dummy_pkg_config b/external/cairo/cairo/dummy_pkg_config new file mode 100755 index 000000000..829303ea5 --- /dev/null +++ b/external/cairo/cairo/dummy_pkg_config @@ -0,0 +1,3 @@ +#!/bin/sh + + diff --git a/external/cairo/cairo/san.patch.0 b/external/cairo/cairo/san.patch.0 new file mode 100644 index 000000000..272fef628 --- /dev/null +++ b/external/cairo/cairo/san.patch.0 @@ -0,0 +1,103 @@ +--- src/cairo-fixed-private.h ++++ src/cairo-fixed-private.h +@@ -61,7 +61,7 @@ + static inline cairo_fixed_t + _cairo_fixed_from_int (int i) + { +- return i << CAIRO_FIXED_FRAC_BITS; ++ return (unsigned)i << CAIRO_FIXED_FRAC_BITS; + } + + /* This is the "magic number" approach to converting a double into fixed +@@ -249,7 +249,7 @@ + } else if ((f >> CAIRO_FIXED_FRAC_BITS) > INT16_MAX) { + x = INT32_MAX; + } else { +- x = f << (16 - CAIRO_FIXED_FRAC_BITS); ++ x = (uint32_t)f << (16 - CAIRO_FIXED_FRAC_BITS); + } + + return x; +--- src/cairo-gstate.c ++++ src/cairo-gstate.c +@@ -2297,7 +2297,7 @@ + if (!drop || KEEP_GLYPH (transformed_glyphs[j])) + j++; + } +- memcpy (transformed_clusters, clusters, ++ if (num_clusters != 0) memcpy (transformed_clusters, clusters, + num_clusters * sizeof (cairo_text_cluster_t)); + } else { + const cairo_glyph_t *cur_glyph; +@@ -2352,7 +2352,7 @@ + if (! drop || KEEP_GLYPH (transformed_glyphs[j])) + j++; + } +- memcpy (transformed_clusters, clusters, ++ if (num_clusters != 0) memcpy (transformed_clusters, clusters, + num_clusters * sizeof (cairo_text_cluster_t)); + } else { + const cairo_glyph_t *cur_glyph; +--- src/cairo-image-source.c ++++ src/cairo-image-source.c +@@ -509,7 +509,7 @@ + return pixman_image_create_solid_fill (&color); + + case CAIRO_FORMAT_RGB24_888: +- pixel = *(uint32_t *) (image->data + y * image->stride + 3 * x); ++ pixel = (uint32_t)(image->data + y * image->stride + 3 * x)[0] | ((uint32_t)(image->data + y * image->stride + 3 * x)[1] << 8) | ((uint32_t)(image->data + y * image->stride + 3 * x)[2] << 16); + pixel &= 0x00ffffff; /* ignore next pixel bits */ + if (pixel == 0) + return _pixman_black_image (); +--- src/cairo-surface.c ++++ src/cairo-surface.c +@@ -2849,7 +2849,7 @@ + + if (_cairo_scaled_font_has_color_glyphs (scaled_font)) { + utf8_copy = malloc (sizeof (char) * utf8_len); +- memcpy (utf8_copy, utf8, sizeof (char) * utf8_len); ++ if (utf8_len != 0) memcpy (utf8_copy, utf8, sizeof (char) * utf8_len); + utf8 = utf8_copy; + + status = composite_color_glyphs (surface, op, +--- src/cairo-tor-scan-converter.c ++++ src/cairo-tor-scan-converter.c +@@ -253,7 +253,7 @@ + #elif GRID_XY == 15 + # define GRID_AREA_TO_ALPHA(c) (((c) << 4) + (c)) + #elif GRID_XY == 2*256*15 +-# define GRID_AREA_TO_ALPHA(c) (((c) + ((c)<<4) + 256) >> 9) ++# define GRID_AREA_TO_ALPHA(c) (((c) + ((uint32_t)(c)<<4) + 256) >> 9) + #else + # define GRID_AREA_TO_ALPHA(c) (((c)*255 + GRID_XY/2) / GRID_XY) + #endif +--- src/cairo-xlib-render-compositor.c ++++ src/cairo-xlib-render-compositor.c +@@ -1849,8 +1849,8 @@ + return _cairo_error (CAIRO_STATUS_NO_MEMORY); + } + +- dx = -dst_x << 16; +- dy = -dst_y << 16; ++ dx = (unsigned)-dst_x << 16; ++ dy = (unsigned)-dst_y << 16; + for (i = 0; i < traps->num_traps; i++) { + cairo_trapezoid_t *t = &traps->traps[i]; + +--- src/cairo-xlib-surface-shm.c ++++ src/cairo-xlib-surface-shm.c +@@ -1152,9 +1152,11 @@ + cairo_surface_t *surface; + + surface = NULL; +- if (has_shm (other)) +- surface = &_cairo_xlib_shm_surface_create (other, format, width, height, +- FALSE, has_shm_pixmaps (other))->image.base; ++ if (has_shm (other)) { ++ cairo_xlib_shm_surface_t * shm_surface = _cairo_xlib_shm_surface_create (other, format, width, height, ++ FALSE, has_shm_pixmaps (other)); ++ if (shm_surface) surface = &shm_surface->image.base; ++ } + + return surface; + } |