Bug 1963705 - Update libpixman to release 0.46.0. r=jfkthame

Differential Revision: https://phabricator.services.mozilla.com/D247432
This commit is contained in:
Ryan VanderMeulen
2025-05-02 13:58:19 +00:00
committed by rvandermeulen@mozilla.com
parent 3234b99b7f
commit 147cebe99e
21 changed files with 3688 additions and 1109 deletions

View File

@@ -58,6 +58,4 @@ pixman-export.patch: make sure pixman symbols are not exported in libxul
pixman-interp.patch: use lower quality interpolation by default on mobile
pixman-neon.patch: fix for a build failure with clang on armhf linux
pixman-rename.patch: include pixman-rename.h for renaming of external symbols

View File

@@ -59,6 +59,35 @@
#define pixman_region32_reset _moz_pixman_region32_reset
#define pixman_region32_clear _moz_pixman_region32_clear
#define pixman_region32_print _moz_pixman_region32_print
#define pixman_region64f_init _moz_pixman_region64f_init
#define pixman_region64f_init_rect _moz_pixman_region64f_init_rect
#define pixman_region64f_init_rectf _moz_pixman_region64f_init_rectf
#define pixman_region64f_init_rects _moz_pixman_region64f_init_rects
#define pixman_region64f_init_with_extents _moz_pixman_region64f_init_with_extents
#define pixman_region64f_init_from_image _moz_pixman_region64f_init_from_image
#define pixman_region64f_fini _moz_pixman_region64f_fini
#define pixman_region64f_translate _moz_pixman_region64f_translate
#define pixman_region64f_copy _moz_pixman_region64f_copy
#define pixman_region64f_intersect _moz_pixman_region64f_intersect
#define pixman_region64f_union _moz_pixman_region64f_union
#define pixman_region64f_intersect_rect _moz_pixman_region64f_intersect_rect
#define pixman_region64f_intersect_rectf _moz_pixman_region64f_intersect_rectf
#define pixman_region64f_union_rect _moz_pixman_region64f_union_rect
#define pixman_region64f_union_rectf _moz_pixman_region64f_union_rectf
#define pixman_region64f_subtract _moz_pixman_region64f_subtract
#define pixman_region64f_inverse _moz_pixman_region64f_inverse
#define pixman_region64f_contains_point _moz_pixman_region64f_contains_point
#define pixman_region64f_contains_rectangle _moz_pixman_region64f_contains_rectangle
#define pixman_region64f_empty _moz_pixman_region64f_empty
#define pixman_region64f_not_empty _moz_pixman_region64f_not_empty
#define pixman_region64f_extents _moz_pixman_region64f_extents
#define pixman_region64f_n_rects _moz_pixman_region64f_n_rects
#define pixman_region64f_rectangles _moz_pixman_region64f_rectangles
#define pixman_region64f_equal _moz_pixman_region64f_equal
#define pixman_region64f_selfcheck _moz_pixman_region64f_selfcheck
#define pixman_region64f_reset _moz_pixman_region64f_reset
#define pixman_region64f_clear _moz_pixman_region64f_clear
#define pixman_region64f_print _moz_pixman_region64f_print
#define pixman_blt _moz_pixman_blt
#define pixman_fill _moz_pixman_fill
#define pixman_transform_point_3d _moz_pixman_transform_point_3d

View File

@@ -97,6 +97,7 @@ pixman_files = files(
'pixman-radial-gradient.c',
'pixman-region16.c',
'pixman-region32.c',
'pixman-region64f.c',
'pixman-riscv.c',
'pixman-solid-fill.c',
'pixman-timer.c',

View File

@@ -34,6 +34,7 @@ SOURCES += [
'pixman-radial-gradient.c',
'pixman-region16.c',
'pixman-region32.c',
'pixman-region64f.c',
'pixman-riscv.c',
'pixman-solid-fill.c',
'pixman-trap.c',

View File

@@ -710,6 +710,36 @@ fetch_scanline_rgbaf_float (bits_image_t *image,
}
#endif
static void
fetch_scanline_a16b16g16r16_float (bits_image_t * image,
int x,
int y,
int width,
uint32_t * b,
const uint32_t *mask)
{
const uint64_t *bits = (uint64_t *)(image->bits + y * image->rowstride);
const uint64_t *pixel = bits + x;
const uint64_t *end = pixel + width;
argb_t *buffer = (argb_t *)b;
while (pixel < end)
{
uint64_t p = READ (image, pixel++);
uint64_t a = (p >> 48) & 0xffff;
uint64_t b = (p >> 32) & 0xffff;
uint64_t g = (p >> 16) & 0xffff;
uint64_t r = (p >> 0) & 0xffff;
buffer->a = pixman_unorm_to_float (a, 16);
buffer->r = pixman_unorm_to_float (r, 16);
buffer->g = pixman_unorm_to_float (g, 16);
buffer->b = pixman_unorm_to_float (b, 16);
buffer++;
}
}
static void
fetch_scanline_x2r10g10b10_float (bits_image_t *image,
int x,
@@ -907,6 +937,27 @@ fetch_pixel_rgbaf_float (bits_image_t *image,
}
#endif
static argb_t
fetch_pixel_a16b16g16r16_float (bits_image_t *image,
int offset,
int line)
{
uint64_t *bits = (uint64_t *)(image->bits + line * image->rowstride);
uint64_t p = READ (image, bits + offset);
uint64_t a = (p >> 48) & 0xffff;
uint64_t b = (p >> 32) & 0xffff;
uint64_t g = (p >> 16) & 0xffff;
uint64_t r = (p >> 0) & 0xffff;
argb_t argb;
argb.a = pixman_unorm_to_float (a, 16);
argb.r = pixman_unorm_to_float (r, 16);
argb.g = pixman_unorm_to_float (g, 16);
argb.b = pixman_unorm_to_float (b, 16);
return argb;
}
static argb_t
fetch_pixel_x2r10g10b10_float (bits_image_t *image,
int offset,
@@ -1121,6 +1172,32 @@ store_scanline_rgbf_float (bits_image_t * image,
}
#endif
static void
store_scanline_a16b16g16r16_float (bits_image_t * image,
int x,
int y,
int width,
const uint32_t *v)
{
uint64_t *bits = (uint64_t *)(image->bits + image->rowstride * y);
uint64_t *pixel = bits + x;
argb_t *values = (argb_t *)v;
int i;
for (i = 0; i < width; ++i)
{
uint64_t a, r, g, b;
a = pixman_float_to_unorm (values[i].a, 16);
r = pixman_float_to_unorm (values[i].r, 16);
g = pixman_float_to_unorm (values[i].g, 16);
b = pixman_float_to_unorm (values[i].b, 16);
WRITE (image, pixel++,
(a << 48) | (b << 32) | (g << 16) | (r << 0));
}
}
static void
store_scanline_a2r10g10b10_float (bits_image_t * image,
int x,
@@ -1633,6 +1710,10 @@ static const format_info_t accessors[] =
fetch_pixel_generic_lossy_32, fetch_pixel_rgbf_float,
NULL, store_scanline_rgbf_float },
#endif
{ PIXMAN_a16b16g16r16,
NULL, fetch_scanline_a16b16g16r16_float,
fetch_pixel_generic_lossy_32, fetch_pixel_a16b16g16r16_float,
NULL, store_scanline_a16b16g16r16_float },
{ PIXMAN_a2r10g10b10,
NULL, fetch_scanline_a2r10g10b10_float,

View File

@@ -305,16 +305,14 @@
mov v28.d[0], v14.d[0]
mov v29.d[0], v14.d[1]
PF ble, 10f
PF lsl, DUMMY, SRC_STRIDE, #src_bpp_shift
PF ldrsb, DUMMY, [PF_SRC, DUMMY]
PF add, PF_SRC, PF_SRC, #1
PF add, PF_SRC, PF_SRC, SRC_STRIDE, lsl #src_bpp_shift
PF ldrsb, DUMMY, [PF_SRC]
10:
raddhn v20.8b, v10.8h, v17.8h
raddhn v23.8b, v11.8h, v19.8h
PF ble, 10f
PF lsl, DUMMY, DST_STRIDE, #dst_bpp_shift
PF ldrsb, DUMMY, [PF_DST, DUMMY]
PF add, PF_DST, PF_SRC, #1
PF add, PF_DST, PF_DST, DST_STRIDE, lsl #dst_bpp_shift
PF ldrsb, DUMMY, [PF_DST]
10:
raddhn v22.8b, v12.8h, v18.8h
st1 {v14.8h}, [DST_W], #16
@@ -497,9 +495,8 @@ generate_composite_function \
ushll v14.8h, v2.8b, #7
sli v14.8h, v14.8h, #1
PF ble, 10f
PF lsl, DUMMY, SRC_STRIDE, #src_bpp_shift
PF ldrsb, DUMMY, [PF_SRC, DUMMY]
PF add, PF_SRC, PF_SRC, #1
PF add, PF_SRC, PF_SRC, SRC_STRIDE, lsl #src_bpp_shift
PF ldrsb, DUMMY, [PF_SRC]
10:
ushll v9.8h, v0.8b, #7
sli v9.8h, v9.8h, #1
@@ -585,12 +582,10 @@ generate_composite_function \
10:
uqadd v28.8b, v0.8b, v4.8b
PF ble, 10f
PF lsl, DUMMY, SRC_STRIDE, #src_bpp_shift
PF ldrsb, DUMMY, [PF_SRC, DUMMY]
PF add, PF_SRC, PF_SRC, #1
PF lsl, DUMMY, DST_STRIDE, #dst_bpp_shift
PF ldrsb, DUMMY, [PF_DST, DUMMY]
PF add, PF_DST, PF_DST, #1
PF add, PF_SRC, PF_SRC, SRC_STRIDE, lsl #src_bpp_shift
PF ldrsb, DUMMY, [PF_SRC]
PF add, PF_DST, PF_DST, DST_STRIDE, lsl #dst_bpp_shift
PF ldrsb, DUMMY, [PF_DST]
10:
uqadd v29.8b, v1.8b, v5.8b
uqadd v30.8b, v2.8b, v6.8b
@@ -631,12 +626,10 @@ generate_composite_function \
10:
uqadd v28.8b, v0.8b, v4.8b
PF ble, 10f
PF lsl, DUMMY, SRC_STRIDE, #src_bpp_shift
PF ldrsb, DUMMY, [PF_SRC, DUMMY]
PF add, PF_SRC, PF_SRC, #1
PF lsl, DUMMY, DST_STRIDE, #dst_bpp_shift
PF ldrsb, DUMMY, [PF_DST, DUMMY]
PF add, PF_DST, PF_DST, #1
PF add, PF_SRC, PF_SRC, SRC_STRIDE, lsl #src_bpp_shift
PF ldrsb, DUMMY, [PF_SRC]
PF add, PF_DST, PF_DST, DST_STRIDE, lsl #dst_bpp_shift
PF ldrsb, DUMMY, [PF_DST]
10:
uqadd v29.8b, v1.8b, v5.8b
uqadd v30.8b, v2.8b, v6.8b
@@ -719,15 +712,13 @@ generate_composite_function_single_scanline \
10:
umull v9.8h, v22.8b, v5.8b
PF ble, 10f
PF lsl, DUMMY, SRC_STRIDE, #src_bpp_shift
PF ldrsb, DUMMY, [PF_SRC, DUMMY]
PF add, PF_SRC, PF_SRC, #1
PF add, PF_SRC, PF_SRC, SRC_STRIDE, lsl #src_bpp_shift
PF ldrsb, DUMMY, [PF_SRC]
10:
umull v10.8h, v22.8b, v6.8b
PF ble, 10f
PF lsl, DUMMY, DST_STRIDE, #dst_bpp_shift
PF ldrsb, DUMMY, [PF_DST, DUMMY]
PF add, PF_DST, PF_DST, #1
PF add, PF_DST, PF_DST, DST_STRIDE, lsl #dst_bpp_shift
PF ldrsb, DUMMY, [PF_DST]
10:
umull v11.8h, v22.8b, v7.8b
.endm
@@ -793,15 +784,13 @@ generate_composite_function_single_scanline \
10:
umull v9.8h, v22.8b, v5.8b
PF ble, 10f
PF lsl, DUMMY, SRC_STRIDE, #src_bpp_shift
PF ldrsb, DUMMY, [PF_SRC, DUMMY]
PF add, PF_SRC, PF_SRC, #1
PF add, PF_SRC, PF_SRC, SRC_STRIDE, lsl #src_bpp_shift
PF ldrsb, DUMMY, [PF_SRC]
10:
umull v10.8h, v22.8b, v6.8b
PF ble, 10f
PF lsl, DUMMY, DST_STRIDE, #dst_bpp_shift
PF ldrsb, DUMMY, [PF_DST, DUMMY]
PF add, PF_DST, PF_DST, #1
PF add, PF_DST, PF_DST, DST_STRIDE, lsl #dst_bpp_shift
PF ldrsb, DUMMY, [PF_DST]
10:
umull v11.8h, v22.8b, v7.8b
.endm
@@ -886,9 +875,8 @@ generate_composite_function_single_scanline \
PF subs, PF_CTL, PF_CTL, #0x10
umull v11.8h, v24.8b, v7.8b
PF ble, 10f
PF lsl, DUMMY, DST_STRIDE, #dst_bpp_shift
PF ldrsb, DUMMY, [PF_DST, DUMMY]
PF add, PF_DST, PF_DST, #1
PF add, PF_DST, PF_DST, DST_STRIDE, lsl #dst_bpp_shift
PF ldrsb, DUMMY, [PF_DST]
10:
st4 {v28.8b, v29.8b, v30.8b, v31.8b}, [DST_W], #32
.endm
@@ -950,9 +938,8 @@ generate_composite_function \
umull v9.8h, v22.8b, v5.8b
umull v10.8h, v22.8b, v6.8b
PF blt, 10f
PF lsl, DUMMY, DST_STRIDE, #dst_bpp_shift
PF ldrsb, DUMMY, [PF_DST, DUMMY]
PF add, PF_DST, PF_DST, #1
PF add, PF_DST, PF_DST, DST_STRIDE, lsl #dst_bpp_shift
PF ldrsb, DUMMY, [PF_DST]
10:
umull v11.8h, v22.8b, v7.8b
.endm
@@ -1436,9 +1423,8 @@ generate_composite_function \
10:
umull v11.8h, v24.8b, v3.8b
PF ble, 10f
PF lsl, DUMMY, MASK_STRIDE, #mask_bpp_shift
PF ldrsb, DUMMY, [PF_MASK, DUMMY]
PF add, PF_MASK, PF_MASK, #1
PF add, PF_MASK, PF_MASK, MASK_STRIDE, lsl #mask_bpp_shift
PF ldrsb, DUMMY, [PF_MASK]
10:
st4 {v28.8b, v29.8b, v30.8b, v31.8b}, [DST_W], #32
ursra v8.8h, v8.8h, #8
@@ -1517,9 +1503,8 @@ generate_composite_function \
10:
umull v3.8h, v27.8b, v16.8b
PF ble, 10f
PF lsl, DUMMY, MASK_STRIDE, #mask_bpp_shift
PF ldrsb, DUMMY, [PF_MASK, DUMMY]
PF add, PF_MASK, PF_MASK, #1
PF add, PF_MASK, PF_MASK, MASK_STRIDE, lsl #mask_bpp_shift
PF ldrsb, DUMMY, [PF_MASK]
10:
st1 {v28.8b, v29.8b, v30.8b, v31.8b}, [DST_W], #32
ursra v0.8h, v0.8h, #8
@@ -1628,15 +1613,13 @@ generate_composite_function \
10:
umull v19.8h, v24.8b, v11.8b
PF ble, 10f
PF lsl, DUMMY, DST_STRIDE, #dst_bpp_shift
PF ldrsb, DUMMY, [PF_DST, DUMMY]
PF add, PF_DST, PF_DST, #1
PF add, PF_DST, PF_DST, DST_STRIDE, lsl #dst_bpp_shift
PF ldrsb, DUMMY, [PF_DST]
10:
uqadd v28.8b, v0.8b, v28.8b
PF ble, 10f
PF lsl, DUMMY, MASK_STRIDE, #mask_bpp_shift
PF ldrsb, DUMMY, [PF_MASK, DUMMY]
PF add, PF_MASK, PF_MASK, #1
PF add, PF_MASK, PF_MASK, MASK_STRIDE, lsl #mask_bpp_shift
PF ldrsb, DUMMY, [PF_MASK]
10:
uqadd v29.8b, v1.8b, v29.8b
uqadd v30.8b, v2.8b, v30.8b
@@ -2699,9 +2682,8 @@ generate_composite_function \
PF sub, PF_X, PF_X, ORIG_W
PF subs, PF_CTL, PF_CTL, #0x10
PF ble, 10f
PF lsl, DUMMY, SRC_STRIDE, #src_bpp_shift
PF ldrsb, DUMMY, [PF_SRC, DUMMY]
PF add, PF_SRC, PF_SRC, #1
PF add, PF_SRC, PF_SRC, SRC_STRIDE, lsl #src_bpp_shift
PF ldrsb, DUMMY, [PF_SRC]
10:
.endm
@@ -2768,9 +2750,8 @@ generate_composite_function \
PF sub, PF_X, PF_X, ORIG_W
PF subs, PF_CTL, PF_CTL, #0x10
PF ble, 10f
PF lsl, DUMMY, SRC_STRIDE, #src_bpp_shift
PF ldrsb, DUMMY, [PF_SRC, DUMMY]
PF add, PF_SRC, PF_SRC, #1
PF add, PF_SRC, PF_SRC, SRC_STRIDE, lsl #src_bpp_shift
PF ldrsb, DUMMY, [PF_SRC]
10:
.endm

View File

@@ -474,25 +474,21 @@
PF lsl, DUMMY, PF_X, #mask_bpp_shift
PF prfm, PREFETCH_MODE, [PF_MASK, DUMMY]
.endif
PF ble, 71f
PF ble, 72f
PF sub, PF_X, PF_X, ORIG_W
PF subs, PF_CTL, PF_CTL, #0x10
71:
PF ble, 72f
.if src_bpp_shift >= 0
PF lsl, DUMMY, SRC_STRIDE, #src_bpp_shift
PF ldrsb, DUMMY, [PF_SRC, DUMMY]
PF add, PF_SRC, PF_SRC, #1
PF add, PF_SRC, PF_SRC, SRC_STRIDE, lsl #src_bpp_shift
PF ldrsb, DUMMY, [PF_SRC]
.endif
.if dst_r_bpp != 0
PF lsl, DUMMY, DST_STRIDE, #dst_bpp_shift
PF ldrsb, DUMMY, [PF_DST, DUMMY]
PF add, PF_DST, PF_DST, #1
PF add, PF_DST, PF_DST, DST_STRIDE, lsl #dst_bpp_shift
PF ldrsb, DUMMY, [PF_DST]
.endif
.if mask_bpp_shift >= 0
PF lsl, DUMMY, MASK_STRIDE, #mask_bpp_shift
PF ldrsb, DUMMY, [PF_MASK, DUMMY]
PF add, PF_MASK, PF_MASK, #1
PF add, PF_MASK, PF_MASK, MASK_STRIDE, lsl #mask_bpp_shift
PF ldrsb, DUMMY, [PF_MASK]
.endif
72:
.endif
@@ -858,8 +854,7 @@
PF mov, PF_DST, DST_R
PF mov, PF_MASK, MASK
/* PF_CTL = \prefetch_distance | ((h - 1) << 4) */
PF lsl, DUMMY, H, #4
PF mov, PF_CTL, DUMMY
PF lsl, PF_CTL, H, #4
PF add, PF_CTL, PF_CTL, #(\prefetch_distance - 0x10)
\init

View File

@@ -391,7 +391,8 @@ box32_intersect (pixman_box32_t *dest,
return dest->x2 > dest->x1 && dest->y2 > dest->y1;
}
#if defined(__GNUC__) && !defined(__x86_64__) && !defined(__amd64__)
#if defined(__GNUC__) && defined(__i386__) && !defined(__x86_64__) && \
!defined(__amd64__)
__attribute__((__force_align_arg_pointer__))
#endif
PIXMAN_EXPORT void
@@ -418,10 +419,10 @@ pixman_composite_glyphs_no_mask (pixman_op_t op,
_pixman_image_validate (src);
_pixman_image_validate (dest);
dest_format = dest->common.extended_format_code;
dest_flags = dest->common.flags;
pixman_region32_init (&region);
if (!_pixman_compute_composite_region32 (
&region,
@@ -452,9 +453,9 @@ pixman_composite_glyphs_no_mask (pixman_op_t op,
glyph_box.y1 = dest_y + glyphs[i].y - glyph->origin_y;
glyph_box.x2 = glyph_box.x1 + glyph->image->bits.width;
glyph_box.y2 = glyph_box.y1 + glyph->image->bits.height;
pbox = pixman_region32_rectangles (&region, &n);
info.mask_image = glyph_img;
while (n--)
@@ -588,7 +589,7 @@ add_glyphs (pixman_glyph_cache_t *cache,
glyph_box.y1 = glyphs[i].y - glyph->origin_y + off_y;
glyph_box.x2 = glyph_box.x1 + glyph->image->bits.width;
glyph_box.y2 = glyph_box.y1 + glyph->image->bits.height;
if (box32_intersect (&composite_box, &glyph_box, &dest_box))
{
int src_x = composite_box.x1 - glyph_box.x1;
@@ -623,7 +624,7 @@ out:
*
* Then (mask_x, mask_y) in the infinite mask and (src_x, src_y) in the source
* image are both aligned with (dest_x, dest_y) in the destination image. Then
* these three images are composited within the
* these three images are composited within the
*
* (dest_x, dest_y, dst_x + width, dst_y + height)
*

View File

@@ -613,6 +613,30 @@ pixman_image_set_clip_region (pixman_image_t * image,
return result;
}
PIXMAN_EXPORT pixman_bool_t
pixman_image_set_clip_region64f (pixman_image_t * image,
const pixman_region64f_t *region)
{
image_common_t *common = (image_common_t *)image;
pixman_bool_t result;
if (region)
{
if ((result = pixman_region32_copy_from_region64f (&common->clip_region, region)))
image->common.have_clip_region = TRUE;
}
else
{
_pixman_image_reset_clip_region (image);
result = TRUE;
}
image_property_changed (image);
return result;
}
PIXMAN_EXPORT void
pixman_image_set_has_client_clip (pixman_image_t *image,
pixman_bool_t client_clip)

View File

@@ -893,6 +893,10 @@ pixman_bool_t
pixman_region32_copy_from_region16 (pixman_region32_t *dst,
const pixman_region16_t *src);
pixman_bool_t
pixman_region32_copy_from_region64f (pixman_region32_t *dst,
const pixman_region64f_t *src);
pixman_bool_t
pixman_region16_copy_from_region32 (pixman_region16_t *dst,
const pixman_region32_t *src);

View File

@@ -346,7 +346,11 @@ PREFIX (_print) (region_type_t *rgn)
rects = PIXREGION_RECTS (rgn);
fprintf (stderr, "num: %d size: %d\n", num, size);
fprintf (stderr, "extents: %d %d %d %d\n",
fprintf (stderr, "extents: "
PRINT_SPECIFIER " "
PRINT_SPECIFIER " "
PRINT_SPECIFIER " "
PRINT_SPECIFIER "\n",
rgn->extents.x1,
rgn->extents.y1,
rgn->extents.x2,
@@ -354,7 +358,10 @@ PREFIX (_print) (region_type_t *rgn)
for (i = 0; i < num; i++)
{
fprintf (stderr, "%d %d %d %d \n",
fprintf (stderr, PRINT_SPECIFIER " "
PRINT_SPECIFIER " "
PRINT_SPECIFIER " "
PRINT_SPECIFIER " \n",
rects[i].x1, rects[i].y1, rects[i].x2, rects[i].y2);
}
@@ -394,6 +401,29 @@ PREFIX (_init_rect) (region_type_t * region,
region->data = NULL;
}
PIXMAN_EXPORT void
PREFIX (_init_rectf) (region_type_t * region,
double x,
double y,
double width,
double height)
{
region->extents.x1 = x;
region->extents.y1 = y;
region->extents.x2 = x + width;
region->extents.y2 = y + height;
if (!GOOD_RECT (&region->extents))
{
if (BAD_RECT (&region->extents))
_pixman_log_error (FUNC, "Invalid rectangle passed");
PREFIX (_init) (region);
return;
}
region->data = NULL;
}
PIXMAN_EXPORT void
PREFIX (_init_with_extents) (region_type_t *region, const box_type_t *extents)
{
@@ -572,7 +602,7 @@ pixman_coalesce (region_type_t * region, /* Region to coalesce */
box_type_t *prev_box; /* Current box in previous band */
box_type_t *cur_box; /* Current box in current band */
int numRects; /* Number rectangles in both bands */
int y2; /* Bottom of current band */
primitive_t y2; /* Bottom of current band */
/*
* Figure out how many rectangles are in the band.
@@ -658,8 +688,8 @@ static inline pixman_bool_t
pixman_region_append_non_o (region_type_t * region,
box_type_t * r,
box_type_t * r_end,
int y1,
int y2)
primitive_t y1,
primitive_t y2)
{
box_type_t *next_rect;
int new_rects;
@@ -741,8 +771,8 @@ typedef pixman_bool_t (*overlap_proc_ptr) (region_type_t *region,
box_type_t * r1_end,
box_type_t * r2,
box_type_t * r2_end,
int y1,
int y2);
primitive_t y1,
primitive_t y2);
static pixman_bool_t
pixman_op (region_type_t * new_reg, /* Place to store result */
@@ -762,8 +792,8 @@ pixman_op (region_type_t * new_reg, /* Place to store result
box_type_t *r2; /* Pointer into 2d region */
box_type_t *r1_end; /* End of 1st region */
box_type_t *r2_end; /* End of 2d region */
int ybot; /* Bottom of intersection */
int ytop; /* Top of intersection */
primitive_t ybot; /* Bottom of intersection */
primitive_t ytop; /* Top of intersection */
region_data_type_t *old_data; /* Old data for new_reg */
int prev_band; /* Index of start of
* previous band in new_reg */
@@ -771,10 +801,10 @@ pixman_op (region_type_t * new_reg, /* Place to store result
* band in new_reg */
box_type_t * r1_band_end; /* End of current band in r1 */
box_type_t * r2_band_end; /* End of current band in r2 */
int top; /* Top of non-overlapping band */
int bot; /* Bottom of non-overlapping band*/
int r1y1; /* Temps for r1->y1 and r2->y1 */
int r2y1;
primitive_t top; /* Top of non-overlapping band */
primitive_t bot; /* Bottom of non-overlapping band*/
primitive_t r1y1; /* Temps for r1->y1 and r2->y1 */
primitive_t r2y1;
int new_size;
int numRects;
@@ -1110,11 +1140,11 @@ pixman_region_intersect_o (region_type_t *region,
box_type_t * r1_end,
box_type_t * r2,
box_type_t * r2_end,
int y1,
int y2)
primitive_t y1,
primitive_t y2)
{
int x1;
int x2;
primitive_t x1;
primitive_t x2;
box_type_t * next_rect;
next_rect = PIXREGION_TOP (region);
@@ -1262,12 +1292,12 @@ pixman_region_union_o (region_type_t *region,
box_type_t * r1_end,
box_type_t * r2,
box_type_t * r2_end,
int y1,
int y2)
primitive_t y1,
primitive_t y2)
{
box_type_t *next_rect;
int x1; /* left and right side of current union */
int x2;
primitive_t x1; /* left and right side of current union */
primitive_t x2;
critical_if_fail (y1 < y2);
critical_if_fail (r1 != r1_end && r2 != r2_end);
@@ -1337,6 +1367,24 @@ PREFIX(_intersect_rect) (region_type_t *dest,
return PREFIX(_intersect) (dest, source, &region);
}
PIXMAN_EXPORT pixman_bool_t
PREFIX(_intersect_rectf) (region_type_t *dest,
const region_type_t *source,
double x, double y,
double width,
double height)
{
region_type_t region;
region.data = NULL;
region.extents.x1 = x;
region.extents.y1 = y;
region.extents.x2 = x + width;
region.extents.y2 = y + height;
return PREFIX(_intersect) (dest, source, &region);
}
/* Convenience function for performing union of region with a
* single rectangle
*/
@@ -1367,6 +1415,33 @@ PREFIX (_union_rect) (region_type_t *dest,
return PREFIX (_union) (dest, source, &region);
}
PIXMAN_EXPORT pixman_bool_t
PREFIX (_union_rectf) (region_type_t *dest,
const region_type_t *source,
double x,
double y,
double width,
double height)
{
region_type_t region;
region.extents.x1 = x;
region.extents.y1 = y;
region.extents.x2 = x + width;
region.extents.y2 = y + height;
if (!GOOD_RECT (&region.extents))
{
if (BAD_RECT (&region.extents))
_pixman_log_error (FUNC, "Invalid rectangle passed");
return PREFIX (_copy) (dest, source);
}
region.data = NULL;
return PREFIX (_union) (dest, source, &region);
}
PIXMAN_EXPORT pixman_bool_t
PREFIX (_union) (region_type_t * new_reg,
const region_type_t *reg1,
@@ -1467,8 +1542,8 @@ quick_sort_rects (
box_type_t rects[],
int numRects)
{
int y1;
int x1;
primitive_t y1;
primitive_t x1;
int i, j;
box_type_t *r;
@@ -1833,11 +1908,11 @@ pixman_region_subtract_o (region_type_t * region,
box_type_t * r1_end,
box_type_t * r2,
box_type_t * r2_end,
int y1,
int y2)
primitive_t y1,
primitive_t y2)
{
box_type_t * next_rect;
int x1;
primitive_t x1;
x1 = r1->x1;
@@ -2066,7 +2141,7 @@ PREFIX (_inverse) (region_type_t * new_reg, /* Destination region */
* Return @end if no such box exists.
*/
static box_type_t *
find_box_for_y (box_type_t *begin, box_type_t *end, int y)
find_box_for_y (box_type_t *begin, box_type_t *end, primitive_t y)
{
box_type_t *mid;
@@ -2120,7 +2195,7 @@ PREFIX (_contains_rectangle) (const region_type_t * region,
box_type_t * pbox_end;
int part_in, part_out;
int numRects;
int x, y;
primitive_t x, y;
GOOD (region);
@@ -2571,8 +2646,8 @@ static inline box_type_t *
bitmap_addrect (region_type_t *reg,
box_type_t *r,
box_type_t **first_rect,
int rx1, int ry1,
int rx2, int ry2)
primitive_t rx1, primitive_t ry1,
primitive_t rx2, primitive_t ry2)
{
if ((rx1 < rx2) && (ry1 < ry2) &&
(!(reg->data->numRects &&

View File

@@ -35,6 +35,7 @@
typedef pixman_box16_t box_type_t;
typedef pixman_region16_data_t region_data_type_t;
typedef pixman_region16_t region_type_t;
typedef int primitive_t;
typedef int32_t overflow_int_t;
typedef struct {
@@ -46,6 +47,8 @@ typedef struct {
#define PIXMAN_REGION_MAX INT16_MAX
#define PIXMAN_REGION_MIN INT16_MIN
#define PRINT_SPECIFIER "%d"
#include "pixman-region.c"
/* This function exists only to make it possible to preserve the X ABI -

View File

@@ -33,6 +33,7 @@
typedef pixman_box32_t box_type_t;
typedef pixman_region32_data_t region_data_type_t;
typedef pixman_region32_t region_type_t;
typedef int primitive_t;
typedef int64_t overflow_int_t;
typedef struct {
@@ -44,4 +45,6 @@ typedef struct {
#define PIXMAN_REGION_MAX INT32_MAX
#define PIXMAN_REGION_MIN INT32_MIN
#define PRINT_SPECIFIER "%d"
#include "pixman-region.c"

View File

@@ -0,0 +1,50 @@
/*
* Copyright © 2008 Red Hat, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software
* and its documentation for any purpose is hereby granted without
* fee, provided that the above copyright notice appear in all copies
* and that both that copyright notice and this permission notice
* appear in supporting documentation, and that the name of
* Red Hat, Inc. not be used in advertising or publicity pertaining to
* distribution of the software without specific, written prior
* permission. Red Hat, Inc. makes no representations about the
* suitability of this software for any purpose. It is provided "as
* is" without express or implied warranty.
*
* RED HAT, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL RED HAT, INC. BE LIABLE FOR ANY SPECIAL,
* INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
* RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Author: Soren Sandmann <sandmann@redhat.com>
*/
#ifdef HAVE_CONFIG_H
#include <pixman-config.h>
#endif
#include "pixman-private.h"
#include <stdlib.h>
typedef pixman_box64f_t box_type_t;
typedef pixman_region64f_data_t region_data_type_t;
typedef pixman_region64f_t region_type_t;
typedef double primitive_t;
typedef int64_t overflow_int_t;
typedef struct {
double x, y;
} point_type_t;
#define PREFIX(x) pixman_region64f##x
#define PIXMAN_REGION_MAX INT32_MAX
#define PIXMAN_REGION_MIN INT32_MIN
#define PRINT_SPECIFIER "%f"
#include "pixman-region.c"

File diff suppressed because it is too large Load Diff

View File

@@ -303,6 +303,43 @@ pixman_region32_copy_from_region16 (pixman_region32_t *dst,
return retval;
}
pixman_bool_t
pixman_region32_copy_from_region64f (pixman_region32_t *dst,
const pixman_region64f_t *src)
{
int n_boxes, i;
pixman_box64f_t *boxes64f;
pixman_box32_t *boxes32;
pixman_box32_t tmp_boxes[N_TMP_BOXES];
pixman_bool_t retval;
boxes64f = pixman_region64f_rectangles (src, &n_boxes);
if (n_boxes > N_TMP_BOXES)
boxes32 = pixman_malloc_ab (n_boxes, sizeof (pixman_box32_t));
else
boxes32 = tmp_boxes;
if (!boxes32)
return FALSE;
for (i = 0; i < n_boxes; ++i)
{
boxes32[i].x1 = boxes64f[i].x1;
boxes32[i].y1 = boxes64f[i].y1;
boxes32[i].x2 = boxes64f[i].x2;
boxes32[i].y2 = boxes64f[i].y2;
}
pixman_region32_fini (dst);
retval = pixman_region32_init_rects (dst, boxes32, n_boxes);
if (boxes32 != tmp_boxes)
free (boxes32);
return retval;
}
/* This function is exported for the sake of the test suite and not part
* of the ABI.
*/

View File

@@ -32,10 +32,10 @@
#endif
#define PIXMAN_VERSION_MAJOR 0
#define PIXMAN_VERSION_MINOR 44
#define PIXMAN_VERSION_MICRO 2
#define PIXMAN_VERSION_MINOR 46
#define PIXMAN_VERSION_MICRO 0
#define PIXMAN_VERSION_STRING "0.44.2"
#define PIXMAN_VERSION_STRING "0.46.0"
#define PIXMAN_VERSION_ENCODE(major, minor, micro) ( \
((major) * 10000) \

File diff suppressed because it is too large Load Diff

View File

@@ -739,6 +739,24 @@ pixman_image_composite (pixman_op_t op,
mask_x, mask_y, dest_x, dest_y, width, height);
}
PIXMAN_EXPORT void
pixman_image_composite64f (pixman_op_t op,
pixman_image_t * src,
pixman_image_t * mask,
pixman_image_t * dest,
double src_x,
double src_y,
double mask_x,
double mask_y,
double dest_x,
double dest_y,
double width,
double height)
{
pixman_image_composite32 (op, src, mask, dest, src_x, src_y,
mask_x, mask_y, dest_x, dest_y, width, height);
}
PIXMAN_EXPORT pixman_bool_t
pixman_blt (uint32_t *src_bits,
uint32_t *dst_bits,
@@ -854,7 +872,7 @@ pixman_image_fill_rectangles (pixman_op_t op,
int n_rects,
const pixman_rectangle16_t *rects)
{
pixman_box32_t stack_boxes[6];
pixman_box32_t stack_boxes[6] = {0};
pixman_box32_t *boxes;
pixman_bool_t result;
int i;

View File

@@ -758,6 +758,173 @@ void pixman_region32_reset (pixman_region32_t
PIXMAN_API
void pixman_region32_clear (pixman_region32_t *region);
/*
* 64 bit fractional regions
*/
typedef struct pixman_region64f_data pixman_region64f_data_t;
typedef struct pixman_box64f pixman_box64f_t;
typedef struct pixman_rectangle64f pixman_rectangle64f_t;
typedef struct pixman_region64f pixman_region64f_t;
struct pixman_region64f_data {
long size;
long numRects;
/* pixman_box64f_t rects[size]; in memory but not explicitly declared */
};
struct pixman_rectangle64f
{
double x, y;
double width, height;
};
struct pixman_box64f
{
double x1, y1, x2, y2;
};
struct pixman_region64f
{
pixman_box64f_t extents;
pixman_region64f_data_t *data;
};
/* creation/destruction */
PIXMAN_API
void pixman_region64f_init (pixman_region64f_t *region);
PIXMAN_API
void pixman_region64f_init_rect (pixman_region64f_t *region,
int x,
int y,
unsigned int width,
unsigned int height);
PIXMAN_API
void pixman_region64f_init_rectf (pixman_region64f_t *region,
double x,
double y,
double width,
double height);
PIXMAN_API
pixman_bool_t pixman_region64f_init_rects (pixman_region64f_t *region,
const pixman_box64f_t *boxes,
int count);
PIXMAN_API
void pixman_region64f_init_with_extents (pixman_region64f_t *region,
const pixman_box64f_t *extents);
PIXMAN_API
void pixman_region64f_init_from_image (pixman_region64f_t *region,
pixman_image_t *image);
PIXMAN_API
void pixman_region64f_fini (pixman_region64f_t *region);
/* manipulation */
PIXMAN_API
void pixman_region64f_translate (pixman_region64f_t *region,
int x,
int y);
PIXMAN_API
pixman_bool_t pixman_region64f_copy (pixman_region64f_t *dest,
const pixman_region64f_t *source);
PIXMAN_API
pixman_bool_t pixman_region64f_intersect (pixman_region64f_t *new_reg,
const pixman_region64f_t *reg1,
const pixman_region64f_t *reg2);
PIXMAN_API
pixman_bool_t pixman_region64f_union (pixman_region64f_t *new_reg,
const pixman_region64f_t *reg1,
const pixman_region64f_t *reg2);
PIXMAN_API
pixman_bool_t pixman_region64f_intersect_rect (pixman_region64f_t *dest,
const pixman_region64f_t *source,
int x,
int y,
unsigned int width,
unsigned int height);
PIXMAN_API
pixman_bool_t pixman_region64f_intersect_rectf (pixman_region64f_t *dest,
const pixman_region64f_t *source,
double x,
double y,
double width,
double height);
PIXMAN_API
pixman_bool_t pixman_region64f_union_rect (pixman_region64f_t *dest,
const pixman_region64f_t *source,
int x,
int y,
unsigned int width,
unsigned int height);
PIXMAN_API
pixman_bool_t pixman_region64f_union_rectf (pixman_region64f_t *dest,
const pixman_region64f_t *source,
double x,
double y,
double width,
double height);
PIXMAN_API
pixman_bool_t pixman_region64f_subtract (pixman_region64f_t *reg_d,
const pixman_region64f_t *reg_m,
const pixman_region64f_t *reg_s);
PIXMAN_API
pixman_bool_t pixman_region64f_inverse (pixman_region64f_t *new_reg,
const pixman_region64f_t *reg1,
const pixman_box64f_t *inv_rect);
PIXMAN_API
pixman_bool_t pixman_region64f_contains_point (const pixman_region64f_t *region,
int x,
int y,
pixman_box64f_t *box);
PIXMAN_API
pixman_region_overlap_t pixman_region64f_contains_rectangle(const pixman_region64f_t *region,
const pixman_box64f_t *prect);
PIXMAN_API
pixman_bool_t pixman_region64f_empty (const pixman_region64f_t *region);
PIXMAN_API
pixman_bool_t pixman_region64f_not_empty (const pixman_region64f_t *region);
PIXMAN_API
pixman_box64f_t * pixman_region64f_extents (const pixman_region64f_t *region);
PIXMAN_API
int pixman_region64f_n_rects (const pixman_region64f_t *region);
PIXMAN_API
pixman_box64f_t * pixman_region64f_rectangles (const pixman_region64f_t *region,
int *n_rects);
PIXMAN_API
pixman_bool_t pixman_region64f_equal (const pixman_region64f_t *region1,
const pixman_region64f_t *region2);
PIXMAN_API
pixman_bool_t pixman_region64f_selfcheck (pixman_region64f_t *region);
PIXMAN_API
void pixman_region64f_reset (pixman_region64f_t *region,
const pixman_box64f_t *box);
PIXMAN_API
void pixman_region64f_clear (pixman_region64f_t *region);
/* Copy / Fill / Misc */
@@ -884,6 +1051,10 @@ typedef enum {
/* 96bpp formats */
PIXMAN_rgb_float = PIXMAN_FORMAT_BYTE(96,PIXMAN_TYPE_RGBA_FLOAT,0,32,32,32),
/* 64bpp formats */
/* [63:0] A:B:G:R 16:16:16:16 native endian */
PIXMAN_a16b16g16r16 = PIXMAN_FORMAT_BYTE(64,PIXMAN_TYPE_ABGR,16,16,16,16),
/* 32bpp formats */
PIXMAN_a8r8g8b8 = PIXMAN_FORMAT(32,PIXMAN_TYPE_ARGB,8,8,8,8),
PIXMAN_x8r8g8b8 = PIXMAN_FORMAT(32,PIXMAN_TYPE_ARGB,0,8,8,8),
@@ -1025,6 +1196,10 @@ PIXMAN_API
pixman_bool_t pixman_image_set_clip_region32 (pixman_image_t *image,
const pixman_region32_t *region);
PIXMAN_API
pixman_bool_t pixman_image_set_clip_region64f (pixman_image_t *image,
const pixman_region64f_t *region);
PIXMAN_API
void pixman_image_set_has_client_clip (pixman_image_t *image,
pixman_bool_t clien_clip);
@@ -1181,6 +1356,20 @@ void pixman_image_composite32 (pixman_op_t op,
int32_t width,
int32_t height);
PIXMAN_API
void pixman_image_composite64f (pixman_op_t op,
pixman_image_t *src,
pixman_image_t *mask,
pixman_image_t *dest,
double src_x,
double src_y,
double mask_x,
double mask_y,
double dest_x,
double dest_y,
double width,
double height);
/* Executive Summary: This function is a no-op that only exists
* for historical reasons.
*

View File

@@ -1,30 +0,0 @@
diff --git a/gfx/cairo/libpixman/src/pixman-arm-neon-asm-bilinear.S b/gfx/cairo/libpixman/src/pixman-arm-neon-asm-bilinear.S
index 6bd27360aa027..cd33babca1e0c 100644
--- a/gfx/cairo/libpixman/src/pixman-arm-neon-asm-bilinear.S
+++ b/gfx/cairo/libpixman/src/pixman-arm-neon-asm-bilinear.S
@@ -55,9 +55,9 @@
#endif
.text
-.fpu neon
.arch armv7a
.object_arch armv4
+.fpu neon
.eabi_attribute 10, 0
.eabi_attribute 12, 0
.arm
diff --git a/gfx/cairo/libpixman/src/pixman-arm-neon-asm.S b/gfx/cairo/libpixman/src/pixman-arm-neon-asm.S
index 0e092577f1c73..c04b335d1e5bd 100644
--- a/gfx/cairo/libpixman/src/pixman-arm-neon-asm.S
+++ b/gfx/cairo/libpixman/src/pixman-arm-neon-asm.S
@@ -40,9 +40,9 @@
#endif
.text
- .fpu neon
.arch armv7a
.object_arch armv4
+ .fpu neon
.eabi_attribute 10, 0 /* suppress Tag_FP_arch */
.eabi_attribute 12, 0 /* suppress Tag_Advanced_SIMD_arch */
.arm