Module Name: xsrc Committed By: mrg Date: Sat Nov 12 03:35:26 UTC 2022
Modified Files: xsrc/external/mit/pixman/dist/pixman: pixman-arm.c pixman-bits-image.c pixman-inlines.h pixman-mmx.c pixman-ppc.c pixman-private.h pixman-x86.c pixman.h xsrc/external/mit/pixman/include: config.h Log Message: merge pixman 0.42.2. this reverts a local change to pixman.h as upstream have fixed it in a different way. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 xsrc/external/mit/pixman/dist/pixman/pixman-arm.c \ xsrc/external/mit/pixman/dist/pixman/pixman-ppc.c \ xsrc/external/mit/pixman/dist/pixman/pixman-x86.c cvs rdiff -u -r1.10 -r1.11 \ xsrc/external/mit/pixman/dist/pixman/pixman-bits-image.c cvs rdiff -u -r1.5 -r1.6 \ xsrc/external/mit/pixman/dist/pixman/pixman-inlines.h cvs rdiff -u -r1.3 -r1.4 xsrc/external/mit/pixman/dist/pixman/pixman-mmx.c cvs rdiff -u -r1.8 -r1.9 \ xsrc/external/mit/pixman/dist/pixman/pixman-private.h cvs rdiff -u -r1.7 -r1.8 xsrc/external/mit/pixman/dist/pixman/pixman.h cvs rdiff -u -r1.23 -r1.24 xsrc/external/mit/pixman/include/config.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: xsrc/external/mit/pixman/dist/pixman/pixman-arm.c diff -u xsrc/external/mit/pixman/dist/pixman/pixman-arm.c:1.2 xsrc/external/mit/pixman/dist/pixman/pixman-arm.c:1.3 --- xsrc/external/mit/pixman/dist/pixman/pixman-arm.c:1.2 Thu Jan 31 22:46:51 2013 +++ xsrc/external/mit/pixman/dist/pixman/pixman-arm.c Sat Nov 12 03:35:25 2022 @@ -176,6 +176,31 @@ detect_cpu_features (void) return features; } +#elif defined (_3DS) /* 3DS homebrew (devkitARM) */ + +static arm_cpu_features_t +detect_cpu_features (void) +{ + arm_cpu_features_t features = 0; + + features |= ARM_V6; + + return features; +} + +#elif defined (PSP2) || defined (__SWITCH__) +/* Vita (VitaSDK) or Switch (devkitA64) homebrew */ + +static arm_cpu_features_t +detect_cpu_features (void) +{ + arm_cpu_features_t features = 0; + + features |= ARM_NEON; + + return features; +} + #elif defined (__NetBSD__) /* NetBSD */ #include <sys/sysctl.h> @@ -254,5 +279,11 @@ _pixman_arm_get_implementations (pixman_ imp = _pixman_implementation_create_arm_neon (imp); #endif +#ifdef USE_ARM_A64_NEON + /* neon is a part of aarch64 */ + if (!_pixman_disabled ("arm-neon")) + imp = _pixman_implementation_create_arm_neon (imp); +#endif + return imp; } Index: xsrc/external/mit/pixman/dist/pixman/pixman-ppc.c diff -u xsrc/external/mit/pixman/dist/pixman/pixman-ppc.c:1.2 xsrc/external/mit/pixman/dist/pixman/pixman-ppc.c:1.3 --- xsrc/external/mit/pixman/dist/pixman/pixman-ppc.c:1.2 Thu Feb 7 13:30:48 2013 +++ xsrc/external/mit/pixman/dist/pixman/pixman-ppc.c Sat Nov 12 03:35:25 2022 @@ -68,6 +68,24 @@ pixman_have_vmx (void) return have_vmx; } +#elif defined (__FreeBSD__) +#include <machine/cpu.h> +#include <sys/auxv.h> + +static pixman_bool_t +pixman_have_vmx (void) +{ + + unsigned long cpufeatures; + int have_vmx; + + if (elf_aux_info(AT_HWCAP, &cpufeatures, sizeof(cpufeatures))) + return FALSE; + + have_vmx = cpufeatures & PPC_FEATURE_HAS_ALTIVEC; + return have_vmx; +} + #elif defined (__linux__) #include <sys/types.h> Index: xsrc/external/mit/pixman/dist/pixman/pixman-x86.c diff -u xsrc/external/mit/pixman/dist/pixman/pixman-x86.c:1.2 xsrc/external/mit/pixman/dist/pixman/pixman-x86.c:1.3 --- xsrc/external/mit/pixman/dist/pixman/pixman-x86.c:1.2 Thu Oct 13 23:26:59 2016 +++ xsrc/external/mit/pixman/dist/pixman/pixman-x86.c Sat Nov 12 03:35:25 2022 @@ -190,6 +190,7 @@ detect_cpu_features (void) memcpy (vendor + 8, &c, 4); if (strcmp (vendor, "AuthenticAMD") == 0 || + strcmp (vendor, "HygonGenuine") == 0 || strcmp (vendor, "Geode by NSC") == 0) { pixman_cpuid (0x80000000, &a, &b, &c, &d); Index: xsrc/external/mit/pixman/dist/pixman/pixman-bits-image.c diff -u xsrc/external/mit/pixman/dist/pixman/pixman-bits-image.c:1.10 xsrc/external/mit/pixman/dist/pixman/pixman-bits-image.c:1.11 --- xsrc/external/mit/pixman/dist/pixman/pixman-bits-image.c:1.10 Mon Mar 4 08:36:42 2019 +++ xsrc/external/mit/pixman/dist/pixman/pixman-bits-image.c Sat Nov 12 03:35:25 2022 @@ -35,6 +35,7 @@ #include "pixman-private.h" #include "pixman-combine32.h" #include "pixman-inlines.h" +#include "dither/blue-noise-64x64.h" /* Fetch functions */ @@ -190,8 +191,8 @@ bits_image_fetch_pixel_bilinear_float (b *ret = bilinear_interpolation_float (tl, tr, bl, br, distx, disty); } -static force_inline void accum_32(int *satot, int *srtot, - int *sgtot, int *sbtot, +static force_inline void accum_32(unsigned int *satot, unsigned int *srtot, + unsigned int *sgtot, unsigned int *sbtot, const void *p, pixman_fixed_t f) { uint32_t pixel = *(uint32_t *)p; @@ -202,8 +203,9 @@ static force_inline void accum_32(int *s *satot += (int)ALPHA_8 (pixel) * f; } -static force_inline void reduce_32(int satot, int srtot, - int sgtot, int sbtot, void *p) +static force_inline void reduce_32(unsigned int satot, unsigned int srtot, + unsigned int sgtot, unsigned int sbtot, + void *p) { uint32_t *ret = p; @@ -220,8 +222,8 @@ static force_inline void reduce_32(int s *ret = ((satot << 24) | (srtot << 16) | (sgtot << 8) | (sbtot)); } -static force_inline void accum_float(int *satot, int *srtot, - int *sgtot, int *sbtot, +static force_inline void accum_float(unsigned int *satot, unsigned int *srtot, + unsigned int *sgtot, unsigned int *sbtot, const void *p, pixman_fixed_t f) { const argb_t *pixel = p; @@ -232,8 +234,8 @@ static force_inline void accum_float(int *sbtot += pixel->b * f; } -static force_inline void reduce_float(int satot, int srtot, - int sgtot, int sbtot, +static force_inline void reduce_float(unsigned int satot, unsigned int srtot, + unsigned int sgtot, unsigned int sbtot, void *p) { argb_t *ret = p; @@ -244,12 +246,13 @@ static force_inline void reduce_float(in ret->b = CLIP (sbtot / 65536.f, 0.f, 1.f); } -typedef void (* accumulate_pixel_t) (int *satot, int *srtot, - int *sgtot, int *sbtot, +typedef void (* accumulate_pixel_t) (unsigned int *satot, unsigned int *srtot, + unsigned int *sgtot, unsigned int *sbtot, const void *pixel, pixman_fixed_t f); -typedef void (* reduce_pixel_t) (int satot, int srtot, - int sgtot, int sbtot, void *out); +typedef void (* reduce_pixel_t) (unsigned int satot, unsigned int srtot, + unsigned int sgtot, unsigned int sbtot, + void *out); static force_inline void bits_image_fetch_pixel_convolution (bits_image_t *image, @@ -269,7 +272,7 @@ bits_image_fetch_pixel_convolution (bits pixman_repeat_t repeat_mode = image->common.repeat; int width = image->width; int height = image->height; - int srtot, sgtot, sbtot, satot; + unsigned int srtot, sgtot, sbtot, satot; params += 2; @@ -338,7 +341,7 @@ bits_image_fetch_pixel_separable_convolu int x_off = ((cwidth << 16) - pixman_fixed_1) >> 1; int y_off = ((cheight << 16) - pixman_fixed_1) >> 1; pixman_fixed_t *y_params; - int srtot, sgtot, sbtot, satot; + unsigned int srtot, sgtot, sbtot, satot; int32_t x1, x2, y1, y2; int32_t px, py; int i, j; @@ -432,29 +435,38 @@ bits_image_fetch_pixel_filtered (bits_im case PIXMAN_FILTER_CONVOLUTION: if (wide) + { bits_image_fetch_pixel_convolution (image, x, y, get_pixel, out, accum_float, reduce_float); + } else + { bits_image_fetch_pixel_convolution (image, x, y, get_pixel, out, accum_32, reduce_32); + } break; case PIXMAN_FILTER_SEPARABLE_CONVOLUTION: if (wide) + { bits_image_fetch_pixel_separable_convolution (image, x, y, get_pixel, out, accum_float, reduce_float); + } else + { bits_image_fetch_pixel_separable_convolution (image, x, y, get_pixel, out, accum_32, reduce_32); + } break; default: + assert (0); break; } } @@ -470,6 +482,7 @@ __bits_image_fetch_affine_no_alpha (pixm int width = iter->width; uint32_t * buffer = iter->buffer; + const uint32_t wide_zero[4] = {0}; pixman_fixed_t x, y; pixman_fixed_t ux, uy; pixman_vector_t v; @@ -501,7 +514,8 @@ __bits_image_fetch_affine_no_alpha (pixm for (i = 0; i < width; ++i) { - if (!mask || mask[i]) + if (!mask || (!wide && mask[i]) || + (wide && memcmp(&mask[4 * i], wide_zero, 16) != 0)) { bits_image_fetch_pixel_filtered ( &image->bits, wide, x, y, get_pixel, buffer); @@ -624,6 +638,7 @@ __bits_image_fetch_general (pixman_iter_ get_pixel_t get_pixel = wide ? fetch_pixel_general_float : fetch_pixel_general_32; + const uint32_t wide_zero[4] = {0}; pixman_fixed_t x, y, w; pixman_fixed_t ux, uy, uw; pixman_vector_t v; @@ -658,12 +673,13 @@ __bits_image_fetch_general (pixman_iter_ { pixman_fixed_t x0, y0; - if (!mask || mask[i]) + if (!mask || (!wide && mask[i]) || + (wide && memcmp(&mask[4 * i], wide_zero, 16) != 0)) { if (w != 0) { - x0 = ((pixman_fixed_48_16_t)x << 16) / w; - y0 = ((pixman_fixed_48_16_t)y << 16) / w; + x0 = ((uint64_t)x << 16) / w; + y0 = ((uint64_t)y << 16) / w; } else { @@ -1039,6 +1055,119 @@ dest_write_back_narrow (pixman_iter_t *i iter->y++; } +static float +dither_factor_blue_noise_64 (int x, int y) +{ + float m = dither_blue_noise_64x64[((y & 0x3f) << 6) | (x & 0x3f)]; + return m * (1. / 4096.f) + (1. / 8192.f); +} + +static float +dither_factor_bayer_8 (int x, int y) +{ + uint32_t m; + + y ^= x; + + /* Compute reverse(interleave(xor(x mod n, y mod n), x mod n)) + * Here n = 8 and `mod n` is the bottom 3 bits. + */ + m = ((y & 0x1) << 5) | ((x & 0x1) << 4) | + ((y & 0x2) << 2) | ((x & 0x2) << 1) | + ((y & 0x4) >> 1) | ((x & 0x4) >> 2); + + /* m is in range [0, 63]. We scale it to [0, 63.0f/64.0f], then + * shift it to to [1.0f/128.0f, 127.0f/128.0f] so that 0 < d < 1. + * This ensures exact values are not changed by dithering. + */ + return (float)(m) * (1 / 64.0f) + (1.0f / 128.0f); +} + +typedef float (* dither_factor_t)(int x, int y); + +static force_inline float +dither_apply_channel (float f, float d, float s) +{ + /* float_to_unorm splits the [0, 1] segment in (1 << n_bits) + * subsections of equal length; however unorm_to_float does not + * map to the center of those sections. In fact, pixel value u is + * mapped to: + * + * u u u 1 + * -------------- = ---------- + -------------- * ---------- + * 2^n_bits - 1 2^n_bits 2^n_bits - 1 2^n_bits + * + * Hence if f = u / (2^n_bits - 1) is exactly representable on a + * n_bits palette, all the numbers between + * + * u + * ---------- = f - f * 2^n_bits = f + (0 - f) * 2^n_bits + * 2^n_bits + * + * and + * + * u + 1 + * ---------- = f - (f - 1) * 2^n_bits = f + (1 - f) * 2^n_bits + * 2^n_bits + * + * are also mapped back to u. + * + * Hence the following calculation ensures that we add as much + * noise as possible without perturbing values which are exactly + * representable in the target colorspace. Note that this corresponds to + * mixing the original color with noise with a ratio of `1 / 2^n_bits`. + */ + return f + (d - f) * s; +} + +static force_inline float +dither_compute_scale (int n_bits) +{ + // No dithering for wide formats + if (n_bits == 0 || n_bits >= 32) + return 0.f; + + return 1.f / (float)(1 << n_bits); +} + +static const uint32_t * +dither_apply_ordered (pixman_iter_t *iter, dither_factor_t factor) +{ + bits_image_t *image = &iter->image->bits; + int x = iter->x + image->dither_offset_x; + int y = iter->y + image->dither_offset_y; + int width = iter->width; + argb_t *buffer = (argb_t *)iter->buffer; + + pixman_format_code_t format = image->format; + int a_size = PIXMAN_FORMAT_A (format); + int r_size = PIXMAN_FORMAT_R (format); + int g_size = PIXMAN_FORMAT_G (format); + int b_size = PIXMAN_FORMAT_B (format); + + float a_scale = dither_compute_scale (a_size); + float r_scale = dither_compute_scale (r_size); + float g_scale = dither_compute_scale (g_size); + float b_scale = dither_compute_scale (b_size); + + int i; + float d; + + for (i = 0; i < width; ++i) + { + d = factor (x + i, y); + + buffer->a = dither_apply_channel (buffer->a, d, a_scale); + buffer->r = dither_apply_channel (buffer->r, d, r_scale); + buffer->g = dither_apply_channel (buffer->g, d, g_scale); + buffer->b = dither_apply_channel (buffer->b, d, b_scale); + + buffer++; + } + + return iter->buffer; +} + static void dest_write_back_wide (pixman_iter_t *iter) { @@ -1048,6 +1177,23 @@ dest_write_back_wide (pixman_iter_t *ite int width = iter->width; const uint32_t *buffer = iter->buffer; + switch (image->dither) + { + case PIXMAN_DITHER_NONE: + break; + + case PIXMAN_DITHER_GOOD: + case PIXMAN_DITHER_BEST: + case PIXMAN_DITHER_ORDERED_BLUE_NOISE_64: + buffer = dither_apply_ordered (iter, dither_factor_blue_noise_64); + break; + + case PIXMAN_DITHER_FAST: + case PIXMAN_DITHER_ORDERED_BAYER_8: + buffer = dither_apply_ordered (iter, dither_factor_bayer_8); + break; + } + image->store_scanline_float (image, x, y, width, buffer); if (image->common.alpha_map) @@ -1163,6 +1309,9 @@ _pixman_bits_image_init (pixman_image_t image->bits.height = height; image->bits.bits = bits; image->bits.free_me = free_me; + image->bits.dither = PIXMAN_DITHER_NONE; + image->bits.dither_offset_x = 0; + image->bits.dither_offset_y = 0; image->bits.read_func = NULL; image->bits.write_func = NULL; image->bits.rowstride = rowstride; Index: xsrc/external/mit/pixman/dist/pixman/pixman-inlines.h diff -u xsrc/external/mit/pixman/dist/pixman/pixman-inlines.h:1.5 xsrc/external/mit/pixman/dist/pixman/pixman-inlines.h:1.6 --- xsrc/external/mit/pixman/dist/pixman/pixman-inlines.h:1.5 Mon Mar 4 08:36:42 2019 +++ xsrc/external/mit/pixman/dist/pixman/pixman-inlines.h Sat Nov 12 03:35:25 2022 @@ -231,7 +231,7 @@ bilinear_interpolation_float (argb_t tl, argb_t r; distxy = distx * disty; - distxiy = distx - (1.f - distxy); + distxiy = distx * (1.f - disty); distixy = (1.f - distx) * disty; distixiy = (1.f - distx) * (1.f - disty); Index: xsrc/external/mit/pixman/dist/pixman/pixman-mmx.c diff -u xsrc/external/mit/pixman/dist/pixman/pixman-mmx.c:1.3 xsrc/external/mit/pixman/dist/pixman/pixman-mmx.c:1.4 --- xsrc/external/mit/pixman/dist/pixman/pixman-mmx.c:1.3 Sat Mar 4 23:22:48 2017 +++ xsrc/external/mit/pixman/dist/pixman/pixman-mmx.c Sat Nov 12 03:35:25 2022 @@ -387,8 +387,10 @@ in_over (__m64 src, __m64 srca, __m64 ma static force_inline __m64 ldq_u(__m64 *p) { #ifdef USE_X86_MMX - /* x86's alignment restrictions are very relaxed. */ - return *(__m64 *)p; + /* x86's alignment restrictions are very relaxed, but that's no excuse */ + __m64 r; + memcpy(&r, p, sizeof(__m64)); + return r; #elif defined USE_ARM_IWMMXT int align = (uintptr_t)p & 7; __m64 *aligned_p; @@ -407,7 +409,9 @@ static force_inline uint32_t ldl_u(const { #ifdef USE_X86_MMX /* x86's alignment restrictions are very relaxed. */ - return *p; + uint32_t r; + memcpy(&r, p, sizeof(uint32_t)); + return r; #else struct __una_u32 { uint32_t x __attribute__((packed)); }; const struct __una_u32 *ptr = (const struct __una_u32 *) p; @@ -3950,7 +3954,7 @@ mmx_fetch_a8 (pixman_iter_t *iter, const while (w && (((uintptr_t)dst) & 15)) { - *dst++ = *(src++) << 24; + *dst++ = (uint32_t)*(src++) << 24; w--; } @@ -3977,7 +3981,7 @@ mmx_fetch_a8 (pixman_iter_t *iter, const while (w) { - *dst++ = *(src++) << 24; + *dst++ = (uint32_t)*(src++) << 24; w--; } Index: xsrc/external/mit/pixman/dist/pixman/pixman-private.h diff -u xsrc/external/mit/pixman/dist/pixman/pixman-private.h:1.8 xsrc/external/mit/pixman/dist/pixman/pixman-private.h:1.9 --- xsrc/external/mit/pixman/dist/pixman/pixman-private.h:1.8 Mon Mar 4 08:36:42 2019 +++ xsrc/external/mit/pixman/dist/pixman/pixman-private.h Sat Nov 12 03:35:25 2022 @@ -180,6 +180,10 @@ struct bits_image uint32_t * free_me; int rowstride; /* in number of uint32_t's */ + pixman_dither_t dither; + uint32_t dither_offset_y; + uint32_t dither_offset_x; + fetch_scanline_t fetch_scanline_32; fetch_pixel_32_t fetch_pixel_32; store_scanline_t store_scanline_32; @@ -636,6 +640,11 @@ pixman_implementation_t * _pixman_implementation_create_arm_neon (pixman_implementation_t *fallback); #endif +#ifdef USE_ARM_A64_NEON +pixman_implementation_t * +_pixman_implementation_create_arm_neon (pixman_implementation_t *fallback); +#endif + #ifdef USE_MIPS_DSPR2 pixman_implementation_t * _pixman_implementation_create_mips_dspr2 (pixman_implementation_t *fallback); @@ -1100,16 +1109,19 @@ _pixman_log_error (const char *function, typedef struct { pixman_fixed_48_16_t v[3]; } pixman_vector_48_16_t; +PIXMAN_EXPORT pixman_bool_t pixman_transform_point_31_16 (const pixman_transform_t *t, const pixman_vector_48_16_t *v, pixman_vector_48_16_t *result); +PIXMAN_EXPORT void pixman_transform_point_31_16_3d (const pixman_transform_t *t, const pixman_vector_48_16_t *v, pixman_vector_48_16_t *result); +PIXMAN_EXPORT void pixman_transform_point_31_16_affine (const pixman_transform_t *t, const pixman_vector_48_16_t *v, Index: xsrc/external/mit/pixman/dist/pixman/pixman.h diff -u xsrc/external/mit/pixman/dist/pixman/pixman.h:1.7 xsrc/external/mit/pixman/dist/pixman/pixman.h:1.8 --- xsrc/external/mit/pixman/dist/pixman/pixman.h:1.7 Sun Dec 30 08:59:39 2018 +++ xsrc/external/mit/pixman/dist/pixman/pixman.h Sat Nov 12 03:35:25 2022 @@ -127,7 +127,7 @@ typedef pixman_fixed_16_16_t pixman_fixe #define pixman_fixed_1_minus_e (pixman_fixed_1 - pixman_fixed_e) #define pixman_fixed_minus_1 (pixman_int_to_fixed(-1)) #define pixman_fixed_to_int(f) ((int) ((f) >> 16)) -#define pixman_int_to_fixed(i) ((pixman_fixed_t) ((i) * 65536)) +#define pixman_int_to_fixed(i) ((pixman_fixed_t) ((uint32_t) (i) << 16)) #define pixman_fixed_to_double(f) (double) ((f) / (double) pixman_fixed_1) #define pixman_double_to_fixed(d) ((pixman_fixed_t) ((d) * 65536.0)) #define pixman_fixed_frac(f) ((f) & pixman_fixed_1_minus_e) @@ -184,42 +184,73 @@ struct pixman_transform struct pixman_box16; typedef union pixman_image pixman_image_t; +PIXMAN_API void pixman_transform_init_identity (struct pixman_transform *matrix); + +PIXMAN_API pixman_bool_t pixman_transform_point_3d (const struct pixman_transform *transform, struct pixman_vector *vector); + +PIXMAN_API pixman_bool_t pixman_transform_point (const struct pixman_transform *transform, struct pixman_vector *vector); + +PIXMAN_API pixman_bool_t pixman_transform_multiply (struct pixman_transform *dst, const struct pixman_transform *l, const struct pixman_transform *r); + +PIXMAN_API void pixman_transform_init_scale (struct pixman_transform *t, pixman_fixed_t sx, pixman_fixed_t sy); + +PIXMAN_API pixman_bool_t pixman_transform_scale (struct pixman_transform *forward, struct pixman_transform *reverse, pixman_fixed_t sx, pixman_fixed_t sy); + +PIXMAN_API void pixman_transform_init_rotate (struct pixman_transform *t, pixman_fixed_t cos, pixman_fixed_t sin); + +PIXMAN_API pixman_bool_t pixman_transform_rotate (struct pixman_transform *forward, struct pixman_transform *reverse, pixman_fixed_t c, pixman_fixed_t s); + +PIXMAN_API void pixman_transform_init_translate (struct pixman_transform *t, pixman_fixed_t tx, pixman_fixed_t ty); + +PIXMAN_API pixman_bool_t pixman_transform_translate (struct pixman_transform *forward, struct pixman_transform *reverse, pixman_fixed_t tx, pixman_fixed_t ty); + +PIXMAN_API pixman_bool_t pixman_transform_bounds (const struct pixman_transform *matrix, struct pixman_box16 *b); + +PIXMAN_API pixman_bool_t pixman_transform_invert (struct pixman_transform *dst, const struct pixman_transform *src); + +PIXMAN_API pixman_bool_t pixman_transform_is_identity (const struct pixman_transform *t); + +PIXMAN_API pixman_bool_t pixman_transform_is_scale (const struct pixman_transform *t); + +PIXMAN_API pixman_bool_t pixman_transform_is_int_translate (const struct pixman_transform *t); + +PIXMAN_API pixman_bool_t pixman_transform_is_inverse (const struct pixman_transform *a, const struct pixman_transform *b); @@ -239,42 +270,70 @@ struct pixman_f_transform double m[3][3]; }; + +PIXMAN_API pixman_bool_t pixman_transform_from_pixman_f_transform (struct pixman_transform *t, const struct pixman_f_transform *ft); + +PIXMAN_API void pixman_f_transform_from_pixman_transform (struct pixman_f_transform *ft, const struct pixman_transform *t); + +PIXMAN_API pixman_bool_t pixman_f_transform_invert (struct pixman_f_transform *dst, const struct pixman_f_transform *src); + +PIXMAN_API pixman_bool_t pixman_f_transform_point (const struct pixman_f_transform *t, struct pixman_f_vector *v); + +PIXMAN_API void pixman_f_transform_point_3d (const struct pixman_f_transform *t, struct pixman_f_vector *v); + +PIXMAN_API void pixman_f_transform_multiply (struct pixman_f_transform *dst, const struct pixman_f_transform *l, const struct pixman_f_transform *r); + +PIXMAN_API void pixman_f_transform_init_scale (struct pixman_f_transform *t, double sx, double sy); + +PIXMAN_API pixman_bool_t pixman_f_transform_scale (struct pixman_f_transform *forward, struct pixman_f_transform *reverse, double sx, double sy); + +PIXMAN_API void pixman_f_transform_init_rotate (struct pixman_f_transform *t, double cos, double sin); + +PIXMAN_API pixman_bool_t pixman_f_transform_rotate (struct pixman_f_transform *forward, struct pixman_f_transform *reverse, double c, double s); + +PIXMAN_API void pixman_f_transform_init_translate (struct pixman_f_transform *t, double tx, double ty); + +PIXMAN_API pixman_bool_t pixman_f_transform_translate (struct pixman_f_transform *forward, struct pixman_f_transform *reverse, double tx, double ty); + +PIXMAN_API pixman_bool_t pixman_f_transform_bounds (const struct pixman_f_transform *t, struct pixman_box16 *b); + +PIXMAN_API void pixman_f_transform_init_identity (struct pixman_f_transform *t); typedef enum @@ -287,6 +346,16 @@ typedef enum typedef enum { + PIXMAN_DITHER_NONE, + PIXMAN_DITHER_FAST, + PIXMAN_DITHER_GOOD, + PIXMAN_DITHER_BEST, + PIXMAN_DITHER_ORDERED_BAYER_8, + PIXMAN_DITHER_ORDERED_BLUE_NOISE_64, +} pixman_dither_t; + +typedef enum +{ PIXMAN_FILTER_FAST, PIXMAN_FILTER_GOOD, PIXMAN_FILTER_BEST, @@ -424,73 +493,120 @@ typedef enum /* This function exists only to make it possible to preserve * the X ABI - it should go away at first opportunity. */ +PIXMAN_API void pixman_region_set_static_pointers (pixman_box16_t *empty_box, pixman_region16_data_t *empty_data, pixman_region16_data_t *broken_data); /* creation/destruction */ +PIXMAN_API void pixman_region_init (pixman_region16_t *region); + +PIXMAN_API void pixman_region_init_rect (pixman_region16_t *region, int x, int y, unsigned int width, unsigned int height); + +PIXMAN_API pixman_bool_t pixman_region_init_rects (pixman_region16_t *region, const pixman_box16_t *boxes, int count); -void pixman_region_init_with_extents (pixman_region16_t *region, - pixman_box16_t *extents); + +PIXMAN_API +void pixman_region_init_with_extents (pixman_region16_t *region, + const pixman_box16_t *extents); + +PIXMAN_API void pixman_region_init_from_image (pixman_region16_t *region, pixman_image_t *image); + +PIXMAN_API void pixman_region_fini (pixman_region16_t *region); /* manipulation */ +PIXMAN_API void pixman_region_translate (pixman_region16_t *region, int x, int y); -pixman_bool_t pixman_region_copy (pixman_region16_t *dest, - pixman_region16_t *source); -pixman_bool_t pixman_region_intersect (pixman_region16_t *new_reg, - pixman_region16_t *reg1, - pixman_region16_t *reg2); -pixman_bool_t pixman_region_union (pixman_region16_t *new_reg, - pixman_region16_t *reg1, - pixman_region16_t *reg2); -pixman_bool_t pixman_region_union_rect (pixman_region16_t *dest, - pixman_region16_t *source, - int x, - int y, - unsigned int width, - unsigned int height); -pixman_bool_t pixman_region_intersect_rect (pixman_region16_t *dest, - pixman_region16_t *source, - int x, - int y, - unsigned int width, - unsigned int height); -pixman_bool_t pixman_region_subtract (pixman_region16_t *reg_d, - pixman_region16_t *reg_m, - pixman_region16_t *reg_s); -pixman_bool_t pixman_region_inverse (pixman_region16_t *new_reg, - pixman_region16_t *reg1, - pixman_box16_t *inv_rect); -pixman_bool_t pixman_region_contains_point (pixman_region16_t *region, - int x, - int y, - pixman_box16_t *box); -pixman_region_overlap_t pixman_region_contains_rectangle (pixman_region16_t *region, - pixman_box16_t *prect); -pixman_bool_t pixman_region_not_empty (pixman_region16_t *region); -pixman_box16_t * pixman_region_extents (pixman_region16_t *region); -int pixman_region_n_rects (pixman_region16_t *region); -pixman_box16_t * pixman_region_rectangles (pixman_region16_t *region, - int *n_rects); -pixman_bool_t pixman_region_equal (pixman_region16_t *region1, - pixman_region16_t *region2); + +PIXMAN_API +pixman_bool_t pixman_region_copy (pixman_region16_t *dest, + const pixman_region16_t *source); + +PIXMAN_API +pixman_bool_t pixman_region_intersect (pixman_region16_t *new_reg, + const pixman_region16_t *reg1, + const pixman_region16_t *reg2); + +PIXMAN_API +pixman_bool_t pixman_region_union (pixman_region16_t *new_reg, + const pixman_region16_t *reg1, + const pixman_region16_t *reg2); + +PIXMAN_API +pixman_bool_t pixman_region_union_rect (pixman_region16_t *dest, + const pixman_region16_t *source, + int x, + int y, + unsigned int width, + unsigned int height); + +PIXMAN_API +pixman_bool_t pixman_region_intersect_rect (pixman_region16_t *dest, + const pixman_region16_t *source, + int x, + int y, + unsigned int width, + unsigned int height); + +PIXMAN_API +pixman_bool_t pixman_region_subtract (pixman_region16_t *reg_d, + const pixman_region16_t *reg_m, + const pixman_region16_t *reg_s); + +PIXMAN_API +pixman_bool_t pixman_region_inverse (pixman_region16_t *new_reg, + const pixman_region16_t *reg1, + const pixman_box16_t *inv_rect); + +PIXMAN_API +pixman_bool_t pixman_region_contains_point (const pixman_region16_t *region, + int x, + int y, + pixman_box16_t *box); + +PIXMAN_API +pixman_region_overlap_t pixman_region_contains_rectangle (const pixman_region16_t *region, + const pixman_box16_t *prect); + +PIXMAN_API +pixman_bool_t pixman_region_not_empty (const pixman_region16_t *region); + +PIXMAN_API +pixman_box16_t * pixman_region_extents (const pixman_region16_t *region); + +PIXMAN_API +int pixman_region_n_rects (const pixman_region16_t *region); + +PIXMAN_API +pixman_box16_t * pixman_region_rectangles (const pixman_region16_t *region, + int *n_rects); + +PIXMAN_API +pixman_bool_t pixman_region_equal (const pixman_region16_t *region1, + const pixman_region16_t *region2); + +PIXMAN_API pixman_bool_t pixman_region_selfcheck (pixman_region16_t *region); -void pixman_region_reset (pixman_region16_t *region, - pixman_box16_t *box); + +PIXMAN_API +void pixman_region_reset (pixman_region16_t *region, + const pixman_box16_t *box); + +PIXMAN_API void pixman_region_clear (pixman_region16_t *region); /* * 32 bit regions @@ -524,72 +640,119 @@ struct pixman_region32 }; /* creation/destruction */ +PIXMAN_API void pixman_region32_init (pixman_region32_t *region); + +PIXMAN_API void pixman_region32_init_rect (pixman_region32_t *region, int x, int y, unsigned int width, unsigned int height); + +PIXMAN_API pixman_bool_t pixman_region32_init_rects (pixman_region32_t *region, const pixman_box32_t *boxes, int count); -void pixman_region32_init_with_extents (pixman_region32_t *region, - pixman_box32_t *extents); + +PIXMAN_API +void pixman_region32_init_with_extents (pixman_region32_t *region, + const pixman_box32_t *extents); + +PIXMAN_API void pixman_region32_init_from_image (pixman_region32_t *region, pixman_image_t *image); + +PIXMAN_API void pixman_region32_fini (pixman_region32_t *region); /* manipulation */ +PIXMAN_API void pixman_region32_translate (pixman_region32_t *region, int x, int y); -pixman_bool_t pixman_region32_copy (pixman_region32_t *dest, - pixman_region32_t *source); -pixman_bool_t pixman_region32_intersect (pixman_region32_t *new_reg, - pixman_region32_t *reg1, - pixman_region32_t *reg2); -pixman_bool_t pixman_region32_union (pixman_region32_t *new_reg, - pixman_region32_t *reg1, - pixman_region32_t *reg2); -pixman_bool_t pixman_region32_intersect_rect (pixman_region32_t *dest, - pixman_region32_t *source, - int x, - int y, - unsigned int width, - unsigned int height); -pixman_bool_t pixman_region32_union_rect (pixman_region32_t *dest, - pixman_region32_t *source, - int x, - int y, - unsigned int width, - unsigned int height); -pixman_bool_t pixman_region32_subtract (pixman_region32_t *reg_d, - pixman_region32_t *reg_m, - pixman_region32_t *reg_s); -pixman_bool_t pixman_region32_inverse (pixman_region32_t *new_reg, - pixman_region32_t *reg1, - pixman_box32_t *inv_rect); -pixman_bool_t pixman_region32_contains_point (pixman_region32_t *region, - int x, - int y, - pixman_box32_t *box); -pixman_region_overlap_t pixman_region32_contains_rectangle (pixman_region32_t *region, - pixman_box32_t *prect); -pixman_bool_t pixman_region32_not_empty (pixman_region32_t *region); -pixman_box32_t * pixman_region32_extents (pixman_region32_t *region); -int pixman_region32_n_rects (pixman_region32_t *region); -pixman_box32_t * pixman_region32_rectangles (pixman_region32_t *region, - int *n_rects); -pixman_bool_t pixman_region32_equal (pixman_region32_t *region1, - pixman_region32_t *region2); + +PIXMAN_API +pixman_bool_t pixman_region32_copy (pixman_region32_t *dest, + const pixman_region32_t *source); + +PIXMAN_API +pixman_bool_t pixman_region32_intersect (pixman_region32_t *new_reg, + const pixman_region32_t *reg1, + const pixman_region32_t *reg2); + +PIXMAN_API +pixman_bool_t pixman_region32_union (pixman_region32_t *new_reg, + const pixman_region32_t *reg1, + const pixman_region32_t *reg2); + +PIXMAN_API +pixman_bool_t pixman_region32_intersect_rect (pixman_region32_t *dest, + const pixman_region32_t *source, + int x, + int y, + unsigned int width, + unsigned int height); + +PIXMAN_API +pixman_bool_t pixman_region32_union_rect (pixman_region32_t *dest, + const pixman_region32_t *source, + int x, + int y, + unsigned int width, + unsigned int height); + +PIXMAN_API +pixman_bool_t pixman_region32_subtract (pixman_region32_t *reg_d, + const pixman_region32_t *reg_m, + const pixman_region32_t *reg_s); + +PIXMAN_API +pixman_bool_t pixman_region32_inverse (pixman_region32_t *new_reg, + const pixman_region32_t *reg1, + const pixman_box32_t *inv_rect); + +PIXMAN_API +pixman_bool_t pixman_region32_contains_point (const pixman_region32_t *region, + int x, + int y, + pixman_box32_t *box); + +PIXMAN_API +pixman_region_overlap_t pixman_region32_contains_rectangle (const pixman_region32_t *region, + const pixman_box32_t *prect); + +PIXMAN_API +pixman_bool_t pixman_region32_not_empty (const pixman_region32_t *region); + +PIXMAN_API +pixman_box32_t * pixman_region32_extents (const pixman_region32_t *region); + +PIXMAN_API +int pixman_region32_n_rects (const pixman_region32_t *region); + +PIXMAN_API +pixman_box32_t * pixman_region32_rectangles (const pixman_region32_t *region, + int *n_rects); + +PIXMAN_API +pixman_bool_t pixman_region32_equal (const pixman_region32_t *region1, + const pixman_region32_t *region2); + +PIXMAN_API pixman_bool_t pixman_region32_selfcheck (pixman_region32_t *region); -void pixman_region32_reset (pixman_region32_t *region, - pixman_box32_t *box); + +PIXMAN_API +void pixman_region32_reset (pixman_region32_t *region, + const pixman_box32_t *box); + +PIXMAN_API void pixman_region32_clear (pixman_region32_t *region); /* Copy / Fill / Misc */ +PIXMAN_API pixman_bool_t pixman_blt (uint32_t *src_bits, uint32_t *dst_bits, int src_stride, @@ -602,6 +765,8 @@ pixman_bool_t pixman_blt int dest_y, int width, int height); + +PIXMAN_API pixman_bool_t pixman_fill (uint32_t *bits, int stride, int bpp, @@ -611,7 +776,11 @@ pixman_bool_t pixman_fill int height, uint32_t _xor); + +PIXMAN_API int pixman_version (void); + +PIXMAN_API const char* pixman_version_string (void); /* @@ -777,30 +946,44 @@ typedef enum { } pixman_format_code_t; /* Querying supported format values. */ +PIXMAN_API pixman_bool_t pixman_format_supported_destination (pixman_format_code_t format); + +PIXMAN_API pixman_bool_t pixman_format_supported_source (pixman_format_code_t format); /* Constructors */ +PIXMAN_API pixman_image_t *pixman_image_create_solid_fill (const pixman_color_t *color); + +PIXMAN_API pixman_image_t *pixman_image_create_linear_gradient (const pixman_point_fixed_t *p1, const pixman_point_fixed_t *p2, const pixman_gradient_stop_t *stops, int n_stops); + +PIXMAN_API pixman_image_t *pixman_image_create_radial_gradient (const pixman_point_fixed_t *inner, const pixman_point_fixed_t *outer, pixman_fixed_t inner_radius, pixman_fixed_t outer_radius, const pixman_gradient_stop_t *stops, int n_stops); + +PIXMAN_API pixman_image_t *pixman_image_create_conical_gradient (const pixman_point_fixed_t *center, pixman_fixed_t angle, const pixman_gradient_stop_t *stops, int n_stops); + +PIXMAN_API pixman_image_t *pixman_image_create_bits (pixman_format_code_t format, int width, int height, uint32_t *bits, int rowstride_bytes); + +PIXMAN_API pixman_image_t *pixman_image_create_bits_no_clear (pixman_format_code_t format, int width, int height, @@ -808,48 +991,99 @@ pixman_image_t *pixman_image_create_bits int rowstride_bytes); /* Destructor */ +PIXMAN_API pixman_image_t *pixman_image_ref (pixman_image_t *image); + +PIXMAN_API pixman_bool_t pixman_image_unref (pixman_image_t *image); + +PIXMAN_API void pixman_image_set_destroy_function (pixman_image_t *image, pixman_image_destroy_func_t function, void *data); + +PIXMAN_API void * pixman_image_get_destroy_data (pixman_image_t *image); /* Set properties */ +PIXMAN_API pixman_bool_t pixman_image_set_clip_region (pixman_image_t *image, pixman_region16_t *region); + +PIXMAN_API pixman_bool_t pixman_image_set_clip_region32 (pixman_image_t *image, pixman_region32_t *region); + +PIXMAN_API void pixman_image_set_has_client_clip (pixman_image_t *image, pixman_bool_t clien_clip); + +PIXMAN_API pixman_bool_t pixman_image_set_transform (pixman_image_t *image, const pixman_transform_t *transform); + +PIXMAN_API void pixman_image_set_repeat (pixman_image_t *image, pixman_repeat_t repeat); + +PIXMAN_API +void pixman_image_set_dither (pixman_image_t *image, + pixman_dither_t dither); + +PIXMAN_API +void pixman_image_set_dither_offset (pixman_image_t *image, + int offset_x, + int offset_y); + +PIXMAN_API pixman_bool_t pixman_image_set_filter (pixman_image_t *image, pixman_filter_t filter, const pixman_fixed_t *filter_params, int n_filter_params); + +PIXMAN_API void pixman_image_set_source_clipping (pixman_image_t *image, pixman_bool_t source_clipping); + +PIXMAN_API void pixman_image_set_alpha_map (pixman_image_t *image, pixman_image_t *alpha_map, int16_t x, int16_t y); + +PIXMAN_API void pixman_image_set_component_alpha (pixman_image_t *image, pixman_bool_t component_alpha); + +PIXMAN_API pixman_bool_t pixman_image_get_component_alpha (pixman_image_t *image); + +PIXMAN_API void pixman_image_set_accessors (pixman_image_t *image, pixman_read_memory_func_t read_func, pixman_write_memory_func_t write_func); + +PIXMAN_API void pixman_image_set_indexed (pixman_image_t *image, const pixman_indexed_t *indexed); + +PIXMAN_API uint32_t *pixman_image_get_data (pixman_image_t *image); + +PIXMAN_API int pixman_image_get_width (pixman_image_t *image); + +PIXMAN_API int pixman_image_get_height (pixman_image_t *image); + +PIXMAN_API int pixman_image_get_stride (pixman_image_t *image); /* in bytes */ + +PIXMAN_API int pixman_image_get_depth (pixman_image_t *image); + +PIXMAN_API pixman_format_code_t pixman_image_get_format (pixman_image_t *image); typedef enum @@ -867,6 +1101,7 @@ typedef enum /* Create the parameter list for a SEPARABLE_CONVOLUTION filter * with the given kernels and scale parameters. */ +PIXMAN_API pixman_fixed_t * pixman_filter_create_separable_convolution (int *n_values, pixman_fixed_t scale_x, @@ -878,11 +1113,15 @@ pixman_filter_create_separable_convoluti int subsample_bits_x, int subsample_bits_y); + +PIXMAN_API pixman_bool_t pixman_image_fill_rectangles (pixman_op_t op, pixman_image_t *image, const pixman_color_t *color, int n_rects, const pixman_rectangle16_t *rects); + +PIXMAN_API pixman_bool_t pixman_image_fill_boxes (pixman_op_t op, pixman_image_t *dest, const pixman_color_t *color, @@ -890,6 +1129,7 @@ pixman_bool_t pixman_image_fill_boxes const pixman_box32_t *boxes); /* Composite */ +PIXMAN_API pixman_bool_t pixman_compute_composite_region (pixman_region16_t *region, pixman_image_t *src_image, pixman_image_t *mask_image, @@ -902,6 +1142,8 @@ pixman_bool_t pixman_compute_composite_r int16_t dest_y, uint16_t width, uint16_t height); + +PIXMAN_API void pixman_image_composite (pixman_op_t op, pixman_image_t *src, pixman_image_t *mask, @@ -914,6 +1156,8 @@ void pixman_image_composite int16_t dest_y, uint16_t width, uint16_t height); + +PIXMAN_API void pixman_image_composite32 (pixman_op_t op, pixman_image_t *src, pixman_image_t *mask, @@ -945,6 +1189,7 @@ void pixman_image_composite32 * Since 0.21.2, pixman doesn't do these workarounds anymore, so now this * function is a no-op. */ +PIXMAN_API void pixman_disable_out_of_bounds_workaround (void); /* @@ -957,29 +1202,48 @@ typedef struct const void *glyph; } pixman_glyph_t; +PIXMAN_API pixman_glyph_cache_t *pixman_glyph_cache_create (void); + +PIXMAN_API void pixman_glyph_cache_destroy (pixman_glyph_cache_t *cache); + +PIXMAN_API void pixman_glyph_cache_freeze (pixman_glyph_cache_t *cache); + +PIXMAN_API void pixman_glyph_cache_thaw (pixman_glyph_cache_t *cache); + +PIXMAN_API const void * pixman_glyph_cache_lookup (pixman_glyph_cache_t *cache, void *font_key, void *glyph_key); + +PIXMAN_API const void * pixman_glyph_cache_insert (pixman_glyph_cache_t *cache, void *font_key, void *glyph_key, int origin_x, int origin_y, pixman_image_t *glyph_image); + +PIXMAN_API void pixman_glyph_cache_remove (pixman_glyph_cache_t *cache, void *font_key, void *glyph_key); + +PIXMAN_API void pixman_glyph_get_extents (pixman_glyph_cache_t *cache, int n_glyphs, pixman_glyph_t *glyphs, pixman_box32_t *extents); + +PIXMAN_API pixman_format_code_t pixman_glyph_get_mask_format (pixman_glyph_cache_t *cache, int n_glyphs, const pixman_glyph_t *glyphs); + +PIXMAN_API void pixman_composite_glyphs (pixman_op_t op, pixman_image_t *src, pixman_image_t *dest, @@ -995,6 +1259,8 @@ void pixman_composite_g pixman_glyph_cache_t *cache, int n_glyphs, const pixman_glyph_t *glyphs); + +PIXMAN_API void pixman_composite_glyphs_no_mask (pixman_op_t op, pixman_image_t *src, pixman_image_t *dest, @@ -1062,12 +1328,19 @@ struct pixman_trap pixman_span_fix_t top, bot; }; +PIXMAN_API pixman_fixed_t pixman_sample_ceil_y (pixman_fixed_t y, int bpp); + +PIXMAN_API pixman_fixed_t pixman_sample_floor_y (pixman_fixed_t y, int bpp); + +PIXMAN_API void pixman_edge_step (pixman_edge_t *e, int n); + +PIXMAN_API void pixman_edge_init (pixman_edge_t *e, int bpp, pixman_fixed_t y_start, @@ -1075,31 +1348,43 @@ void pixman_edge_init pixman_fixed_t y_top, pixman_fixed_t x_bot, pixman_fixed_t y_bot); + +PIXMAN_API void pixman_line_fixed_edge_init (pixman_edge_t *e, int bpp, pixman_fixed_t y, const pixman_line_fixed_t *line, int x_off, int y_off); + +PIXMAN_API void pixman_rasterize_edges (pixman_image_t *image, pixman_edge_t *l, pixman_edge_t *r, pixman_fixed_t t, pixman_fixed_t b); + +PIXMAN_API void pixman_add_traps (pixman_image_t *image, int16_t x_off, int16_t y_off, int ntrap, const pixman_trap_t *traps); + +PIXMAN_API void pixman_add_trapezoids (pixman_image_t *image, int16_t x_off, int y_off, int ntraps, const pixman_trapezoid_t *traps); + +PIXMAN_API void pixman_rasterize_trapezoid (pixman_image_t *image, const pixman_trapezoid_t *trap, int x_off, int y_off); + +PIXMAN_API void pixman_composite_trapezoids (pixman_op_t op, pixman_image_t * src, pixman_image_t * dst, @@ -1110,6 +1395,8 @@ void pixman_composite_trapezoid int y_dst, int n_traps, const pixman_trapezoid_t * traps); + +PIXMAN_API void pixman_composite_triangles (pixman_op_t op, pixman_image_t * src, pixman_image_t * dst, @@ -1120,6 +1407,8 @@ void pixman_composite_triangles int y_dst, int n_tris, const pixman_triangle_t * tris); + +PIXMAN_API void pixman_add_triangles (pixman_image_t *image, int32_t x_off, int32_t y_off, Index: xsrc/external/mit/pixman/include/config.h diff -u xsrc/external/mit/pixman/include/config.h:1.23 xsrc/external/mit/pixman/include/config.h:1.24 --- xsrc/external/mit/pixman/include/config.h:1.23 Sat Jun 1 06:44:01 2019 +++ xsrc/external/mit/pixman/include/config.h Sat Nov 12 03:35:26 2022 @@ -92,7 +92,7 @@ #define PACKAGE_NAME "pixman" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "pixman 0.38.4" +#define PACKAGE_STRING "pixman 0.42.2" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "pixman" @@ -104,7 +104,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "0.38.4" +#define PACKAGE_VERSION "0.42.2" /* enable output that can be piped to gnuplot */ /* #undef PIXMAN_GNUPLOT */ @@ -160,7 +160,7 @@ /* #undef USE_X86_MMX */ /* Version number of package */ -#define VERSION "0.38.4" +#define VERSION "0.42.2" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */