зеркало из https://github.com/mozilla/gecko-dev.git
Bug 836171. Update pixman to 0.27.4
Andrea Canciani (2): mmx: Fix x86 build on MSVC build: Improve win32 build system Benny Siegert (1): configure.ac: PIXMAN_LINK_WITH_ENV fix Matt Turner (3): build: Remove useless DEP_CFLAGS/DEP_LIBS variables sse2: mark pack_565_2x128_128 as static force_inline iwmmxt: Don't define dummy _mm_empty for >=gcc-4.8 Nemanja Lukic (7): MIPS: DSPr2: Added fast-paths for OVER operation: - over_8888_n_8888 - over_8888_8_8888 MIPS: DSPr2: Added fast-paths for OVER operation: - over_8888_n_0565 - over_8888_8_0565 MIPS: DSPr2: Added fast-paths for OVER operation: - over_0565_n_0565 - over_0565_8_0565 MIPS: DSPr2: Added OVER combiner and two new fast paths: - over_8888_8888 - over_8888_8888_8888 MIPS: DSPr2: Added fast-paths for ADD operation: - add_n_8_8 - add_n_8_8888 - add_8_8_8 MIPS: DSPr2: Added more fast-paths for ADD operation: - add_0565_8_0565 - add_8888_8_8888 - add_8888_n_8888 MIPS: DSPr2: Added more fast-paths for ADD operation: - add_8888_8888_8888 - add_8_8 - add_8888_8888 Siarhei Siamashka (4): Add scaled nearest repeat fast paths MIPS: skip runtime detection for DSPr2 if -mdspr2 option is in CFLAGS Add missing force_inline to in() function used for C fast paths Workaround for FTBFS with gcc 4.6 (http://gcc.gnu.org/PR54965) Søren Sandmann Pedersen (44): Post-release version bump to 0.27.3 Define TIMER_BEGIN and TIMER_END even when timers are not enabled Make show_image() cope with more formats demos: Add srgb_trap_test.c Remove pointless declaration of _pixman_image_get_scanline_generic_64() Remove obsolete TODO file pixel_checker: Move sRGB conversion into get_limits() test/utils.c: Use pow(), not powf() in sRGB conversion routines implementation: Write lookup_combiner() in a less convoluted way. Move blt delegation into pixman-implementation.c Move fill delegation into pixman-implementation.c Move delegation of src/dest iter init into pixman-implementation.c Rename _pixman_lookup_composite_function() to _pixman_implementation_lookup_composite() _pixman_implementation_create(): Initialize implementation with memset() implementation: Rename delegate to fallback Add PIXMAN_x8b8g8r8 and PIXMAN_a8b8g8r8 formats to scaling-test Fix bug in fast_composite_scaled_nearest() Fix bugs in component alpha combiners for separable PDF operators Add rotate-test.c test program Fix bugs in pixman-image.c pixman-combine.c.template: Formatting clean-ups affine-test: Print out the transformation matrix when verbose test: Add inifinite-loop test Fix for infinite-loop test rotate-test: Call image_endian_swap() in make_image() Make pixman.h more const-correct glyph-test: Prepare for floating point blitters-test: Prepare for floating point Add pixman-combine-float.c Add combiner test pixman-utils.c, pixman-private.h: Add floating point conversion routines pixman-access.c: Add floating point accessor functions Switch the wide pipeline over to using floating point Remove 64 bit pipeline Don't auto-generate pixman-combine32.[ch] anymore Speed up pixman_expand_to_float() Remove BUILT_SOURCES Only regard images as pixbufs if they have identity transformations region: Formatting fix region: Remove overlap argument from pixman_op() Add new pixman_image_create_bits_no_clear() API pixman_composite_trapezoids(): Factor out extents computation pixman_composite_trapezoids(): don't clip to extents for some operators Pre-release version bump to 0.27.4 --HG-- extra : rebase_source : ed5b5f0184dd19b2ae5caa43edee6effce14efaf
This commit is contained in:
Родитель
c57b79e341
Коммит
9142ba12cb
|
@ -88,7 +88,7 @@ CSRCS = \
|
|||
pixman.c \
|
||||
pixman-combine16.c \
|
||||
pixman-combine32.c \
|
||||
pixman-combine64.c \
|
||||
pixman-combine-float.c \
|
||||
pixman-conical-gradient.c \
|
||||
pixman-edge.c \
|
||||
pixman-edge-accessors.c \
|
||||
|
@ -107,7 +107,6 @@ CSRCS = \
|
|||
pixman-region16.c \
|
||||
pixman-region32.c \
|
||||
pixman-solid-fill.c \
|
||||
pixman-srgb.c \
|
||||
pixman-trap.c \
|
||||
pixman-utils.c \
|
||||
pixman-x86.c \
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -200,14 +200,15 @@ pixman_composite_src_n_8888_asm_neon (int32_t w,
|
|||
uint32_t src);
|
||||
|
||||
static pixman_bool_t
|
||||
pixman_fill_neon (uint32_t *bits,
|
||||
int stride,
|
||||
int bpp,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height,
|
||||
uint32_t _xor)
|
||||
arm_neon_fill (pixman_implementation_t *imp,
|
||||
uint32_t * bits,
|
||||
int stride,
|
||||
int bpp,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height,
|
||||
uint32_t _xor)
|
||||
{
|
||||
/* stride is always multiple of 32bit units in pixman */
|
||||
uint32_t byte_stride = stride * sizeof(uint32_t);
|
||||
|
@ -244,18 +245,19 @@ pixman_fill_neon (uint32_t *bits,
|
|||
}
|
||||
|
||||
static pixman_bool_t
|
||||
pixman_blt_neon (uint32_t *src_bits,
|
||||
uint32_t *dst_bits,
|
||||
int src_stride,
|
||||
int dst_stride,
|
||||
int src_bpp,
|
||||
int dst_bpp,
|
||||
int src_x,
|
||||
int src_y,
|
||||
int dest_x,
|
||||
int dest_y,
|
||||
int width,
|
||||
int height)
|
||||
arm_neon_blt (pixman_implementation_t *imp,
|
||||
uint32_t * src_bits,
|
||||
uint32_t * dst_bits,
|
||||
int src_stride,
|
||||
int dst_stride,
|
||||
int src_bpp,
|
||||
int dst_bpp,
|
||||
int src_x,
|
||||
int src_y,
|
||||
int dest_x,
|
||||
int dest_y,
|
||||
int width,
|
||||
int height)
|
||||
{
|
||||
if (src_bpp != dst_bpp)
|
||||
return FALSE;
|
||||
|
@ -463,53 +465,6 @@ static const pixman_fast_path_t arm_neon_fast_paths[] =
|
|||
{ PIXMAN_OP_NONE },
|
||||
};
|
||||
|
||||
static pixman_bool_t
|
||||
arm_neon_blt (pixman_implementation_t *imp,
|
||||
uint32_t * src_bits,
|
||||
uint32_t * dst_bits,
|
||||
int src_stride,
|
||||
int dst_stride,
|
||||
int src_bpp,
|
||||
int dst_bpp,
|
||||
int src_x,
|
||||
int src_y,
|
||||
int dest_x,
|
||||
int dest_y,
|
||||
int width,
|
||||
int height)
|
||||
{
|
||||
if (!pixman_blt_neon (
|
||||
src_bits, dst_bits, src_stride, dst_stride, src_bpp, dst_bpp,
|
||||
src_x, src_y, dest_x, dest_y, width, height))
|
||||
|
||||
{
|
||||
return _pixman_implementation_blt (
|
||||
imp->delegate,
|
||||
src_bits, dst_bits, src_stride, dst_stride, src_bpp, dst_bpp,
|
||||
src_x, src_y, dest_x, dest_y, width, height);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static pixman_bool_t
|
||||
arm_neon_fill (pixman_implementation_t *imp,
|
||||
uint32_t * bits,
|
||||
int stride,
|
||||
int bpp,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height,
|
||||
uint32_t xor)
|
||||
{
|
||||
if (pixman_fill_neon (bits, stride, bpp, x, y, width, height, xor))
|
||||
return TRUE;
|
||||
|
||||
return _pixman_implementation_fill (
|
||||
imp->delegate, bits, stride, bpp, x, y, width, height, xor);
|
||||
}
|
||||
|
||||
#define BIND_COMBINE_U(name) \
|
||||
void \
|
||||
pixman_composite_scanline_##name##_mask_asm_neon (int32_t w, \
|
||||
|
|
|
@ -36,43 +36,18 @@
|
|||
#include "pixman-combine32.h"
|
||||
#include "pixman-inlines.h"
|
||||
|
||||
/*
|
||||
* By default, just evaluate the image at 32bpp and expand. Individual image
|
||||
* types can plug in a better scanline getter if they want to. For example
|
||||
* we could produce smoother gradients by evaluating them at higher color
|
||||
* depth, but that's a project for the future.
|
||||
*/
|
||||
static uint32_t *
|
||||
_pixman_image_get_scanline_generic_64 (pixman_iter_t * iter,
|
||||
const uint32_t *mask)
|
||||
_pixman_image_get_scanline_generic_float (pixman_iter_t * iter,
|
||||
const uint32_t *mask)
|
||||
{
|
||||
int width = iter->width;
|
||||
uint32_t * buffer = iter->buffer;
|
||||
|
||||
pixman_iter_get_scanline_t fetch_32 = iter->data;
|
||||
uint32_t *mask8 = NULL;
|
||||
uint32_t *buffer = iter->buffer;
|
||||
|
||||
/* Contract the mask image, if one exists, so that the 32-bit fetch
|
||||
* function can use it.
|
||||
*/
|
||||
if (mask)
|
||||
{
|
||||
mask8 = pixman_malloc_ab (width, sizeof(uint32_t));
|
||||
if (!mask8)
|
||||
return buffer;
|
||||
fetch_32 (iter, NULL);
|
||||
|
||||
pixman_contract (mask8, (uint64_t *)mask, width);
|
||||
}
|
||||
pixman_expand_to_float ((argb_t *)buffer, buffer, PIXMAN_a8r8g8b8, iter->width);
|
||||
|
||||
/* Fetch the source image into the first half of buffer. */
|
||||
fetch_32 (iter, mask8);
|
||||
|
||||
/* Expand from 32bpp to 64bpp in place. */
|
||||
pixman_expand ((uint64_t *)buffer, buffer, PIXMAN_a8r8g8b8, width);
|
||||
|
||||
free (mask8);
|
||||
|
||||
return buffer;
|
||||
return iter->buffer;
|
||||
}
|
||||
|
||||
/* Fetch functions */
|
||||
|
@ -965,17 +940,17 @@ replicate_pixel_32 (bits_image_t * bits,
|
|||
}
|
||||
|
||||
static void
|
||||
replicate_pixel_64 (bits_image_t * bits,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
uint32_t * b)
|
||||
replicate_pixel_float (bits_image_t * bits,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
uint32_t * b)
|
||||
{
|
||||
uint64_t color;
|
||||
uint64_t *buffer = (uint64_t *)b;
|
||||
uint64_t *end;
|
||||
argb_t color;
|
||||
argb_t *buffer = (argb_t *)b;
|
||||
argb_t *end;
|
||||
|
||||
color = bits->fetch_pixel_64 (bits, x, y);
|
||||
color = bits->fetch_pixel_float (bits, x, y);
|
||||
|
||||
end = buffer + width;
|
||||
while (buffer < end)
|
||||
|
@ -994,7 +969,7 @@ bits_image_fetch_untransformed_repeat_none (bits_image_t *image,
|
|||
|
||||
if (y < 0 || y >= image->height)
|
||||
{
|
||||
memset (buffer, 0, width * (wide? 8 : 4));
|
||||
memset (buffer, 0, width * (wide? sizeof (argb_t) : 4));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1002,10 +977,10 @@ bits_image_fetch_untransformed_repeat_none (bits_image_t *image,
|
|||
{
|
||||
w = MIN (width, -x);
|
||||
|
||||
memset (buffer, 0, w * (wide ? 8 : 4));
|
||||
memset (buffer, 0, w * (wide ? sizeof (argb_t) : 4));
|
||||
|
||||
width -= w;
|
||||
buffer += w * (wide? 2 : 1);
|
||||
buffer += w * (wide? 4 : 1);
|
||||
x += w;
|
||||
}
|
||||
|
||||
|
@ -1014,16 +989,16 @@ bits_image_fetch_untransformed_repeat_none (bits_image_t *image,
|
|||
w = MIN (width, image->width - x);
|
||||
|
||||
if (wide)
|
||||
image->fetch_scanline_64 ((pixman_image_t *)image, x, y, w, buffer, NULL);
|
||||
image->fetch_scanline_float ((pixman_image_t *)image, x, y, w, buffer, NULL);
|
||||
else
|
||||
image->fetch_scanline_32 ((pixman_image_t *)image, x, y, w, buffer, NULL);
|
||||
|
||||
width -= w;
|
||||
buffer += w * (wide? 2 : 1);
|
||||
buffer += w * (wide? 4 : 1);
|
||||
x += w;
|
||||
}
|
||||
|
||||
memset (buffer, 0, width * (wide ? 8 : 4));
|
||||
memset (buffer, 0, width * (wide ? sizeof (argb_t) : 4));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1045,7 +1020,7 @@ bits_image_fetch_untransformed_repeat_normal (bits_image_t *image,
|
|||
if (image->width == 1)
|
||||
{
|
||||
if (wide)
|
||||
replicate_pixel_64 (image, 0, y, width, buffer);
|
||||
replicate_pixel_float (image, 0, y, width, buffer);
|
||||
else
|
||||
replicate_pixel_32 (image, 0, y, width, buffer);
|
||||
|
||||
|
@ -1062,11 +1037,11 @@ bits_image_fetch_untransformed_repeat_normal (bits_image_t *image,
|
|||
w = MIN (width, image->width - x);
|
||||
|
||||
if (wide)
|
||||
image->fetch_scanline_64 ((pixman_image_t *)image, x, y, w, buffer, NULL);
|
||||
image->fetch_scanline_float ((pixman_image_t *)image, x, y, w, buffer, NULL);
|
||||
else
|
||||
image->fetch_scanline_32 ((pixman_image_t *)image, x, y, w, buffer, NULL);
|
||||
|
||||
buffer += w * (wide? 2 : 1);
|
||||
buffer += w * (wide? 4 : 1);
|
||||
x += w;
|
||||
width -= w;
|
||||
}
|
||||
|
@ -1098,9 +1073,8 @@ bits_image_fetch_untransformed_32 (pixman_iter_t * iter,
|
|||
}
|
||||
|
||||
static uint32_t *
|
||||
bits_image_fetch_untransformed_64 (pixman_iter_t * iter,
|
||||
const uint32_t *mask)
|
||||
|
||||
bits_image_fetch_untransformed_float (pixman_iter_t * iter,
|
||||
const uint32_t *mask)
|
||||
{
|
||||
pixman_image_t *image = iter->image;
|
||||
int x = iter->x;
|
||||
|
@ -1123,16 +1097,12 @@ bits_image_fetch_untransformed_64 (pixman_iter_t * iter,
|
|||
return buffer;
|
||||
}
|
||||
|
||||
static uint32_t *
|
||||
_pixman_image_get_scanline_generic_64 (pixman_iter_t *iter,
|
||||
const uint32_t * mask);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
pixman_format_code_t format;
|
||||
uint32_t flags;
|
||||
pixman_iter_get_scanline_t get_scanline_32;
|
||||
pixman_iter_get_scanline_t get_scanline_64;
|
||||
pixman_iter_get_scanline_t get_scanline_float;
|
||||
} fetcher_info_t;
|
||||
|
||||
static const fetcher_info_t fetcher_info[] =
|
||||
|
@ -1144,7 +1114,7 @@ static const fetcher_info_t fetcher_info[] =
|
|||
FAST_PATH_NO_PAD_REPEAT |
|
||||
FAST_PATH_NO_REFLECT_REPEAT),
|
||||
bits_image_fetch_untransformed_32,
|
||||
bits_image_fetch_untransformed_64
|
||||
bits_image_fetch_untransformed_float
|
||||
},
|
||||
|
||||
#define FAST_BILINEAR_FLAGS \
|
||||
|
@ -1160,13 +1130,13 @@ static const fetcher_info_t fetcher_info[] =
|
|||
{ PIXMAN_a8r8g8b8,
|
||||
FAST_BILINEAR_FLAGS,
|
||||
bits_image_fetch_bilinear_no_repeat_8888,
|
||||
_pixman_image_get_scanline_generic_64
|
||||
_pixman_image_get_scanline_generic_float
|
||||
},
|
||||
|
||||
{ PIXMAN_x8r8g8b8,
|
||||
FAST_BILINEAR_FLAGS,
|
||||
bits_image_fetch_bilinear_no_repeat_8888,
|
||||
_pixman_image_get_scanline_generic_64
|
||||
_pixman_image_get_scanline_generic_float
|
||||
},
|
||||
|
||||
#define GENERAL_BILINEAR_FLAGS \
|
||||
|
@ -1187,14 +1157,14 @@ static const fetcher_info_t fetcher_info[] =
|
|||
{ PIXMAN_ ## format, \
|
||||
GENERAL_BILINEAR_FLAGS | FAST_PATH_ ## repeat ## _REPEAT, \
|
||||
bits_image_fetch_bilinear_affine_ ## name, \
|
||||
_pixman_image_get_scanline_generic_64 \
|
||||
_pixman_image_get_scanline_generic_float \
|
||||
},
|
||||
|
||||
#define NEAREST_AFFINE_FAST_PATH(name, format, repeat) \
|
||||
{ PIXMAN_ ## format, \
|
||||
GENERAL_NEAREST_FLAGS | FAST_PATH_ ## repeat ## _REPEAT, \
|
||||
bits_image_fetch_nearest_affine_ ## name, \
|
||||
_pixman_image_get_scanline_generic_64 \
|
||||
bits_image_fetch_nearest_affine_ ## name, \
|
||||
_pixman_image_get_scanline_generic_float \
|
||||
},
|
||||
|
||||
#define AFFINE_FAST_PATHS(name, format, repeat) \
|
||||
|
@ -1222,11 +1192,15 @@ static const fetcher_info_t fetcher_info[] =
|
|||
{ PIXMAN_any,
|
||||
(FAST_PATH_NO_ALPHA_MAP | FAST_PATH_HAS_TRANSFORM | FAST_PATH_AFFINE_TRANSFORM),
|
||||
bits_image_fetch_affine_no_alpha,
|
||||
_pixman_image_get_scanline_generic_64
|
||||
_pixman_image_get_scanline_generic_float
|
||||
},
|
||||
|
||||
/* General */
|
||||
{ PIXMAN_any, 0, bits_image_fetch_general, _pixman_image_get_scanline_generic_64 },
|
||||
{ PIXMAN_any,
|
||||
0,
|
||||
bits_image_fetch_general,
|
||||
_pixman_image_get_scanline_generic_float
|
||||
},
|
||||
|
||||
{ PIXMAN_null },
|
||||
};
|
||||
|
@ -1256,7 +1230,7 @@ _pixman_bits_image_src_iter_init (pixman_image_t *image, pixman_iter_t *iter)
|
|||
else
|
||||
{
|
||||
iter->data = info->get_scanline_32;
|
||||
iter->get_scanline = info->get_scanline_64;
|
||||
iter->get_scanline = info->get_scanline_float;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -1325,30 +1299,27 @@ dest_get_scanline_wide (pixman_iter_t *iter, const uint32_t *mask)
|
|||
int x = iter->x;
|
||||
int y = iter->y;
|
||||
int width = iter->width;
|
||||
uint64_t * buffer = (uint64_t *)iter->buffer;
|
||||
argb_t * buffer = (argb_t *)iter->buffer;
|
||||
|
||||
image->fetch_scanline_64 (
|
||||
image->fetch_scanline_float (
|
||||
(pixman_image_t *)image, x, y, width, (uint32_t *)buffer, mask);
|
||||
if (image->common.alpha_map)
|
||||
{
|
||||
uint64_t *alpha;
|
||||
argb_t *alpha;
|
||||
|
||||
if ((alpha = malloc (width * sizeof (uint64_t))))
|
||||
if ((alpha = malloc (width * sizeof (argb_t))))
|
||||
{
|
||||
int i;
|
||||
|
||||
x -= image->common.alpha_origin_x;
|
||||
y -= image->common.alpha_origin_y;
|
||||
|
||||
image->common.alpha_map->fetch_scanline_64 (
|
||||
image->common.alpha_map->fetch_scanline_float (
|
||||
(pixman_image_t *)image->common.alpha_map,
|
||||
x, y, width, (uint32_t *)alpha, mask);
|
||||
|
||||
for (i = 0; i < width; ++i)
|
||||
{
|
||||
buffer[i] &= ~0xffff000000000000ULL;
|
||||
buffer[i] |= (alpha[i] & 0xffff000000000000ULL);
|
||||
}
|
||||
buffer[i].a = alpha[i].a;
|
||||
|
||||
free (alpha);
|
||||
}
|
||||
|
@ -1403,14 +1374,14 @@ dest_write_back_wide (pixman_iter_t *iter)
|
|||
int width = iter->width;
|
||||
const uint32_t *buffer = iter->buffer;
|
||||
|
||||
image->store_scanline_64 (image, x, y, width, buffer);
|
||||
image->store_scanline_float (image, x, y, width, buffer);
|
||||
|
||||
if (image->common.alpha_map)
|
||||
{
|
||||
x -= image->common.alpha_origin_x;
|
||||
y -= image->common.alpha_origin_y;
|
||||
|
||||
image->common.alpha_map->store_scanline_64 (
|
||||
image->common.alpha_map->store_scanline_float (
|
||||
image->common.alpha_map, x, y, width, buffer);
|
||||
}
|
||||
|
||||
|
@ -1458,7 +1429,8 @@ static uint32_t *
|
|||
create_bits (pixman_format_code_t format,
|
||||
int width,
|
||||
int height,
|
||||
int * rowstride_bytes)
|
||||
int * rowstride_bytes,
|
||||
pixman_bool_t clear)
|
||||
{
|
||||
int stride;
|
||||
size_t buf_size;
|
||||
|
@ -1490,7 +1462,10 @@ create_bits (pixman_format_code_t format,
|
|||
if (rowstride_bytes)
|
||||
*rowstride_bytes = stride;
|
||||
|
||||
return calloc (buf_size, 1);
|
||||
if (clear)
|
||||
return calloc (buf_size, 1);
|
||||
else
|
||||
return malloc (buf_size);
|
||||
}
|
||||
|
||||
pixman_bool_t
|
||||
|
@ -1499,7 +1474,8 @@ _pixman_bits_image_init (pixman_image_t * image,
|
|||
int width,
|
||||
int height,
|
||||
uint32_t * bits,
|
||||
int rowstride)
|
||||
int rowstride,
|
||||
pixman_bool_t clear)
|
||||
{
|
||||
uint32_t *free_me = NULL;
|
||||
|
||||
|
@ -1507,7 +1483,7 @@ _pixman_bits_image_init (pixman_image_t * image,
|
|||
{
|
||||
int rowstride_bytes;
|
||||
|
||||
free_me = bits = create_bits (format, width, height, &rowstride_bytes);
|
||||
free_me = bits = create_bits (format, width, height, &rowstride_bytes, clear);
|
||||
|
||||
if (!bits)
|
||||
return FALSE;
|
||||
|
@ -1535,12 +1511,13 @@ _pixman_bits_image_init (pixman_image_t * image,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
PIXMAN_EXPORT pixman_image_t *
|
||||
pixman_image_create_bits (pixman_format_code_t format,
|
||||
int width,
|
||||
int height,
|
||||
uint32_t * bits,
|
||||
int rowstride_bytes)
|
||||
static pixman_image_t *
|
||||
create_bits_image_internal (pixman_format_code_t format,
|
||||
int width,
|
||||
int height,
|
||||
uint32_t * bits,
|
||||
int rowstride_bytes,
|
||||
pixman_bool_t clear)
|
||||
{
|
||||
pixman_image_t *image;
|
||||
|
||||
|
@ -1557,7 +1534,8 @@ pixman_image_create_bits (pixman_format_code_t format,
|
|||
return NULL;
|
||||
|
||||
if (!_pixman_bits_image_init (image, format, width, height, bits,
|
||||
rowstride_bytes / (int) sizeof (uint32_t)))
|
||||
rowstride_bytes / (int) sizeof (uint32_t),
|
||||
clear))
|
||||
{
|
||||
free (image);
|
||||
return NULL;
|
||||
|
@ -1565,3 +1543,28 @@ pixman_image_create_bits (pixman_format_code_t format,
|
|||
|
||||
return image;
|
||||
}
|
||||
|
||||
/* If bits is NULL, a buffer will be allocated and initialized to 0 */
|
||||
PIXMAN_EXPORT pixman_image_t *
|
||||
pixman_image_create_bits (pixman_format_code_t format,
|
||||
int width,
|
||||
int height,
|
||||
uint32_t * bits,
|
||||
int rowstride_bytes)
|
||||
{
|
||||
return create_bits_image_internal (
|
||||
format, width, height, bits, rowstride_bytes, TRUE);
|
||||
}
|
||||
|
||||
|
||||
/* If bits is NULL, a buffer will be allocated and _not_ initialized */
|
||||
PIXMAN_EXPORT pixman_image_t *
|
||||
pixman_image_create_bits_no_clear (pixman_format_code_t format,
|
||||
int width,
|
||||
int height,
|
||||
uint32_t * bits,
|
||||
int rowstride_bytes)
|
||||
{
|
||||
return create_bits_image_internal (
|
||||
format, width, height, bits, rowstride_bytes, FALSE);
|
||||
}
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,7 +1,26 @@
|
|||
/* WARNING: This file is generated by combine.pl from combine.inc.
|
||||
Please edit one of those files rather than this one. */
|
||||
|
||||
#line 1 "pixman-combine.c.template"
|
||||
/*
|
||||
* Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
|
||||
* 2005 Lars Knoll & Zack Rusin, Trolltech
|
||||
*
|
||||
* 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 Keith Packard not be used in
|
||||
* advertising or publicity pertaining to distribution of the software without
|
||||
* specific, written prior permission. Keith Packard makes no
|
||||
* representations about the suitability of this software for any purpose. It
|
||||
* is provided "as is" without express or implied warranty.
|
||||
*
|
||||
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
|
||||
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS 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.
|
||||
*/
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
@ -10,10 +29,9 @@
|
|||
#include <string.h>
|
||||
|
||||
#include "pixman-private.h"
|
||||
|
||||
#include "pixman-combine32.h"
|
||||
|
||||
/*** per channel helper functions ***/
|
||||
/* component alpha helper functions */
|
||||
|
||||
static void
|
||||
combine_mask_ca (uint32_t *src, uint32_t *mask)
|
||||
|
@ -95,15 +113,11 @@ combine_mask_alpha_ca (const uint32_t *src, uint32_t *mask)
|
|||
/*
|
||||
* There are two ways of handling alpha -- either as a single unified value or
|
||||
* a separate value for each component, hence each macro must have two
|
||||
* versions. The unified alpha version has a 'U' at the end of the name,
|
||||
* the component version has a 'C'. Similarly, functions which deal with
|
||||
* versions. The unified alpha version has a 'u' at the end of the name,
|
||||
* the component version has a 'ca'. Similarly, functions which deal with
|
||||
* this difference will have two versions using the same convention.
|
||||
*/
|
||||
|
||||
/*
|
||||
* All of the composing functions
|
||||
*/
|
||||
|
||||
static force_inline uint32_t
|
||||
combine_mask (const uint32_t *src, const uint32_t *mask, int i)
|
||||
{
|
||||
|
@ -158,7 +172,9 @@ combine_src_u (pixman_implementation_t *imp,
|
|||
int i;
|
||||
|
||||
if (!mask)
|
||||
{
|
||||
memcpy (dest, src, width * sizeof (uint32_t));
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < width; ++i)
|
||||
|
@ -170,7 +186,6 @@ combine_src_u (pixman_implementation_t *imp,
|
|||
}
|
||||
}
|
||||
|
||||
/* if the Src is opaque, call combine_src_u */
|
||||
static void
|
||||
combine_over_u (pixman_implementation_t *imp,
|
||||
pixman_op_t op,
|
||||
|
@ -192,7 +207,6 @@ combine_over_u (pixman_implementation_t *imp,
|
|||
}
|
||||
}
|
||||
|
||||
/* if the Dst is opaque, this is a noop */
|
||||
static void
|
||||
combine_over_reverse_u (pixman_implementation_t *imp,
|
||||
pixman_op_t op,
|
||||
|
@ -213,7 +227,6 @@ combine_over_reverse_u (pixman_implementation_t *imp,
|
|||
}
|
||||
}
|
||||
|
||||
/* if the Dst is opaque, call combine_src_u */
|
||||
static void
|
||||
combine_in_u (pixman_implementation_t *imp,
|
||||
pixman_op_t op,
|
||||
|
@ -233,7 +246,6 @@ combine_in_u (pixman_implementation_t *imp,
|
|||
}
|
||||
}
|
||||
|
||||
/* if the Src is opaque, this is a noop */
|
||||
static void
|
||||
combine_in_reverse_u (pixman_implementation_t *imp,
|
||||
pixman_op_t op,
|
||||
|
@ -254,7 +266,6 @@ combine_in_reverse_u (pixman_implementation_t *imp,
|
|||
}
|
||||
}
|
||||
|
||||
/* if the Dst is opaque, call combine_clear */
|
||||
static void
|
||||
combine_out_u (pixman_implementation_t *imp,
|
||||
pixman_op_t op,
|
||||
|
@ -274,7 +285,6 @@ combine_out_u (pixman_implementation_t *imp,
|
|||
}
|
||||
}
|
||||
|
||||
/* if the Src is opaque, call combine_clear */
|
||||
static void
|
||||
combine_out_reverse_u (pixman_implementation_t *imp,
|
||||
pixman_op_t op,
|
||||
|
@ -295,9 +305,6 @@ combine_out_reverse_u (pixman_implementation_t *imp,
|
|||
}
|
||||
}
|
||||
|
||||
/* if the Src is opaque, call combine_in_u */
|
||||
/* if the Dst is opaque, call combine_over_u */
|
||||
/* if both the Src and Dst are opaque, call combine_src_u */
|
||||
static void
|
||||
combine_atop_u (pixman_implementation_t *imp,
|
||||
pixman_op_t op,
|
||||
|
@ -320,9 +327,6 @@ combine_atop_u (pixman_implementation_t *imp,
|
|||
}
|
||||
}
|
||||
|
||||
/* if the Src is opaque, call combine_over_reverse_u */
|
||||
/* if the Dst is opaque, call combine_in_reverse_u */
|
||||
/* if both the Src and Dst are opaque, call combine_dst_u */
|
||||
static void
|
||||
combine_atop_reverse_u (pixman_implementation_t *imp,
|
||||
pixman_op_t op,
|
||||
|
@ -345,9 +349,6 @@ combine_atop_reverse_u (pixman_implementation_t *imp,
|
|||
}
|
||||
}
|
||||
|
||||
/* if the Src is opaque, call combine_over_u */
|
||||
/* if the Dst is opaque, call combine_over_reverse_u */
|
||||
/* if both the Src and Dst are opaque, call combine_clear */
|
||||
static void
|
||||
combine_xor_u (pixman_implementation_t *imp,
|
||||
pixman_op_t op,
|
||||
|
@ -389,9 +390,6 @@ combine_add_u (pixman_implementation_t *imp,
|
|||
}
|
||||
}
|
||||
|
||||
/* if the Src is opaque, call combine_add_u */
|
||||
/* if the Dst is opaque, call combine_add_u */
|
||||
/* if both the Src and Dst are opaque, call combine_add_u */
|
||||
static void
|
||||
combine_saturate_u (pixman_implementation_t *imp,
|
||||
pixman_op_t op,
|
||||
|
@ -448,7 +446,6 @@ combine_saturate_u (pixman_implementation_t *imp,
|
|||
* Multiply
|
||||
* B(Dca, ad, Sca, as) = Dca.Sca
|
||||
*/
|
||||
|
||||
static void
|
||||
combine_multiply_u (pixman_implementation_t *imp,
|
||||
pixman_op_t op,
|
||||
|
@ -493,7 +490,7 @@ combine_multiply_ca (pixman_implementation_t *imp,
|
|||
uint32_t r = d;
|
||||
uint32_t dest_ia = ALPHA_8 (~d);
|
||||
|
||||
combine_mask_value_ca (&s, &m);
|
||||
combine_mask_ca (&s, &m);
|
||||
|
||||
UN8x4_MUL_UN8x4_ADD_UN8x4_MUL_UN8 (r, ~m, s, dest_ia);
|
||||
UN8x4_MUL_UN8x4 (d, s);
|
||||
|
@ -550,7 +547,7 @@ combine_multiply_ca (pixman_implementation_t *imp,
|
|||
uint8_t ida = ~da; \
|
||||
uint32_t result; \
|
||||
\
|
||||
combine_mask_value_ca (&s, &m); \
|
||||
combine_mask_ca (&s, &m); \
|
||||
\
|
||||
result = d; \
|
||||
UN8x4_MUL_UN8x4_ADD_UN8x4_MUL_UN8 (result, ~m, s, ida); \
|
||||
|
@ -1583,9 +1580,8 @@ combine_conjoint_xor_u (pixman_implementation_t *imp,
|
|||
combine_conjoint_general_u (dest, src, mask, width, COMBINE_XOR);
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
/*********************** Per Channel functions **************************/
|
||||
/************************************************************************/
|
||||
|
||||
/* Component alpha combiners */
|
||||
|
||||
static void
|
||||
combine_clear_ca (pixman_implementation_t *imp,
|
||||
|
@ -2462,4 +2458,3 @@ _pixman_setup_combiner_functions_32 (pixman_implementation_t *imp)
|
|||
imp->combine_32_ca[PIXMAN_OP_HSL_COLOR] = combine_dst;
|
||||
imp->combine_32_ca[PIXMAN_OP_HSL_LUMINOSITY] = combine_dst;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,3 @@
|
|||
/* WARNING: This file is generated by combine.pl from combine.inc.
|
||||
Please edit one of those files rather than this one. */
|
||||
|
||||
#line 1 "pixman-combine.c.template"
|
||||
|
||||
#define COMPONENT_SIZE 8
|
||||
#define MASK 0xff
|
||||
#define ONE_HALF 0x80
|
||||
|
|
|
@ -165,7 +165,8 @@ conical_get_scanline_wide (pixman_iter_t *iter, const uint32_t *mask)
|
|||
{
|
||||
uint32_t *buffer = conical_get_scanline_narrow (iter, NULL);
|
||||
|
||||
pixman_expand ((uint64_t *)buffer, buffer, PIXMAN_a8r8g8b8, iter->width);
|
||||
pixman_expand_to_float (
|
||||
(argb_t *)buffer, buffer, PIXMAN_a8r8g8b8, iter->width);
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
@ -180,7 +181,7 @@ _pixman_conical_gradient_iter_init (pixman_image_t *image, pixman_iter_t *iter)
|
|||
}
|
||||
|
||||
PIXMAN_EXPORT pixman_image_t *
|
||||
pixman_image_create_conical_gradient (pixman_point_fixed_t * center,
|
||||
pixman_image_create_conical_gradient (const pixman_point_fixed_t * center,
|
||||
pixman_fixed_t angle,
|
||||
const pixman_gradient_stop_t *stops,
|
||||
int n_stops)
|
||||
|
|
|
@ -90,7 +90,7 @@ over (uint32_t src,
|
|||
return dest;
|
||||
}
|
||||
|
||||
static uint32_t
|
||||
static force_inline uint32_t
|
||||
in (uint32_t x,
|
||||
uint8_t y)
|
||||
{
|
||||
|
@ -1480,7 +1480,7 @@ fast_composite_tiled_repeat (pixman_implementation_t *imp,
|
|||
mask_flags = FAST_PATH_IS_OPAQUE;
|
||||
}
|
||||
|
||||
if (_pixman_lookup_composite_function (
|
||||
if (_pixman_implementation_lookup_composite (
|
||||
imp->toplevel, info->op,
|
||||
src_image->common.extended_format_code, src_flags,
|
||||
mask_format, mask_flags,
|
||||
|
@ -1518,7 +1518,8 @@ fast_composite_tiled_repeat (pixman_implementation_t *imp,
|
|||
|
||||
/* Initialize/validate stack-allocated temporary image */
|
||||
_pixman_bits_image_init (&extended_src_image, src_image->bits.format,
|
||||
src_width, 1, &extended_src[0], src_stride);
|
||||
src_width, 1, &extended_src[0], src_stride,
|
||||
FALSE);
|
||||
_pixman_image_validate (&extended_src_image);
|
||||
|
||||
info2.src_image = &extended_src_image;
|
||||
|
@ -1680,7 +1681,7 @@ fetch_nearest (pixman_repeat_t src_repeat,
|
|||
{
|
||||
if (repeat (src_repeat, &x, src_width))
|
||||
{
|
||||
if (format == PIXMAN_x8r8g8b8)
|
||||
if (format == PIXMAN_x8r8g8b8 || format == PIXMAN_x8b8g8r8)
|
||||
return *(src + x) | 0xff000000;
|
||||
else
|
||||
return *(src + x);
|
||||
|
@ -2418,9 +2419,7 @@ fast_path_fill (pixman_implementation_t *imp,
|
|||
break;
|
||||
|
||||
default:
|
||||
return _pixman_implementation_fill (
|
||||
imp->delegate, bits, stride, bpp, x, y, width, height, xor);
|
||||
break;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
#include <string.h>
|
||||
#include "pixman-private.h"
|
||||
|
||||
static void
|
||||
static pixman_bool_t
|
||||
general_src_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter)
|
||||
{
|
||||
pixman_image_t *image = iter->image;
|
||||
|
@ -54,18 +54,24 @@ general_src_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter)
|
|||
_pixman_bits_image_src_iter_init (image, iter);
|
||||
else
|
||||
_pixman_log_error (FUNC, "Pixman bug: unknown image type\n");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
static pixman_bool_t
|
||||
general_dest_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter)
|
||||
{
|
||||
if (iter->image->type == BITS)
|
||||
{
|
||||
_pixman_bits_image_dest_iter_init (iter->image, iter);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
_pixman_log_error (FUNC, "Trying to write to a non-writable image");
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -125,7 +131,7 @@ general_composite_rect (pixman_implementation_t *imp,
|
|||
else
|
||||
{
|
||||
narrow = 0;
|
||||
Bpp = 8;
|
||||
Bpp = 16;
|
||||
}
|
||||
|
||||
// XXX: This special casing is bad. Ideally, we'd keep the general code general perhaps
|
||||
|
@ -154,6 +160,14 @@ general_composite_rect (pixman_implementation_t *imp,
|
|||
mask_buffer = src_buffer + width * Bpp;
|
||||
dest_buffer = mask_buffer + width * Bpp;
|
||||
|
||||
if (!narrow)
|
||||
{
|
||||
/* To make sure there aren't any NANs in the buffers */
|
||||
memset (src_buffer, 0, width * Bpp);
|
||||
memset (mask_buffer, 0, width * Bpp);
|
||||
memset (dest_buffer, 0, width * Bpp);
|
||||
}
|
||||
|
||||
/* src iter */
|
||||
src_iter_flags = narrow | op_flags[op].src | rgb16;
|
||||
|
||||
|
@ -215,40 +229,6 @@ static const pixman_fast_path_t general_fast_path[] =
|
|||
{ PIXMAN_OP_NONE }
|
||||
};
|
||||
|
||||
static pixman_bool_t
|
||||
general_blt (pixman_implementation_t *imp,
|
||||
uint32_t * src_bits,
|
||||
uint32_t * dst_bits,
|
||||
int src_stride,
|
||||
int dst_stride,
|
||||
int src_bpp,
|
||||
int dst_bpp,
|
||||
int src_x,
|
||||
int src_y,
|
||||
int dest_x,
|
||||
int dest_y,
|
||||
int width,
|
||||
int height)
|
||||
{
|
||||
/* We can't blit unless we have sse2 or mmx */
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static pixman_bool_t
|
||||
general_fill (pixman_implementation_t *imp,
|
||||
uint32_t * bits,
|
||||
int stride,
|
||||
int bpp,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height,
|
||||
uint32_t xor)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
pixman_implementation_t *
|
||||
_pixman_implementation_create_general (void)
|
||||
{
|
||||
|
@ -256,10 +236,8 @@ _pixman_implementation_create_general (void)
|
|||
|
||||
_pixman_setup_combiner_functions_16 (imp);
|
||||
_pixman_setup_combiner_functions_32 (imp);
|
||||
_pixman_setup_combiner_functions_64 (imp);
|
||||
_pixman_setup_combiner_functions_float (imp);
|
||||
|
||||
imp->blt = general_blt;
|
||||
imp->fill = general_fill;
|
||||
imp->src_iter_init = general_src_iter_init;
|
||||
imp->dest_iter_init = general_dest_iter_init;
|
||||
|
||||
|
|
|
@ -354,7 +354,7 @@ pixman_glyph_get_extents (pixman_glyph_cache_t *cache,
|
|||
PIXMAN_EXPORT pixman_format_code_t
|
||||
pixman_glyph_get_mask_format (pixman_glyph_cache_t *cache,
|
||||
int n_glyphs,
|
||||
pixman_glyph_t * glyphs)
|
||||
const pixman_glyph_t *glyphs)
|
||||
{
|
||||
pixman_format_code_t format = PIXMAN_a1;
|
||||
int i;
|
||||
|
@ -401,7 +401,7 @@ pixman_composite_glyphs_no_mask (pixman_op_t op,
|
|||
int32_t dest_y,
|
||||
pixman_glyph_cache_t *cache,
|
||||
int n_glyphs,
|
||||
pixman_glyph_t *glyphs)
|
||||
const pixman_glyph_t *glyphs)
|
||||
{
|
||||
pixman_region32_t region;
|
||||
pixman_format_code_t glyph_format = PIXMAN_null;
|
||||
|
@ -464,7 +464,7 @@ pixman_composite_glyphs_no_mask (pixman_op_t op,
|
|||
glyph_format = glyph_img->common.extended_format_code;
|
||||
glyph_flags = glyph_img->common.flags;
|
||||
|
||||
_pixman_lookup_composite_function (
|
||||
_pixman_implementation_lookup_composite (
|
||||
get_implementation(), op,
|
||||
src->common.extended_format_code, src->common.flags,
|
||||
glyph_format, glyph_flags | extra,
|
||||
|
@ -502,7 +502,7 @@ static void
|
|||
add_glyphs (pixman_glyph_cache_t *cache,
|
||||
pixman_image_t *dest,
|
||||
int off_x, int off_y,
|
||||
int n_glyphs, pixman_glyph_t *glyphs)
|
||||
int n_glyphs, const pixman_glyph_t *glyphs)
|
||||
{
|
||||
pixman_format_code_t glyph_format = PIXMAN_null;
|
||||
uint32_t glyph_flags = 0;
|
||||
|
@ -560,7 +560,7 @@ add_glyphs (pixman_glyph_cache_t *cache,
|
|||
{
|
||||
if (!white_img)
|
||||
{
|
||||
pixman_color_t white = { 0xffff, 0xffff, 0xffff, 0xffff };
|
||||
static const pixman_color_t white = { 0xffff, 0xffff, 0xffff, 0xffff };
|
||||
|
||||
if (!(white_img = pixman_image_create_solid_fill (&white)))
|
||||
goto out;
|
||||
|
@ -576,7 +576,7 @@ add_glyphs (pixman_glyph_cache_t *cache,
|
|||
white_src = TRUE;
|
||||
}
|
||||
|
||||
_pixman_lookup_composite_function (
|
||||
_pixman_implementation_lookup_composite (
|
||||
get_implementation(), PIXMAN_OP_ADD,
|
||||
src_format, info.src_flags,
|
||||
mask_format, info.mask_flags,
|
||||
|
@ -651,7 +651,7 @@ pixman_composite_glyphs (pixman_op_t op,
|
|||
int32_t height,
|
||||
pixman_glyph_cache_t *cache,
|
||||
int n_glyphs,
|
||||
pixman_glyph_t *glyphs)
|
||||
const pixman_glyph_t *glyphs)
|
||||
{
|
||||
pixman_image_t *mask;
|
||||
|
||||
|
|
|
@ -301,9 +301,9 @@ compute_image_info (pixman_image_t *image)
|
|||
pixman_fixed_t m01 = image->common.transform->matrix[0][1];
|
||||
pixman_fixed_t m10 = image->common.transform->matrix[1][0];
|
||||
|
||||
if (m01 == -1 && m10 == 1)
|
||||
if (m01 == -pixman_fixed_1 && m10 == pixman_fixed_1)
|
||||
flags |= FAST_PATH_ROTATE_90_TRANSFORM;
|
||||
else if (m01 == 1 && m10 == -1)
|
||||
else if (m01 == pixman_fixed_1 && m10 == -pixman_fixed_1)
|
||||
flags |= FAST_PATH_ROTATE_270_TRANSFORM;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,95 +27,143 @@
|
|||
#include <stdlib.h>
|
||||
#include "pixman-private.h"
|
||||
|
||||
static pixman_bool_t
|
||||
delegate_blt (pixman_implementation_t * imp,
|
||||
uint32_t * src_bits,
|
||||
uint32_t * dst_bits,
|
||||
int src_stride,
|
||||
int dst_stride,
|
||||
int src_bpp,
|
||||
int dst_bpp,
|
||||
int src_x,
|
||||
int src_y,
|
||||
int dest_x,
|
||||
int dest_y,
|
||||
int width,
|
||||
int height)
|
||||
{
|
||||
return _pixman_implementation_blt (
|
||||
imp->delegate, src_bits, dst_bits, src_stride, dst_stride,
|
||||
src_bpp, dst_bpp, src_x, src_y, dest_x, dest_y,
|
||||
width, height);
|
||||
}
|
||||
|
||||
static pixman_bool_t
|
||||
delegate_fill (pixman_implementation_t *imp,
|
||||
uint32_t * bits,
|
||||
int stride,
|
||||
int bpp,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height,
|
||||
uint32_t xor)
|
||||
{
|
||||
return _pixman_implementation_fill (
|
||||
imp->delegate, bits, stride, bpp, x, y, width, height, xor);
|
||||
}
|
||||
|
||||
static void
|
||||
delegate_src_iter_init (pixman_implementation_t *imp,
|
||||
pixman_iter_t * iter)
|
||||
{
|
||||
imp->delegate->src_iter_init (imp->delegate, iter);
|
||||
}
|
||||
|
||||
static void
|
||||
delegate_dest_iter_init (pixman_implementation_t *imp,
|
||||
pixman_iter_t * iter)
|
||||
{
|
||||
imp->delegate->dest_iter_init (imp->delegate, iter);
|
||||
}
|
||||
|
||||
pixman_implementation_t *
|
||||
_pixman_implementation_create (pixman_implementation_t *delegate,
|
||||
_pixman_implementation_create (pixman_implementation_t *fallback,
|
||||
const pixman_fast_path_t *fast_paths)
|
||||
{
|
||||
pixman_implementation_t *imp = malloc (sizeof (pixman_implementation_t));
|
||||
pixman_implementation_t *d;
|
||||
int i;
|
||||
|
||||
if (!imp)
|
||||
return NULL;
|
||||
pixman_implementation_t *imp;
|
||||
|
||||
assert (fast_paths);
|
||||
|
||||
/* Make sure the whole delegate chain has the right toplevel */
|
||||
imp->delegate = delegate;
|
||||
for (d = imp; d != NULL; d = d->delegate)
|
||||
d->toplevel = imp;
|
||||
|
||||
/* Fill out function pointers with ones that just delegate
|
||||
*/
|
||||
imp->blt = delegate_blt;
|
||||
imp->fill = delegate_fill;
|
||||
imp->src_iter_init = delegate_src_iter_init;
|
||||
imp->dest_iter_init = delegate_dest_iter_init;
|
||||
|
||||
imp->fast_paths = fast_paths;
|
||||
|
||||
for (i = 0; i < PIXMAN_N_OPERATORS; ++i)
|
||||
if ((imp = malloc (sizeof (pixman_implementation_t))))
|
||||
{
|
||||
imp->combine_16[i] = NULL;
|
||||
imp->combine_32[i] = NULL;
|
||||
imp->combine_64[i] = NULL;
|
||||
imp->combine_32_ca[i] = NULL;
|
||||
imp->combine_64_ca[i] = NULL;
|
||||
pixman_implementation_t *d;
|
||||
|
||||
memset (imp, 0, sizeof *imp);
|
||||
|
||||
imp->fallback = fallback;
|
||||
imp->fast_paths = fast_paths;
|
||||
|
||||
/* Make sure the whole fallback chain has the right toplevel */
|
||||
for (d = imp; d != NULL; d = d->fallback)
|
||||
d->toplevel = imp;
|
||||
}
|
||||
|
||||
return imp;
|
||||
}
|
||||
|
||||
#define N_CACHED_FAST_PATHS 8
|
||||
|
||||
typedef struct
|
||||
{
|
||||
struct
|
||||
{
|
||||
pixman_implementation_t * imp;
|
||||
pixman_fast_path_t fast_path;
|
||||
} cache [N_CACHED_FAST_PATHS];
|
||||
} cache_t;
|
||||
|
||||
PIXMAN_DEFINE_THREAD_LOCAL (cache_t, fast_path_cache);
|
||||
|
||||
pixman_bool_t
|
||||
_pixman_implementation_lookup_composite (pixman_implementation_t *toplevel,
|
||||
pixman_op_t op,
|
||||
pixman_format_code_t src_format,
|
||||
uint32_t src_flags,
|
||||
pixman_format_code_t mask_format,
|
||||
uint32_t mask_flags,
|
||||
pixman_format_code_t dest_format,
|
||||
uint32_t dest_flags,
|
||||
pixman_implementation_t **out_imp,
|
||||
pixman_composite_func_t *out_func)
|
||||
{
|
||||
pixman_implementation_t *imp;
|
||||
cache_t *cache;
|
||||
int i;
|
||||
|
||||
/* Check cache for fast paths */
|
||||
cache = PIXMAN_GET_THREAD_LOCAL (fast_path_cache);
|
||||
|
||||
for (i = 0; i < N_CACHED_FAST_PATHS; ++i)
|
||||
{
|
||||
const pixman_fast_path_t *info = &(cache->cache[i].fast_path);
|
||||
|
||||
/* Note that we check for equality here, not whether
|
||||
* the cached fast path matches. This is to prevent
|
||||
* us from selecting an overly general fast path
|
||||
* when a more specific one would work.
|
||||
*/
|
||||
if (info->op == op &&
|
||||
info->src_format == src_format &&
|
||||
info->mask_format == mask_format &&
|
||||
info->dest_format == dest_format &&
|
||||
info->src_flags == src_flags &&
|
||||
info->mask_flags == mask_flags &&
|
||||
info->dest_flags == dest_flags &&
|
||||
info->func)
|
||||
{
|
||||
*out_imp = cache->cache[i].imp;
|
||||
*out_func = cache->cache[i].fast_path.func;
|
||||
|
||||
goto update_cache;
|
||||
}
|
||||
}
|
||||
|
||||
for (imp = toplevel; imp != NULL; imp = imp->fallback)
|
||||
{
|
||||
const pixman_fast_path_t *info = imp->fast_paths;
|
||||
|
||||
while (info->op != PIXMAN_OP_NONE)
|
||||
{
|
||||
if ((info->op == op || info->op == PIXMAN_OP_any) &&
|
||||
/* Formats */
|
||||
((info->src_format == src_format) ||
|
||||
(info->src_format == PIXMAN_any)) &&
|
||||
((info->mask_format == mask_format) ||
|
||||
(info->mask_format == PIXMAN_any)) &&
|
||||
((info->dest_format == dest_format) ||
|
||||
(info->dest_format == PIXMAN_any)) &&
|
||||
/* Flags */
|
||||
(info->src_flags & src_flags) == info->src_flags &&
|
||||
(info->mask_flags & mask_flags) == info->mask_flags &&
|
||||
(info->dest_flags & dest_flags) == info->dest_flags)
|
||||
{
|
||||
*out_imp = imp;
|
||||
*out_func = info->func;
|
||||
|
||||
/* Set i to the last spot in the cache so that the
|
||||
* move-to-front code below will work
|
||||
*/
|
||||
i = N_CACHED_FAST_PATHS - 1;
|
||||
|
||||
goto update_cache;
|
||||
}
|
||||
|
||||
++info;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
|
||||
update_cache:
|
||||
if (i)
|
||||
{
|
||||
while (i--)
|
||||
cache->cache[i + 1] = cache->cache[i];
|
||||
|
||||
cache->cache[0].imp = *out_imp;
|
||||
cache->cache[0].fast_path.op = op;
|
||||
cache->cache[0].fast_path.src_format = src_format;
|
||||
cache->cache[0].fast_path.src_flags = src_flags;
|
||||
cache->cache[0].fast_path.mask_format = mask_format;
|
||||
cache->cache[0].fast_path.mask_flags = mask_flags;
|
||||
cache->cache[0].fast_path.dest_format = dest_format;
|
||||
cache->cache[0].fast_path.dest_flags = dest_flags;
|
||||
cache->cache[0].fast_path.func = *out_func;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
pixman_combine_32_func_t
|
||||
_pixman_implementation_lookup_combiner (pixman_implementation_t *imp,
|
||||
pixman_op_t op,
|
||||
|
@ -123,29 +171,38 @@ _pixman_implementation_lookup_combiner (pixman_implementation_t *imp,
|
|||
pixman_bool_t narrow,
|
||||
pixman_bool_t rgb16)
|
||||
{
|
||||
pixman_combine_32_func_t f;
|
||||
|
||||
do
|
||||
while (imp)
|
||||
{
|
||||
pixman_combine_32_func_t (*combiners[]) =
|
||||
{
|
||||
(pixman_combine_32_func_t *)imp->combine_64,
|
||||
(pixman_combine_32_func_t *)imp->combine_64_ca,
|
||||
imp->combine_32,
|
||||
imp->combine_32_ca,
|
||||
(pixman_combine_32_func_t *)imp->combine_16,
|
||||
NULL,
|
||||
};
|
||||
if (rgb16) {
|
||||
f = combiners[4][op];
|
||||
} else {
|
||||
f = combiners[component_alpha + (narrow << 1)][op];
|
||||
}
|
||||
imp = imp->delegate;
|
||||
}
|
||||
while (!f);
|
||||
pixman_combine_32_func_t f = NULL;
|
||||
|
||||
return f;
|
||||
switch ((narrow << 1) | component_alpha)
|
||||
{
|
||||
case 0: /* not narrow, not component alpha */
|
||||
f = (pixman_combine_32_func_t)imp->combine_float[op];
|
||||
break;
|
||||
|
||||
case 1: /* not narrow, component_alpha */
|
||||
f = (pixman_combine_32_func_t)imp->combine_float_ca[op];
|
||||
break;
|
||||
|
||||
case 2: /* narrow, not component alpha */
|
||||
f = imp->combine_32[op];
|
||||
break;
|
||||
|
||||
case 3: /* narrow, component_alpha */
|
||||
f = imp->combine_32_ca[op];
|
||||
break;
|
||||
}
|
||||
if (rgb16)
|
||||
f = (pixman_combine_32_func_t *)imp->combine_16[op];
|
||||
|
||||
if (f)
|
||||
return f;
|
||||
|
||||
imp = imp->fallback;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pixman_bool_t
|
||||
|
@ -163,9 +220,20 @@ _pixman_implementation_blt (pixman_implementation_t * imp,
|
|||
int width,
|
||||
int height)
|
||||
{
|
||||
return (*imp->blt) (imp, src_bits, dst_bits, src_stride, dst_stride,
|
||||
src_bpp, dst_bpp, src_x, src_y, dest_x, dest_y,
|
||||
width, height);
|
||||
while (imp)
|
||||
{
|
||||
if (imp->blt &&
|
||||
(*imp->blt) (imp, src_bits, dst_bits, src_stride, dst_stride,
|
||||
src_bpp, dst_bpp, src_x, src_y, dest_x, dest_y,
|
||||
width, height))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
imp = imp->fallback;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
pixman_bool_t
|
||||
|
@ -179,10 +247,21 @@ _pixman_implementation_fill (pixman_implementation_t *imp,
|
|||
int height,
|
||||
uint32_t xor)
|
||||
{
|
||||
return (*imp->fill) (imp, bits, stride, bpp, x, y, width, height, xor);
|
||||
while (imp)
|
||||
{
|
||||
if (imp->fill &&
|
||||
((*imp->fill) (imp, bits, stride, bpp, x, y, width, height, xor)))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
imp = imp->fallback;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
pixman_bool_t
|
||||
_pixman_implementation_src_iter_init (pixman_implementation_t *imp,
|
||||
pixman_iter_t *iter,
|
||||
pixman_image_t *image,
|
||||
|
@ -203,10 +282,18 @@ _pixman_implementation_src_iter_init (pixman_implementation_t *imp,
|
|||
iter->iter_flags = iter_flags;
|
||||
iter->image_flags = image_flags;
|
||||
|
||||
(*imp->src_iter_init) (imp, iter);
|
||||
while (imp)
|
||||
{
|
||||
if (imp->src_iter_init && (*imp->src_iter_init) (imp, iter))
|
||||
return TRUE;
|
||||
|
||||
imp = imp->fallback;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
pixman_bool_t
|
||||
_pixman_implementation_dest_iter_init (pixman_implementation_t *imp,
|
||||
pixman_iter_t *iter,
|
||||
pixman_image_t *image,
|
||||
|
@ -227,7 +314,15 @@ _pixman_implementation_dest_iter_init (pixman_implementation_t *imp,
|
|||
iter->iter_flags = iter_flags;
|
||||
iter->image_flags = image_flags;
|
||||
|
||||
(*imp->dest_iter_init) (imp, iter);
|
||||
while (imp)
|
||||
{
|
||||
if (imp->dest_iter_init && (*imp->dest_iter_init) (imp, iter))
|
||||
return TRUE;
|
||||
|
||||
imp = imp->fallback;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
pixman_bool_t
|
||||
|
|
|
@ -386,7 +386,8 @@ linear_get_scanline_wide (pixman_iter_t *iter, const uint32_t *mask)
|
|||
{
|
||||
uint32_t *buffer = linear_get_scanline_narrow (iter, NULL);
|
||||
|
||||
pixman_expand ((uint64_t *)buffer, buffer, PIXMAN_a8r8g8b8, iter->width);
|
||||
pixman_expand_to_float (
|
||||
(argb_t *)buffer, buffer, PIXMAN_a8r8g8b8, iter->width);
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
@ -419,8 +420,8 @@ _pixman_linear_gradient_iter_init (pixman_image_t *image, pixman_iter_t *iter)
|
|||
}
|
||||
|
||||
PIXMAN_EXPORT pixman_image_t *
|
||||
pixman_image_create_linear_gradient (pixman_point_fixed_t * p1,
|
||||
pixman_point_fixed_t * p2,
|
||||
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)
|
||||
{
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -600,6 +600,28 @@ LEAF_MIPS32R2(symbol) \
|
|||
addu_s.qb \out_8888, \out_8888, \d_8888
|
||||
.endm
|
||||
|
||||
.macro MIPS_2xUN8x4_MUL_2xUN8_ADD_2xUN8x4 s1_8888, \
|
||||
s2_8888, \
|
||||
m1_8, \
|
||||
m2_8, \
|
||||
d1_8888, \
|
||||
d2_8888, \
|
||||
out1_8888, \
|
||||
out2_8888, \
|
||||
maskLSR, \
|
||||
scratch1, scratch2, scratch3, \
|
||||
scratch4, scratch5, scratch6
|
||||
MIPS_2xUN8x4_MUL_2xUN8 \s1_8888, \s2_8888, \
|
||||
\m1_8, \m2_8, \
|
||||
\out1_8888, \out2_8888, \
|
||||
\maskLSR, \
|
||||
\scratch1, \scratch2, \scratch3, \
|
||||
\scratch4, \scratch5, \scratch6
|
||||
|
||||
addu_s.qb \out1_8888, \out1_8888, \d1_8888
|
||||
addu_s.qb \out2_8888, \out2_8888, \d2_8888
|
||||
.endm
|
||||
|
||||
.macro BILINEAR_INTERPOLATE_SINGLE_PIXEL tl, tr, bl, br, \
|
||||
scratch1, scratch2, \
|
||||
alpha, red, green, blue \
|
||||
|
|
|
@ -48,6 +48,12 @@ PIXMAN_MIPS_BIND_FAST_PATH_SRC_DST (DO_FAST_MEMCPY, src_8888_8888,
|
|||
uint32_t, 1, uint32_t, 1)
|
||||
PIXMAN_MIPS_BIND_FAST_PATH_SRC_DST (DO_FAST_MEMCPY, src_0888_0888,
|
||||
uint8_t, 3, uint8_t, 3)
|
||||
PIXMAN_MIPS_BIND_FAST_PATH_SRC_DST (0, over_8888_8888,
|
||||
uint32_t, 1, uint32_t, 1)
|
||||
PIXMAN_MIPS_BIND_FAST_PATH_SRC_DST (0, add_8_8,
|
||||
uint8_t, 1, uint8_t, 1)
|
||||
PIXMAN_MIPS_BIND_FAST_PATH_SRC_DST (0, add_8888_8888,
|
||||
uint32_t, 1, uint32_t, 1)
|
||||
|
||||
PIXMAN_MIPS_BIND_FAST_PATH_N_MASK_DST (SKIP_ZERO_SRC, over_n_8888_8888_ca,
|
||||
uint32_t, 1, uint32_t, 1)
|
||||
|
@ -57,6 +63,36 @@ PIXMAN_MIPS_BIND_FAST_PATH_N_MASK_DST (SKIP_ZERO_SRC, over_n_8_8888,
|
|||
uint8_t, 1, uint32_t, 1)
|
||||
PIXMAN_MIPS_BIND_FAST_PATH_N_MASK_DST (SKIP_ZERO_SRC, over_n_8_0565,
|
||||
uint8_t, 1, uint16_t, 1)
|
||||
PIXMAN_MIPS_BIND_FAST_PATH_N_MASK_DST (SKIP_ZERO_SRC, add_n_8_8,
|
||||
uint8_t, 1, uint8_t, 1)
|
||||
PIXMAN_MIPS_BIND_FAST_PATH_N_MASK_DST (SKIP_ZERO_SRC, add_n_8_8888,
|
||||
uint8_t, 1, uint32_t, 1)
|
||||
|
||||
PIXMAN_MIPS_BIND_FAST_PATH_SRC_N_DST (SKIP_ZERO_MASK, over_8888_n_8888,
|
||||
uint32_t, 1, uint32_t, 1)
|
||||
PIXMAN_MIPS_BIND_FAST_PATH_SRC_N_DST (SKIP_ZERO_MASK, over_8888_n_0565,
|
||||
uint32_t, 1, uint16_t, 1)
|
||||
PIXMAN_MIPS_BIND_FAST_PATH_SRC_N_DST (SKIP_ZERO_MASK, over_0565_n_0565,
|
||||
uint16_t, 1, uint16_t, 1)
|
||||
PIXMAN_MIPS_BIND_FAST_PATH_SRC_N_DST (SKIP_ZERO_MASK, add_8888_n_8888,
|
||||
uint32_t, 1, uint32_t, 1)
|
||||
|
||||
PIXMAN_MIPS_BIND_FAST_PATH_SRC_MASK_DST (add_8_8_8, uint8_t, 1,
|
||||
uint8_t, 1, uint8_t, 1)
|
||||
PIXMAN_MIPS_BIND_FAST_PATH_SRC_MASK_DST (add_8888_8_8888, uint32_t, 1,
|
||||
uint8_t, 1, uint32_t, 1)
|
||||
PIXMAN_MIPS_BIND_FAST_PATH_SRC_MASK_DST (add_8888_8888_8888, uint32_t, 1,
|
||||
uint32_t, 1, uint32_t, 1)
|
||||
PIXMAN_MIPS_BIND_FAST_PATH_SRC_MASK_DST (add_0565_8_0565, uint16_t, 1,
|
||||
uint8_t, 1, uint16_t, 1)
|
||||
PIXMAN_MIPS_BIND_FAST_PATH_SRC_MASK_DST (over_8888_8_8888, uint32_t, 1,
|
||||
uint8_t, 1, uint32_t, 1)
|
||||
PIXMAN_MIPS_BIND_FAST_PATH_SRC_MASK_DST (over_8888_8_0565, uint32_t, 1,
|
||||
uint8_t, 1, uint16_t, 1)
|
||||
PIXMAN_MIPS_BIND_FAST_PATH_SRC_MASK_DST (over_0565_8_0565, uint16_t, 1,
|
||||
uint8_t, 1, uint16_t, 1)
|
||||
PIXMAN_MIPS_BIND_FAST_PATH_SRC_MASK_DST (over_8888_8888_8888, uint32_t, 1,
|
||||
uint32_t, 1, uint32_t, 1)
|
||||
|
||||
PIXMAN_MIPS_BIND_SCALED_BILINEAR_SRC_DST (0, 8888_8888, SRC,
|
||||
uint32_t, uint32_t)
|
||||
|
@ -85,14 +121,15 @@ PIXMAN_MIPS_BIND_SCALED_BILINEAR_SRC_A8_DST (SKIP_ZERO_SRC, 8888_8_8888, ADD,
|
|||
uint32_t, uint32_t)
|
||||
|
||||
static pixman_bool_t
|
||||
pixman_fill_mips (uint32_t *bits,
|
||||
int stride,
|
||||
int bpp,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height,
|
||||
uint32_t _xor)
|
||||
mips_dspr2_fill (pixman_implementation_t *imp,
|
||||
uint32_t * bits,
|
||||
int stride,
|
||||
int bpp,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height,
|
||||
uint32_t _xor)
|
||||
{
|
||||
uint8_t *byte_line;
|
||||
uint32_t byte_width;
|
||||
|
@ -130,18 +167,19 @@ pixman_fill_mips (uint32_t *bits,
|
|||
}
|
||||
|
||||
static pixman_bool_t
|
||||
pixman_blt_mips (uint32_t *src_bits,
|
||||
uint32_t *dst_bits,
|
||||
int src_stride,
|
||||
int dst_stride,
|
||||
int src_bpp,
|
||||
int dst_bpp,
|
||||
int src_x,
|
||||
int src_y,
|
||||
int dest_x,
|
||||
int dest_y,
|
||||
int width,
|
||||
int height)
|
||||
mips_dspr2_blt (pixman_implementation_t *imp,
|
||||
uint32_t * src_bits,
|
||||
uint32_t * dst_bits,
|
||||
int src_stride,
|
||||
int dst_stride,
|
||||
int src_bpp,
|
||||
int dst_bpp,
|
||||
int src_x,
|
||||
int src_y,
|
||||
int dest_x,
|
||||
int dest_y,
|
||||
int width,
|
||||
int height)
|
||||
{
|
||||
if (src_bpp != dst_bpp)
|
||||
return FALSE;
|
||||
|
@ -232,6 +270,40 @@ static const pixman_fast_path_t mips_dspr2_fast_paths[] =
|
|||
PIXMAN_STD_FAST_PATH (OVER, solid, a8, r5g6b5, mips_composite_over_n_8_0565),
|
||||
PIXMAN_STD_FAST_PATH (OVER, solid, a8, b5g6r5, mips_composite_over_n_8_0565),
|
||||
|
||||
PIXMAN_STD_FAST_PATH (OVER, a8r8g8b8, solid, a8r8g8b8, mips_composite_over_8888_n_8888),
|
||||
PIXMAN_STD_FAST_PATH (OVER, a8r8g8b8, solid, x8r8g8b8, mips_composite_over_8888_n_8888),
|
||||
PIXMAN_STD_FAST_PATH (OVER, a8r8g8b8, solid, r5g6b5, mips_composite_over_8888_n_0565),
|
||||
PIXMAN_STD_FAST_PATH (OVER, a8b8g8r8, solid, b5g6r5, mips_composite_over_8888_n_0565),
|
||||
PIXMAN_STD_FAST_PATH (OVER, r5g6b5, solid, r5g6b5, mips_composite_over_0565_n_0565),
|
||||
PIXMAN_STD_FAST_PATH (OVER, b5g6r5, solid, b5g6r5, mips_composite_over_0565_n_0565),
|
||||
PIXMAN_STD_FAST_PATH (OVER, a8r8g8b8, a8, a8r8g8b8, mips_composite_over_8888_8_8888),
|
||||
PIXMAN_STD_FAST_PATH (OVER, a8r8g8b8, a8, x8r8g8b8, mips_composite_over_8888_8_8888),
|
||||
PIXMAN_STD_FAST_PATH (OVER, a8b8g8r8, a8, a8b8g8r8, mips_composite_over_8888_8_8888),
|
||||
PIXMAN_STD_FAST_PATH (OVER, a8b8g8r8, a8, x8b8g8r8, mips_composite_over_8888_8_8888),
|
||||
PIXMAN_STD_FAST_PATH (OVER, a8r8g8b8, a8, r5g6b5, mips_composite_over_8888_8_0565),
|
||||
PIXMAN_STD_FAST_PATH (OVER, a8b8g8r8, a8, b5g6r5, mips_composite_over_8888_8_0565),
|
||||
PIXMAN_STD_FAST_PATH (OVER, r5g6b5, a8, r5g6b5, mips_composite_over_0565_8_0565),
|
||||
PIXMAN_STD_FAST_PATH (OVER, b5g6r5, a8, b5g6r5, mips_composite_over_0565_8_0565),
|
||||
PIXMAN_STD_FAST_PATH (OVER, a8r8g8b8, a8r8g8b8, a8r8g8b8, mips_composite_over_8888_8888_8888),
|
||||
PIXMAN_STD_FAST_PATH (OVER, a8r8g8b8, null, a8r8g8b8, mips_composite_over_8888_8888),
|
||||
PIXMAN_STD_FAST_PATH (OVER, a8r8g8b8, null, x8r8g8b8, mips_composite_over_8888_8888),
|
||||
PIXMAN_STD_FAST_PATH (OVER, a8b8g8r8, null, a8b8g8r8, mips_composite_over_8888_8888),
|
||||
PIXMAN_STD_FAST_PATH (OVER, a8b8g8r8, null, x8b8g8r8, mips_composite_over_8888_8888),
|
||||
PIXMAN_STD_FAST_PATH (ADD, solid, a8, a8, mips_composite_add_n_8_8),
|
||||
PIXMAN_STD_FAST_PATH (ADD, solid, a8, a8r8g8b8, mips_composite_add_n_8_8888),
|
||||
PIXMAN_STD_FAST_PATH (ADD, solid, a8, a8b8g8r8, mips_composite_add_n_8_8888),
|
||||
PIXMAN_STD_FAST_PATH (ADD, a8, a8, a8, mips_composite_add_8_8_8),
|
||||
PIXMAN_STD_FAST_PATH (ADD, r5g6b5, a8, r5g6b5, mips_composite_add_0565_8_0565),
|
||||
PIXMAN_STD_FAST_PATH (ADD, b5g6r5, a8, b5g6r5, mips_composite_add_0565_8_0565),
|
||||
PIXMAN_STD_FAST_PATH (ADD, a8r8g8b8, a8, a8r8g8b8, mips_composite_add_8888_8_8888),
|
||||
PIXMAN_STD_FAST_PATH (ADD, a8b8g8r8, a8, a8b8g8r8, mips_composite_add_8888_8_8888),
|
||||
PIXMAN_STD_FAST_PATH (ADD, a8r8g8b8, a8r8g8b8, a8r8g8b8, mips_composite_add_8888_8888_8888),
|
||||
PIXMAN_STD_FAST_PATH (ADD, a8r8g8b8, solid, a8r8g8b8, mips_composite_add_8888_n_8888),
|
||||
PIXMAN_STD_FAST_PATH (ADD, a8b8g8r8, solid, a8b8g8r8, mips_composite_add_8888_n_8888),
|
||||
PIXMAN_STD_FAST_PATH (ADD, a8, null, a8, mips_composite_add_8_8),
|
||||
PIXMAN_STD_FAST_PATH (ADD, a8r8g8b8, null, a8r8g8b8, mips_composite_add_8888_8888),
|
||||
PIXMAN_STD_FAST_PATH (ADD, a8b8g8r8, null, a8b8g8r8, mips_composite_add_8888_8888),
|
||||
|
||||
SIMPLE_BILINEAR_FAST_PATH (SRC, a8r8g8b8, a8r8g8b8, mips_8888_8888),
|
||||
SIMPLE_BILINEAR_FAST_PATH (SRC, a8r8g8b8, x8r8g8b8, mips_8888_8888),
|
||||
SIMPLE_BILINEAR_FAST_PATH (SRC, x8r8g8b8, x8r8g8b8, mips_8888_8888),
|
||||
|
@ -266,51 +338,20 @@ static const pixman_fast_path_t mips_dspr2_fast_paths[] =
|
|||
{ PIXMAN_OP_NONE },
|
||||
};
|
||||
|
||||
static pixman_bool_t
|
||||
mips_dspr2_blt (pixman_implementation_t *imp,
|
||||
uint32_t * src_bits,
|
||||
uint32_t * dst_bits,
|
||||
int src_stride,
|
||||
int dst_stride,
|
||||
int src_bpp,
|
||||
int dst_bpp,
|
||||
int src_x,
|
||||
int src_y,
|
||||
int dest_x,
|
||||
int dest_y,
|
||||
int width,
|
||||
int height)
|
||||
static void
|
||||
mips_dspr2_combine_over_u (pixman_implementation_t *imp,
|
||||
pixman_op_t op,
|
||||
uint32_t * dest,
|
||||
const uint32_t * src,
|
||||
const uint32_t * mask,
|
||||
int width)
|
||||
{
|
||||
if (!pixman_blt_mips (
|
||||
src_bits, dst_bits, src_stride, dst_stride, src_bpp, dst_bpp,
|
||||
src_x, src_y, dest_x, dest_y, width, height))
|
||||
|
||||
{
|
||||
return _pixman_implementation_blt (
|
||||
imp->delegate,
|
||||
src_bits, dst_bits, src_stride, dst_stride, src_bpp, dst_bpp,
|
||||
src_x, src_y, dest_x, dest_y, width, height);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static pixman_bool_t
|
||||
mips_dspr2_fill (pixman_implementation_t *imp,
|
||||
uint32_t * bits,
|
||||
int stride,
|
||||
int bpp,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height,
|
||||
uint32_t xor)
|
||||
{
|
||||
if (pixman_fill_mips (bits, stride, bpp, x, y, width, height, xor))
|
||||
return TRUE;
|
||||
|
||||
return _pixman_implementation_fill (
|
||||
imp->delegate, bits, stride, bpp, x, y, width, height, xor);
|
||||
if (mask)
|
||||
pixman_composite_over_8888_8888_8888_asm_mips (
|
||||
dest, (uint32_t *)src, (uint32_t *)mask, width);
|
||||
else
|
||||
pixman_composite_over_8888_8888_asm_mips (
|
||||
dest, (uint32_t *)src, width);
|
||||
}
|
||||
|
||||
pixman_implementation_t *
|
||||
|
@ -319,6 +360,8 @@ _pixman_implementation_create_mips_dspr2 (pixman_implementation_t *fallback)
|
|||
pixman_implementation_t *imp =
|
||||
_pixman_implementation_create (fallback, mips_dspr2_fast_paths);
|
||||
|
||||
imp->combine_32[PIXMAN_OP_OVER] = mips_dspr2_combine_over_u;
|
||||
|
||||
imp->blt = mips_dspr2_blt;
|
||||
imp->fill = mips_dspr2_fill;
|
||||
|
||||
|
|
|
@ -127,6 +127,89 @@ mips_composite_##name (pixman_implementation_t *imp, \
|
|||
} \
|
||||
}
|
||||
|
||||
/*******************************************************************/
|
||||
|
||||
#define PIXMAN_MIPS_BIND_FAST_PATH_SRC_N_DST(flags, name, \
|
||||
src_type, src_cnt, \
|
||||
dst_type, dst_cnt) \
|
||||
void \
|
||||
pixman_composite_##name##_asm_mips (dst_type *dst, \
|
||||
src_type *src, \
|
||||
uint32_t mask, \
|
||||
int32_t w); \
|
||||
\
|
||||
static void \
|
||||
mips_composite_##name (pixman_implementation_t *imp, \
|
||||
pixman_composite_info_t *info) \
|
||||
{ \
|
||||
PIXMAN_COMPOSITE_ARGS (info); \
|
||||
dst_type *dst_line, *dst; \
|
||||
src_type *src_line, *src; \
|
||||
int32_t dst_stride, src_stride; \
|
||||
uint32_t mask; \
|
||||
\
|
||||
mask = _pixman_image_get_solid ( \
|
||||
imp, mask_image, dest_image->bits.format); \
|
||||
\
|
||||
if ((flags & SKIP_ZERO_MASK) && mask == 0) \
|
||||
return; \
|
||||
\
|
||||
PIXMAN_IMAGE_GET_LINE (dest_image, dest_x, dest_y, dst_type, \
|
||||
dst_stride, dst_line, dst_cnt); \
|
||||
PIXMAN_IMAGE_GET_LINE (src_image, src_x, src_y, src_type, \
|
||||
src_stride, src_line, src_cnt); \
|
||||
\
|
||||
while (height--) \
|
||||
{ \
|
||||
dst = dst_line; \
|
||||
dst_line += dst_stride; \
|
||||
src = src_line; \
|
||||
src_line += src_stride; \
|
||||
\
|
||||
pixman_composite_##name##_asm_mips (dst, src, mask, width); \
|
||||
} \
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
#define PIXMAN_MIPS_BIND_FAST_PATH_SRC_MASK_DST(name, src_type, src_cnt, \
|
||||
mask_type, mask_cnt, \
|
||||
dst_type, dst_cnt) \
|
||||
void \
|
||||
pixman_composite_##name##_asm_mips (dst_type *dst, \
|
||||
src_type *src, \
|
||||
mask_type *mask, \
|
||||
int32_t w); \
|
||||
\
|
||||
static void \
|
||||
mips_composite_##name (pixman_implementation_t *imp, \
|
||||
pixman_composite_info_t *info) \
|
||||
{ \
|
||||
PIXMAN_COMPOSITE_ARGS (info); \
|
||||
dst_type *dst_line, *dst; \
|
||||
src_type *src_line, *src; \
|
||||
mask_type *mask_line, *mask; \
|
||||
int32_t dst_stride, src_stride, mask_stride; \
|
||||
\
|
||||
PIXMAN_IMAGE_GET_LINE (dest_image, dest_x, dest_y, dst_type, \
|
||||
dst_stride, dst_line, dst_cnt); \
|
||||
PIXMAN_IMAGE_GET_LINE (src_image, src_x, src_y, src_type, \
|
||||
src_stride, src_line, src_cnt); \
|
||||
PIXMAN_IMAGE_GET_LINE (mask_image, mask_x, mask_y, mask_type, \
|
||||
mask_stride, mask_line, mask_cnt); \
|
||||
\
|
||||
while (height--) \
|
||||
{ \
|
||||
dst = dst_line; \
|
||||
dst_line += dst_stride; \
|
||||
mask = mask_line; \
|
||||
mask_line += mask_stride; \
|
||||
src = src_line; \
|
||||
src_line += src_stride; \
|
||||
pixman_composite_##name##_asm_mips (dst, src, mask, width); \
|
||||
} \
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define PIXMAN_MIPS_BIND_SCALED_BILINEAR_SRC_DST(flags, name, op, \
|
||||
|
|
|
@ -75,9 +75,19 @@ _pixman_mips_get_implementations (pixman_implementation_t *imp)
|
|||
#endif
|
||||
|
||||
#ifdef USE_MIPS_DSPR2
|
||||
/* Only currently available MIPS core that supports DSPr2 is 74K. */
|
||||
if (!_pixman_disabled ("mips-dspr2") && have_feature ("MIPS 74K"))
|
||||
imp = _pixman_implementation_create_mips_dspr2 (imp);
|
||||
if (!_pixman_disabled ("mips-dspr2"))
|
||||
{
|
||||
int already_compiling_everything_for_dspr2 = 0;
|
||||
#if defined(__mips_dsp) && (__mips_dsp_rev >= 2)
|
||||
already_compiling_everything_for_dspr2 = 1;
|
||||
#endif
|
||||
if (already_compiling_everything_for_dspr2 ||
|
||||
/* Only currently available MIPS core that supports DSPr2 is 74K. */
|
||||
have_feature ("MIPS 74K"))
|
||||
{
|
||||
imp = _pixman_implementation_create_mips_dspr2 (imp);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return imp;
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
#define CHECKPOINT()
|
||||
#endif
|
||||
|
||||
#ifdef USE_ARM_IWMMXT
|
||||
#if defined USE_ARM_IWMMXT && __GNUC__ == 4 && __GNUC_MINOR__ < 8
|
||||
/* Empty the multimedia state. For some reason, ARM's mmintrin.h doesn't provide this. */
|
||||
extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
|
||||
_mm_empty (void)
|
||||
|
@ -541,7 +541,7 @@ expand565 (__m64 pixel, int pos)
|
|||
static force_inline void
|
||||
expand_4xpacked565 (__m64 vin, __m64 *vout0, __m64 *vout1, int full_alpha)
|
||||
{
|
||||
__m64 t0, t1, alpha = _mm_setzero_si64 ();;
|
||||
__m64 t0, t1, alpha = _mm_setzero_si64 ();
|
||||
__m64 r = _mm_and_si64 (vin, MC (expand_565_r));
|
||||
__m64 g = _mm_and_si64 (vin, MC (expand_565_g));
|
||||
__m64 b = _mm_and_si64 (vin, MC (expand_565_b));
|
||||
|
@ -1903,13 +1903,14 @@ mmx_composite_over_8888_0565 (pixman_implementation_t *imp,
|
|||
{
|
||||
__m64 vdest = *(__m64 *)dst;
|
||||
__m64 v0, v1, v2, v3;
|
||||
__m64 vsrc0, vsrc1, vsrc2, vsrc3;
|
||||
|
||||
expand_4x565 (vdest, &v0, &v1, &v2, &v3, 0);
|
||||
|
||||
__m64 vsrc0 = load8888 ((src + 0));
|
||||
__m64 vsrc1 = load8888 ((src + 1));
|
||||
__m64 vsrc2 = load8888 ((src + 2));
|
||||
__m64 vsrc3 = load8888 ((src + 3));
|
||||
vsrc0 = load8888 ((src + 0));
|
||||
vsrc1 = load8888 ((src + 1));
|
||||
vsrc2 = load8888 ((src + 2));
|
||||
vsrc3 = load8888 ((src + 3));
|
||||
|
||||
v0 = over (vsrc0, expand_alpha (vsrc0), v0);
|
||||
v1 = over (vsrc1, expand_alpha (vsrc1), v1);
|
||||
|
@ -2054,15 +2055,16 @@ mmx_composite_over_n_8_8888 (pixman_implementation_t *imp,
|
|||
_mm_empty ();
|
||||
}
|
||||
|
||||
pixman_bool_t
|
||||
pixman_fill_mmx (uint32_t *bits,
|
||||
int stride,
|
||||
int bpp,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height,
|
||||
uint32_t xor)
|
||||
static pixman_bool_t
|
||||
mmx_fill (pixman_implementation_t *imp,
|
||||
uint32_t * bits,
|
||||
int stride,
|
||||
int bpp,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height,
|
||||
uint32_t xor)
|
||||
{
|
||||
uint64_t fill;
|
||||
__m64 vfill;
|
||||
|
@ -2280,9 +2282,9 @@ mmx_composite_src_n_8_8888 (pixman_implementation_t *imp,
|
|||
srca = src >> 24;
|
||||
if (src == 0)
|
||||
{
|
||||
pixman_fill_mmx (dest_image->bits.bits, dest_image->bits.rowstride,
|
||||
PIXMAN_FORMAT_BPP (dest_image->bits.format),
|
||||
dest_x, dest_y, width, height, 0);
|
||||
mmx_fill (imp, dest_image->bits.bits, dest_image->bits.rowstride,
|
||||
PIXMAN_FORMAT_BPP (dest_image->bits.format),
|
||||
dest_x, dest_y, width, height, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2455,19 +2457,20 @@ mmx_composite_over_n_8_0565 (pixman_implementation_t *imp,
|
|||
{
|
||||
__m64 vdest = *(__m64 *)dst;
|
||||
__m64 v0, v1, v2, v3;
|
||||
__m64 vm0, vm1, vm2, vm3;
|
||||
|
||||
expand_4x565 (vdest, &v0, &v1, &v2, &v3, 0);
|
||||
|
||||
__m64 vm0 = to_m64 (m0);
|
||||
vm0 = to_m64 (m0);
|
||||
v0 = in_over (vsrc, vsrca, expand_alpha_rev (vm0), v0);
|
||||
|
||||
__m64 vm1 = to_m64 (m1);
|
||||
vm1 = to_m64 (m1);
|
||||
v1 = in_over (vsrc, vsrca, expand_alpha_rev (vm1), v1);
|
||||
|
||||
__m64 vm2 = to_m64 (m2);
|
||||
vm2 = to_m64 (m2);
|
||||
v2 = in_over (vsrc, vsrca, expand_alpha_rev (vm2), v2);
|
||||
|
||||
__m64 vm3 = to_m64 (m3);
|
||||
vm3 = to_m64 (m3);
|
||||
v3 = in_over (vsrc, vsrca, expand_alpha_rev (vm3), v3);
|
||||
|
||||
*(__m64 *)dst = pack_4x565 (v0, v1, v2, v3);;
|
||||
|
@ -3238,18 +3241,19 @@ mmx_composite_add_8888_8888 (pixman_implementation_t *imp,
|
|||
}
|
||||
|
||||
static pixman_bool_t
|
||||
pixman_blt_mmx (uint32_t *src_bits,
|
||||
uint32_t *dst_bits,
|
||||
int src_stride,
|
||||
int dst_stride,
|
||||
int src_bpp,
|
||||
int dst_bpp,
|
||||
int src_x,
|
||||
int src_y,
|
||||
int dest_x,
|
||||
int dest_y,
|
||||
int width,
|
||||
int height)
|
||||
mmx_blt (pixman_implementation_t *imp,
|
||||
uint32_t * src_bits,
|
||||
uint32_t * dst_bits,
|
||||
int src_stride,
|
||||
int dst_stride,
|
||||
int src_bpp,
|
||||
int dst_bpp,
|
||||
int src_x,
|
||||
int src_y,
|
||||
int dest_x,
|
||||
int dest_y,
|
||||
int width,
|
||||
int height)
|
||||
{
|
||||
uint8_t * src_bytes;
|
||||
uint8_t * dst_bytes;
|
||||
|
@ -3394,13 +3398,13 @@ mmx_composite_copy_area (pixman_implementation_t *imp,
|
|||
{
|
||||
PIXMAN_COMPOSITE_ARGS (info);
|
||||
|
||||
pixman_blt_mmx (src_image->bits.bits,
|
||||
dest_image->bits.bits,
|
||||
src_image->bits.rowstride,
|
||||
dest_image->bits.rowstride,
|
||||
PIXMAN_FORMAT_BPP (src_image->bits.format),
|
||||
PIXMAN_FORMAT_BPP (dest_image->bits.format),
|
||||
src_x, src_y, dest_x, dest_y, width, height);
|
||||
mmx_blt (imp, src_image->bits.bits,
|
||||
dest_image->bits.bits,
|
||||
src_image->bits.rowstride,
|
||||
dest_image->bits.rowstride,
|
||||
PIXMAN_FORMAT_BPP (src_image->bits.format),
|
||||
PIXMAN_FORMAT_BPP (dest_image->bits.format),
|
||||
src_x, src_y, dest_x, dest_y, width, height);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -3548,7 +3552,6 @@ do { \
|
|||
/* fetch 2x2 pixel block into 2 mmx registers */ \
|
||||
__m64 t = ldq_u ((__m64 *)&src_top [pixman_fixed_to_int (vx)]); \
|
||||
__m64 b = ldq_u ((__m64 *)&src_bottom [pixman_fixed_to_int (vx)]); \
|
||||
vx += unit_x; \
|
||||
/* vertical interpolation */ \
|
||||
__m64 t_hi = _mm_mullo_pi16 (_mm_unpackhi_pi8 (t, mm_zero), mm_wt); \
|
||||
__m64 t_lo = _mm_mullo_pi16 (_mm_unpacklo_pi8 (t, mm_zero), mm_wt); \
|
||||
|
@ -3556,13 +3559,13 @@ do { \
|
|||
__m64 b_lo = _mm_mullo_pi16 (_mm_unpacklo_pi8 (b, mm_zero), mm_wb); \
|
||||
__m64 hi = _mm_add_pi16 (t_hi, b_hi); \
|
||||
__m64 lo = _mm_add_pi16 (t_lo, b_lo); \
|
||||
vx += unit_x; \
|
||||
if (BILINEAR_INTERPOLATION_BITS < 8) \
|
||||
{ \
|
||||
/* calculate horizontal weights */ \
|
||||
__m64 mm_wh = _mm_add_pi16 (mm_addc7, _mm_xor_si64 (mm_xorc7, \
|
||||
_mm_srli_pi16 (mm_x, \
|
||||
16 - BILINEAR_INTERPOLATION_BITS))); \
|
||||
mm_x = _mm_add_pi16 (mm_x, mm_ux); \
|
||||
/* horizontal interpolation */ \
|
||||
__m64 p = _mm_unpacklo_pi16 (lo, hi); \
|
||||
__m64 q = _mm_unpackhi_pi16 (lo, hi); \
|
||||
|
@ -3576,7 +3579,6 @@ do { \
|
|||
16 - BILINEAR_INTERPOLATION_BITS)); \
|
||||
__m64 mm_wh_hi = _mm_srli_pi16 (mm_x, \
|
||||
16 - BILINEAR_INTERPOLATION_BITS); \
|
||||
mm_x = _mm_add_pi16 (mm_x, mm_ux); \
|
||||
/* horizontal interpolation */ \
|
||||
__m64 mm_lo_lo = _mm_mullo_pi16 (lo, mm_wh_lo); \
|
||||
__m64 mm_lo_hi = _mm_mullo_pi16 (hi, mm_wh_hi); \
|
||||
|
@ -3587,6 +3589,7 @@ do { \
|
|||
hi = _mm_add_pi32 (_mm_unpackhi_pi16 (mm_lo_lo, mm_hi_lo), \
|
||||
_mm_unpackhi_pi16 (mm_lo_hi, mm_hi_hi)); \
|
||||
} \
|
||||
mm_x = _mm_add_pi16 (mm_x, mm_ux); \
|
||||
/* shift and pack the result */ \
|
||||
hi = _mm_srli_pi32 (hi, BILINEAR_INTERPOLATION_BITS * 2); \
|
||||
lo = _mm_srli_pi32 (lo, BILINEAR_INTERPOLATION_BITS * 2); \
|
||||
|
@ -3912,7 +3915,7 @@ static const fetcher_info_t fetchers[] =
|
|||
{ PIXMAN_null }
|
||||
};
|
||||
|
||||
static void
|
||||
static pixman_bool_t
|
||||
mmx_src_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter)
|
||||
{
|
||||
pixman_image_t *image = iter->image;
|
||||
|
@ -3937,12 +3940,12 @@ mmx_src_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter)
|
|||
iter->stride = s;
|
||||
|
||||
iter->get_scanline = f->get_scanline;
|
||||
return;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
imp->delegate->src_iter_init (imp->delegate, iter);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static const pixman_fast_path_t mmx_fast_paths[] =
|
||||
|
@ -4041,55 +4044,6 @@ static const pixman_fast_path_t mmx_fast_paths[] =
|
|||
{ PIXMAN_OP_NONE },
|
||||
};
|
||||
|
||||
static pixman_bool_t
|
||||
mmx_blt (pixman_implementation_t *imp,
|
||||
uint32_t * src_bits,
|
||||
uint32_t * dst_bits,
|
||||
int src_stride,
|
||||
int dst_stride,
|
||||
int src_bpp,
|
||||
int dst_bpp,
|
||||
int src_x,
|
||||
int src_y,
|
||||
int dest_x,
|
||||
int dest_y,
|
||||
int width,
|
||||
int height)
|
||||
{
|
||||
if (!pixman_blt_mmx (
|
||||
src_bits, dst_bits, src_stride, dst_stride, src_bpp, dst_bpp,
|
||||
src_x, src_y, dest_x, dest_y, width, height))
|
||||
|
||||
{
|
||||
return _pixman_implementation_blt (
|
||||
imp->delegate,
|
||||
src_bits, dst_bits, src_stride, dst_stride, src_bpp, dst_bpp,
|
||||
src_x, src_y, dest_x, dest_y, width, height);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static pixman_bool_t
|
||||
mmx_fill (pixman_implementation_t *imp,
|
||||
uint32_t * bits,
|
||||
int stride,
|
||||
int bpp,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height,
|
||||
uint32_t xor)
|
||||
{
|
||||
if (!pixman_fill_mmx (bits, stride, bpp, x, y, width, height, xor))
|
||||
{
|
||||
return _pixman_implementation_fill (
|
||||
imp->delegate, bits, stride, bpp, x, y, width, height, xor);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
pixman_implementation_t *
|
||||
_pixman_implementation_create_mmx (pixman_implementation_t *fallback)
|
||||
{
|
||||
|
|
|
@ -59,7 +59,7 @@ get_scanline_null (pixman_iter_t *iter, const uint32_t *mask)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
static pixman_bool_t
|
||||
noop_src_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter)
|
||||
{
|
||||
pixman_image_t *image = iter->image;
|
||||
|
@ -93,9 +93,9 @@ noop_src_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter)
|
|||
}
|
||||
else
|
||||
{
|
||||
uint64_t color = bits->fetch_pixel_64 (bits, 0, 0);
|
||||
uint64_t *buffer = (uint64_t *)iter->buffer;
|
||||
uint64_t *end = buffer + iter->width;
|
||||
argb_t color = bits->fetch_pixel_float (bits, 0, 0);
|
||||
argb_t *buffer = (argb_t *)iter->buffer;
|
||||
argb_t *end = buffer + iter->width;
|
||||
|
||||
while (buffer < end)
|
||||
*(buffer++) = color;
|
||||
|
@ -117,11 +117,13 @@ noop_src_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter)
|
|||
}
|
||||
else
|
||||
{
|
||||
(* imp->delegate->src_iter_init) (imp->delegate, iter);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
static pixman_bool_t
|
||||
noop_dest_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter)
|
||||
{
|
||||
pixman_image_t *image = iter->image;
|
||||
|
@ -138,10 +140,12 @@ noop_dest_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter)
|
|||
|
||||
iter->get_scanline = _pixman_iter_get_scanline_noop;
|
||||
iter->write_back = dest_write_back_direct;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
(* imp->delegate->dest_iter_init) (imp->delegate, iter);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -156,7 +160,7 @@ _pixman_implementation_create_noop (pixman_implementation_t *fallback)
|
|||
{
|
||||
pixman_implementation_t *imp =
|
||||
_pixman_implementation_create (fallback, noop_fast_paths);
|
||||
|
||||
|
||||
imp->src_iter_init = noop_src_iter_init;
|
||||
imp->dest_iter_init = noop_dest_iter_init;
|
||||
|
||||
|
|
|
@ -54,6 +54,16 @@ typedef struct radial_gradient radial_gradient_t;
|
|||
typedef struct bits_image bits_image_t;
|
||||
typedef struct circle circle_t;
|
||||
|
||||
typedef struct argb_t argb_t;
|
||||
|
||||
struct argb_t
|
||||
{
|
||||
float a;
|
||||
float r;
|
||||
float g;
|
||||
float b;
|
||||
};
|
||||
|
||||
typedef void (*fetch_scanline_t) (pixman_image_t *image,
|
||||
int x,
|
||||
int y,
|
||||
|
@ -65,9 +75,9 @@ typedef uint32_t (*fetch_pixel_32_t) (bits_image_t *image,
|
|||
int x,
|
||||
int y);
|
||||
|
||||
typedef uint64_t (*fetch_pixel_64_t) (bits_image_t *image,
|
||||
int x,
|
||||
int y);
|
||||
typedef argb_t (*fetch_pixel_float_t) (bits_image_t *image,
|
||||
int x,
|
||||
int y);
|
||||
|
||||
typedef void (*store_scanline_t) (bits_image_t * image,
|
||||
int x,
|
||||
|
@ -121,9 +131,9 @@ struct solid_fill
|
|||
{
|
||||
image_common_t common;
|
||||
pixman_color_t color;
|
||||
|
||||
|
||||
uint32_t color_32;
|
||||
uint64_t color_64;
|
||||
argb_t color_float;
|
||||
};
|
||||
|
||||
struct gradient
|
||||
|
@ -184,9 +194,9 @@ struct bits_image
|
|||
fetch_pixel_32_t fetch_pixel_32;
|
||||
store_scanline_t store_scanline_32;
|
||||
|
||||
fetch_scanline_t fetch_scanline_64;
|
||||
fetch_pixel_64_t fetch_pixel_64;
|
||||
store_scanline_t store_scanline_64;
|
||||
fetch_scanline_t fetch_scanline_float;
|
||||
fetch_pixel_float_t fetch_pixel_float;
|
||||
store_scanline_t store_scanline_float;
|
||||
|
||||
store_scanline_t store_scanline_16;
|
||||
|
||||
|
@ -293,7 +303,8 @@ _pixman_bits_image_init (pixman_image_t * image,
|
|||
int width,
|
||||
int height,
|
||||
uint32_t * bits,
|
||||
int rowstride);
|
||||
int rowstride,
|
||||
pixman_bool_t clear);
|
||||
pixman_bool_t
|
||||
_pixman_image_fini (pixman_image_t *image);
|
||||
|
||||
|
@ -434,12 +445,12 @@ typedef void (*pixman_combine_32_func_t) (pixman_implementation_t *imp,
|
|||
const uint32_t * mask,
|
||||
int width);
|
||||
|
||||
typedef void (*pixman_combine_64_func_t) (pixman_implementation_t *imp,
|
||||
pixman_op_t op,
|
||||
uint64_t * dest,
|
||||
const uint64_t * src,
|
||||
const uint64_t * mask,
|
||||
int width);
|
||||
typedef void (*pixman_combine_float_func_t) (pixman_implementation_t *imp,
|
||||
pixman_op_t op,
|
||||
float * dest,
|
||||
const float * src,
|
||||
const float * mask,
|
||||
int n_pixels);
|
||||
|
||||
typedef void (*pixman_composite_func_t) (pixman_implementation_t *imp,
|
||||
pixman_composite_info_t *info);
|
||||
|
@ -465,12 +476,12 @@ typedef pixman_bool_t (*pixman_fill_func_t) (pixman_implementation_t *imp,
|
|||
int width,
|
||||
int height,
|
||||
uint32_t xor);
|
||||
typedef void (*pixman_iter_init_func_t) (pixman_implementation_t *imp,
|
||||
pixman_iter_t *iter);
|
||||
typedef pixman_bool_t (*pixman_iter_init_func_t) (pixman_implementation_t *imp,
|
||||
pixman_iter_t *iter);
|
||||
|
||||
void _pixman_setup_combiner_functions_16 (pixman_implementation_t *imp);
|
||||
void _pixman_setup_combiner_functions_32 (pixman_implementation_t *imp);
|
||||
void _pixman_setup_combiner_functions_64 (pixman_implementation_t *imp);
|
||||
void _pixman_setup_combiner_functions_float (pixman_implementation_t *imp);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
@ -487,7 +498,7 @@ typedef struct
|
|||
struct pixman_implementation_t
|
||||
{
|
||||
pixman_implementation_t * toplevel;
|
||||
pixman_implementation_t * delegate;
|
||||
pixman_implementation_t * fallback;
|
||||
const pixman_fast_path_t * fast_paths;
|
||||
|
||||
pixman_blt_func_t blt;
|
||||
|
@ -497,9 +508,9 @@ struct pixman_implementation_t
|
|||
|
||||
pixman_combine_32_func_t combine_32[PIXMAN_N_OPERATORS];
|
||||
pixman_combine_32_func_t combine_32_ca[PIXMAN_N_OPERATORS];
|
||||
pixman_combine_64_func_t combine_64[PIXMAN_N_OPERATORS];
|
||||
pixman_combine_64_func_t combine_64_ca[PIXMAN_N_OPERATORS];
|
||||
pixman_combine_64_func_t combine_16[PIXMAN_N_OPERATORS];
|
||||
pixman_combine_float_func_t combine_float[PIXMAN_N_OPERATORS];
|
||||
pixman_combine_float_func_t combine_float_ca[PIXMAN_N_OPERATORS];
|
||||
pixman_combine_32_func_t combine_16[PIXMAN_N_OPERATORS];
|
||||
};
|
||||
|
||||
uint32_t
|
||||
|
@ -508,9 +519,21 @@ _pixman_image_get_solid (pixman_implementation_t *imp,
|
|||
pixman_format_code_t format);
|
||||
|
||||
pixman_implementation_t *
|
||||
_pixman_implementation_create (pixman_implementation_t *delegate,
|
||||
_pixman_implementation_create (pixman_implementation_t *fallback,
|
||||
const pixman_fast_path_t *fast_paths);
|
||||
|
||||
pixman_bool_t
|
||||
_pixman_implementation_lookup_composite (pixman_implementation_t *toplevel,
|
||||
pixman_op_t op,
|
||||
pixman_format_code_t src_format,
|
||||
uint32_t src_flags,
|
||||
pixman_format_code_t mask_format,
|
||||
uint32_t mask_flags,
|
||||
pixman_format_code_t dest_format,
|
||||
uint32_t dest_flags,
|
||||
pixman_implementation_t **out_imp,
|
||||
pixman_composite_func_t *out_func);
|
||||
|
||||
pixman_combine_32_func_t
|
||||
_pixman_implementation_lookup_combiner (pixman_implementation_t *imp,
|
||||
pixman_op_t op,
|
||||
|
@ -544,7 +567,7 @@ _pixman_implementation_fill (pixman_implementation_t *imp,
|
|||
int height,
|
||||
uint32_t xor);
|
||||
|
||||
void
|
||||
pixman_bool_t
|
||||
_pixman_implementation_src_iter_init (pixman_implementation_t *imp,
|
||||
pixman_iter_t *iter,
|
||||
pixman_image_t *image,
|
||||
|
@ -556,7 +579,7 @@ _pixman_implementation_src_iter_init (pixman_implementation_t *imp,
|
|||
iter_flags_t flags,
|
||||
uint32_t image_flags);
|
||||
|
||||
void
|
||||
pixman_bool_t
|
||||
_pixman_implementation_dest_iter_init (pixman_implementation_t *imp,
|
||||
pixman_iter_t *iter,
|
||||
pixman_image_t *image,
|
||||
|
@ -766,6 +789,12 @@ get_implementation (void)
|
|||
return global_implementation;
|
||||
}
|
||||
|
||||
/* This function is exported for the sake of the test suite and not part
|
||||
* of the ABI.
|
||||
*/
|
||||
PIXMAN_EXPORT pixman_implementation_t *
|
||||
_pixman_internal_only_get_implementation (void);
|
||||
|
||||
/* Memory allocation helpers */
|
||||
void *
|
||||
pixman_malloc_ab (unsigned int n, unsigned int b);
|
||||
|
@ -784,27 +813,15 @@ _pixman_addition_overflows_int (unsigned int a, unsigned int b);
|
|||
|
||||
/* Compositing utilities */
|
||||
void
|
||||
pixman_expand (uint64_t * dst,
|
||||
const uint32_t * src,
|
||||
pixman_format_code_t format,
|
||||
int width);
|
||||
pixman_expand_to_float (argb_t *dst,
|
||||
const uint32_t *src,
|
||||
pixman_format_code_t format,
|
||||
int width);
|
||||
|
||||
void
|
||||
pixman_contract (uint32_t * dst,
|
||||
const uint64_t *src,
|
||||
int width);
|
||||
|
||||
pixman_bool_t
|
||||
_pixman_lookup_composite_function (pixman_implementation_t *toplevel,
|
||||
pixman_op_t op,
|
||||
pixman_format_code_t src_format,
|
||||
uint32_t src_flags,
|
||||
pixman_format_code_t mask_format,
|
||||
uint32_t mask_flags,
|
||||
pixman_format_code_t dest_format,
|
||||
uint32_t dest_flags,
|
||||
pixman_implementation_t **out_imp,
|
||||
pixman_composite_func_t *out_func);
|
||||
pixman_contract_from_float (uint32_t *dst,
|
||||
const argb_t *src,
|
||||
int width);
|
||||
|
||||
/* Region Helpers */
|
||||
pixman_bool_t
|
||||
|
@ -965,6 +982,9 @@ unorm_to_unorm (uint32_t val, int from_bits, int to_bits)
|
|||
return result;
|
||||
}
|
||||
|
||||
uint16_t pixman_float_to_unorm (float f, int n_bits);
|
||||
float pixman_unorm_to_float (uint16_t u, int n_bits);
|
||||
|
||||
/*
|
||||
* Various debugging code
|
||||
*/
|
||||
|
@ -1106,19 +1126,12 @@ void pixman_timer_register (pixman_timer_t *timer);
|
|||
timer ## tname.total += OIL_STAMP () - begin ## tname; \
|
||||
}
|
||||
|
||||
#endif /* PIXMAN_TIMERS */
|
||||
#else
|
||||
|
||||
/* sRGB<->linear conversion tables. Linear color space is the same
|
||||
* as sRGB but the components are in linear light (gamma 1.0).
|
||||
*
|
||||
* linear_to_srgb maps linear value from 0 to 4095 ([0.0, 1.0])
|
||||
* and returns 8-bit sRGB value.
|
||||
*
|
||||
* srgb_to_linear maps 8-bit sRGB value to 16-bit linear value
|
||||
* with range 0 to 65535 ([0.0, 1.0]).
|
||||
*/
|
||||
extern const uint8_t linear_to_srgb[4096];
|
||||
extern const uint16_t srgb_to_linear[256];
|
||||
#define TIMER_BEGIN(tname)
|
||||
#define TIMER_END(tname)
|
||||
|
||||
#endif /* PIXMAN_TIMERS */
|
||||
|
||||
#endif /* __ASSEMBLER__ */
|
||||
|
||||
|
|
|
@ -663,7 +663,8 @@ radial_get_scanline_wide (pixman_iter_t *iter, const uint32_t *mask)
|
|||
{
|
||||
uint32_t *buffer = radial_get_scanline_narrow (iter, NULL);
|
||||
|
||||
pixman_expand ((uint64_t *)buffer, buffer, PIXMAN_a8r8g8b8, iter->width);
|
||||
pixman_expand_to_float (
|
||||
(argb_t *)buffer, buffer, PIXMAN_a8r8g8b8, iter->width);
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
@ -681,8 +682,8 @@ _pixman_radial_gradient_iter_init (pixman_image_t *image, pixman_iter_t *iter)
|
|||
|
||||
|
||||
PIXMAN_EXPORT pixman_image_t *
|
||||
pixman_image_create_radial_gradient (pixman_point_fixed_t * inner,
|
||||
pixman_point_fixed_t * outer,
|
||||
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,
|
||||
|
|
|
@ -742,8 +742,7 @@ typedef pixman_bool_t (*overlap_proc_ptr) (region_type_t *region,
|
|||
box_type_t * r2,
|
||||
box_type_t * r2_end,
|
||||
int y1,
|
||||
int y2,
|
||||
int * overlap);
|
||||
int y2);
|
||||
|
||||
static pixman_bool_t
|
||||
pixman_op (region_type_t * new_reg, /* Place to store result */
|
||||
|
@ -754,10 +753,10 @@ pixman_op (region_type_t * new_reg, /* Place to store result
|
|||
int append_non1, /* Append non-overlapping bands
|
||||
* in region 1 ?
|
||||
*/
|
||||
int append_non2, /* Append non-overlapping bands
|
||||
int append_non2 /* Append non-overlapping bands
|
||||
* in region 2 ?
|
||||
*/
|
||||
int * overlap)
|
||||
)
|
||||
{
|
||||
box_type_t *r1; /* Pointer into first region */
|
||||
box_type_t *r2; /* Pointer into 2d region */
|
||||
|
@ -935,8 +934,7 @@ pixman_op (region_type_t * new_reg, /* Place to store result
|
|||
if (!(*overlap_func)(new_reg,
|
||||
r1, r1_band_end,
|
||||
r2, r2_band_end,
|
||||
ytop, ybot,
|
||||
overlap))
|
||||
ytop, ybot))
|
||||
{
|
||||
goto bail;
|
||||
}
|
||||
|
@ -1113,8 +1111,7 @@ pixman_region_intersect_o (region_type_t *region,
|
|||
box_type_t * r2,
|
||||
box_type_t * r2_end,
|
||||
int y1,
|
||||
int y2,
|
||||
int * overlap)
|
||||
int y2)
|
||||
{
|
||||
int x1;
|
||||
int x2;
|
||||
|
@ -1210,13 +1207,9 @@ PREFIX (_intersect) (region_type_t * new_reg,
|
|||
else
|
||||
{
|
||||
/* General purpose intersection */
|
||||
int overlap; /* result ignored */
|
||||
|
||||
if (!pixman_op (new_reg, reg1, reg2, pixman_region_intersect_o, FALSE, FALSE,
|
||||
&overlap))
|
||||
{
|
||||
if (!pixman_op (new_reg, reg1, reg2, pixman_region_intersect_o, FALSE, FALSE))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
pixman_set_extents (new_reg);
|
||||
}
|
||||
|
@ -1231,9 +1224,6 @@ PREFIX (_intersect) (region_type_t * new_reg,
|
|||
if (r->x1 <= x2) \
|
||||
{ \
|
||||
/* Merge with current rectangle */ \
|
||||
if (r->x1 < x2) \
|
||||
*overlap = TRUE; \
|
||||
\
|
||||
if (x2 < r->x2) \
|
||||
x2 = r->x2; \
|
||||
} \
|
||||
|
@ -1273,8 +1263,7 @@ pixman_region_union_o (region_type_t *region,
|
|||
box_type_t * r2,
|
||||
box_type_t * r2_end,
|
||||
int y1,
|
||||
int y2,
|
||||
int * overlap)
|
||||
int y2)
|
||||
{
|
||||
box_type_t *next_rect;
|
||||
int x1; /* left and right side of current union */
|
||||
|
@ -1383,8 +1372,6 @@ PREFIX (_union) (region_type_t *new_reg,
|
|||
region_type_t *reg1,
|
||||
region_type_t *reg2)
|
||||
{
|
||||
int overlap; /* result ignored */
|
||||
|
||||
/* Return TRUE if some overlap
|
||||
* between reg1, reg2
|
||||
*/
|
||||
|
@ -1450,7 +1437,7 @@ PREFIX (_union) (region_type_t *new_reg,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
if (!pixman_op (new_reg, reg1, reg2, pixman_region_union_o, TRUE, TRUE, &overlap))
|
||||
if (!pixman_op (new_reg, reg1, reg2, pixman_region_union_o, TRUE, TRUE))
|
||||
return FALSE;
|
||||
|
||||
new_reg->extents.x1 = MIN (reg1->extents.x1, reg2->extents.x1);
|
||||
|
@ -1517,9 +1504,7 @@ quick_sort_rects (
|
|||
r++;
|
||||
i++;
|
||||
}
|
||||
|
||||
while (i != numRects && (r->y1 < y1 || (r->y1 == y1 && r->x1 < x1)))
|
||||
;
|
||||
while (i != numRects && (r->y1 < y1 || (r->y1 == y1 && r->x1 < x1)));
|
||||
|
||||
r = &(rects[j]);
|
||||
do
|
||||
|
@ -1580,8 +1565,7 @@ quick_sort_rects (
|
|||
*/
|
||||
|
||||
static pixman_bool_t
|
||||
validate (region_type_t * badreg,
|
||||
int * overlap)
|
||||
validate (region_type_t * badreg)
|
||||
{
|
||||
/* Descriptor for regions under construction in Step 2. */
|
||||
typedef struct
|
||||
|
@ -1606,7 +1590,6 @@ validate (region_type_t * badreg,
|
|||
region_type_t *hreg; /* ri[j_half].reg */
|
||||
pixman_bool_t ret = TRUE;
|
||||
|
||||
*overlap = FALSE;
|
||||
if (!badreg->data)
|
||||
{
|
||||
GOOD (badreg);
|
||||
|
@ -1680,9 +1663,6 @@ validate (region_type_t * badreg,
|
|||
if (box->x1 <= ri_box->x2)
|
||||
{
|
||||
/* Merge it with ri_box */
|
||||
if (box->x1 < ri_box->x2)
|
||||
*overlap = TRUE;
|
||||
|
||||
if (box->x2 > ri_box->x2)
|
||||
ri_box->x2 = box->x2;
|
||||
}
|
||||
|
@ -1786,7 +1766,7 @@ validate (region_type_t * badreg,
|
|||
reg = &ri[j].reg;
|
||||
hreg = &ri[j + half].reg;
|
||||
|
||||
if (!pixman_op (reg, reg, hreg, pixman_region_union_o, TRUE, TRUE, overlap))
|
||||
if (!pixman_op (reg, reg, hreg, pixman_region_union_o, TRUE, TRUE))
|
||||
ret = FALSE;
|
||||
|
||||
if (hreg->extents.x1 < reg->extents.x1)
|
||||
|
@ -1854,8 +1834,7 @@ pixman_region_subtract_o (region_type_t * region,
|
|||
box_type_t * r2,
|
||||
box_type_t * r2_end,
|
||||
int y1,
|
||||
int y2,
|
||||
int * overlap)
|
||||
int y2)
|
||||
{
|
||||
box_type_t * next_rect;
|
||||
int x1;
|
||||
|
@ -1979,8 +1958,6 @@ PREFIX (_subtract) (region_type_t *reg_d,
|
|||
region_type_t *reg_m,
|
||||
region_type_t *reg_s)
|
||||
{
|
||||
int overlap; /* result ignored */
|
||||
|
||||
GOOD (reg_m);
|
||||
GOOD (reg_s);
|
||||
GOOD (reg_d);
|
||||
|
@ -2007,7 +1984,7 @@ PREFIX (_subtract) (region_type_t *reg_d,
|
|||
/* Add those rectangles in region 1 that aren't in region 2,
|
||||
do yucky substraction for overlaps, and
|
||||
just throw away rectangles in region 2 that aren't in region 1 */
|
||||
if (!pixman_op (reg_d, reg_m, reg_s, pixman_region_subtract_o, TRUE, FALSE, &overlap))
|
||||
if (!pixman_op (reg_d, reg_m, reg_s, pixman_region_subtract_o, TRUE, FALSE))
|
||||
return FALSE;
|
||||
|
||||
/*
|
||||
|
@ -2048,8 +2025,6 @@ PREFIX (_inverse) (region_type_t *new_reg, /* Destination region */
|
|||
{
|
||||
region_type_t inv_reg; /* Quick and dirty region made from the
|
||||
* bounding box */
|
||||
int overlap; /* result ignored */
|
||||
|
||||
GOOD (reg1);
|
||||
GOOD (new_reg);
|
||||
|
||||
|
@ -2072,7 +2047,7 @@ PREFIX (_inverse) (region_type_t *new_reg, /* Destination region */
|
|||
*/
|
||||
inv_reg.extents = *inv_rect;
|
||||
inv_reg.data = (region_data_type_t *)NULL;
|
||||
if (!pixman_op (new_reg, &inv_reg, reg1, pixman_region_subtract_o, TRUE, FALSE, &overlap))
|
||||
if (!pixman_op (new_reg, &inv_reg, reg1, pixman_region_subtract_o, TRUE, FALSE))
|
||||
return FALSE;
|
||||
|
||||
/*
|
||||
|
@ -2575,7 +2550,7 @@ PREFIX (_init_rects) (region_type_t *region,
|
|||
/* Validate */
|
||||
region->extents.x1 = region->extents.x2 = 0;
|
||||
|
||||
return validate (region, &i);
|
||||
return validate (region);
|
||||
}
|
||||
|
||||
#define READ(_ptr) (*(_ptr))
|
||||
|
|
|
@ -40,9 +40,9 @@ _pixman_solid_fill_iter_init (pixman_image_t *image, pixman_iter_t *iter)
|
|||
}
|
||||
else
|
||||
{
|
||||
uint64_t *b = (uint64_t *)iter->buffer;
|
||||
uint64_t *e = b + iter->width;
|
||||
uint64_t color = image->solid.color_64;
|
||||
argb_t *b = (argb_t *)iter->buffer;
|
||||
argb_t *e = b + iter->width;
|
||||
argb_t color = image->solid.color_float;
|
||||
|
||||
while (b < e)
|
||||
*(b++) = color;
|
||||
|
@ -61,18 +61,21 @@ color_to_uint32 (const pixman_color_t *color)
|
|||
(color->blue >> 8);
|
||||
}
|
||||
|
||||
static uint64_t
|
||||
color_to_uint64 (const pixman_color_t *color)
|
||||
static argb_t
|
||||
color_to_float (const pixman_color_t *color)
|
||||
{
|
||||
return
|
||||
((uint64_t)color->alpha << 48) |
|
||||
((uint64_t)color->red << 32) |
|
||||
((uint64_t)color->green << 16) |
|
||||
((uint64_t)color->blue);
|
||||
argb_t result;
|
||||
|
||||
result.a = pixman_unorm_to_float (color->alpha, 16);
|
||||
result.r = pixman_unorm_to_float (color->red, 16);
|
||||
result.g = pixman_unorm_to_float (color->green, 16);
|
||||
result.b = pixman_unorm_to_float (color->blue, 16);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
PIXMAN_EXPORT pixman_image_t *
|
||||
pixman_image_create_solid_fill (pixman_color_t *color)
|
||||
pixman_image_create_solid_fill (const pixman_color_t *color)
|
||||
{
|
||||
pixman_image_t *img = _pixman_image_allocate ();
|
||||
|
||||
|
@ -82,7 +85,7 @@ pixman_image_create_solid_fill (pixman_color_t *color)
|
|||
img->type = SOLID;
|
||||
img->solid.color = *color;
|
||||
img->solid.color_32 = color_to_uint32 (color);
|
||||
img->solid.color_64 = color_to_uint64 (color);
|
||||
img->solid.color_float = color_to_float (color);
|
||||
|
||||
return img;
|
||||
}
|
||||
|
|
|
@ -1,455 +0,0 @@
|
|||
/* WARNING: This file is generated by make-srgb.pl.
|
||||
* Please edit that file instead of this one.
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include "pixman-private.h"
|
||||
|
||||
const uint8_t linear_to_srgb[4096] =
|
||||
{
|
||||
0, 1, 2, 2, 3, 4, 5, 6, 6, 7,
|
||||
8, 9, 10, 10, 11, 12, 13, 13, 14, 15,
|
||||
15, 16, 16, 17, 18, 18, 19, 19, 20, 20,
|
||||
21, 21, 22, 22, 23, 23, 23, 24, 24, 25,
|
||||
25, 25, 26, 26, 27, 27, 27, 28, 28, 29,
|
||||
29, 29, 30, 30, 30, 31, 31, 31, 32, 32,
|
||||
32, 33, 33, 33, 34, 34, 34, 34, 35, 35,
|
||||
35, 36, 36, 36, 37, 37, 37, 37, 38, 38,
|
||||
38, 38, 39, 39, 39, 40, 40, 40, 40, 41,
|
||||
41, 41, 41, 42, 42, 42, 42, 43, 43, 43,
|
||||
43, 43, 44, 44, 44, 44, 45, 45, 45, 45,
|
||||
46, 46, 46, 46, 46, 47, 47, 47, 47, 48,
|
||||
48, 48, 48, 48, 49, 49, 49, 49, 49, 50,
|
||||
50, 50, 50, 50, 51, 51, 51, 51, 51, 52,
|
||||
52, 52, 52, 52, 53, 53, 53, 53, 53, 54,
|
||||
54, 54, 54, 54, 55, 55, 55, 55, 55, 55,
|
||||
56, 56, 56, 56, 56, 57, 57, 57, 57, 57,
|
||||
57, 58, 58, 58, 58, 58, 58, 59, 59, 59,
|
||||
59, 59, 59, 60, 60, 60, 60, 60, 60, 61,
|
||||
61, 61, 61, 61, 61, 62, 62, 62, 62, 62,
|
||||
62, 63, 63, 63, 63, 63, 63, 64, 64, 64,
|
||||
64, 64, 64, 64, 65, 65, 65, 65, 65, 65,
|
||||
66, 66, 66, 66, 66, 66, 66, 67, 67, 67,
|
||||
67, 67, 67, 67, 68, 68, 68, 68, 68, 68,
|
||||
68, 69, 69, 69, 69, 69, 69, 69, 70, 70,
|
||||
70, 70, 70, 70, 70, 71, 71, 71, 71, 71,
|
||||
71, 71, 72, 72, 72, 72, 72, 72, 72, 72,
|
||||
73, 73, 73, 73, 73, 73, 73, 74, 74, 74,
|
||||
74, 74, 74, 74, 74, 75, 75, 75, 75, 75,
|
||||
75, 75, 75, 76, 76, 76, 76, 76, 76, 76,
|
||||
77, 77, 77, 77, 77, 77, 77, 77, 78, 78,
|
||||
78, 78, 78, 78, 78, 78, 78, 79, 79, 79,
|
||||
79, 79, 79, 79, 79, 80, 80, 80, 80, 80,
|
||||
80, 80, 80, 81, 81, 81, 81, 81, 81, 81,
|
||||
81, 81, 82, 82, 82, 82, 82, 82, 82, 82,
|
||||
83, 83, 83, 83, 83, 83, 83, 83, 83, 84,
|
||||
84, 84, 84, 84, 84, 84, 84, 84, 85, 85,
|
||||
85, 85, 85, 85, 85, 85, 85, 86, 86, 86,
|
||||
86, 86, 86, 86, 86, 86, 87, 87, 87, 87,
|
||||
87, 87, 87, 87, 87, 88, 88, 88, 88, 88,
|
||||
88, 88, 88, 88, 88, 89, 89, 89, 89, 89,
|
||||
89, 89, 89, 89, 90, 90, 90, 90, 90, 90,
|
||||
90, 90, 90, 90, 91, 91, 91, 91, 91, 91,
|
||||
91, 91, 91, 91, 92, 92, 92, 92, 92, 92,
|
||||
92, 92, 92, 92, 93, 93, 93, 93, 93, 93,
|
||||
93, 93, 93, 93, 94, 94, 94, 94, 94, 94,
|
||||
94, 94, 94, 94, 95, 95, 95, 95, 95, 95,
|
||||
95, 95, 95, 95, 96, 96, 96, 96, 96, 96,
|
||||
96, 96, 96, 96, 96, 97, 97, 97, 97, 97,
|
||||
97, 97, 97, 97, 97, 98, 98, 98, 98, 98,
|
||||
98, 98, 98, 98, 98, 98, 99, 99, 99, 99,
|
||||
99, 99, 99, 99, 99, 99, 99, 100, 100, 100,
|
||||
100, 100, 100, 100, 100, 100, 100, 100, 101, 101,
|
||||
101, 101, 101, 101, 101, 101, 101, 101, 101, 102,
|
||||
102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
|
||||
103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
|
||||
103, 103, 104, 104, 104, 104, 104, 104, 104, 104,
|
||||
104, 104, 104, 105, 105, 105, 105, 105, 105, 105,
|
||||
105, 105, 105, 105, 105, 106, 106, 106, 106, 106,
|
||||
106, 106, 106, 106, 106, 106, 106, 107, 107, 107,
|
||||
107, 107, 107, 107, 107, 107, 107, 107, 107, 108,
|
||||
108, 108, 108, 108, 108, 108, 108, 108, 108, 108,
|
||||
108, 109, 109, 109, 109, 109, 109, 109, 109, 109,
|
||||
109, 109, 109, 110, 110, 110, 110, 110, 110, 110,
|
||||
110, 110, 110, 110, 110, 111, 111, 111, 111, 111,
|
||||
111, 111, 111, 111, 111, 111, 111, 111, 112, 112,
|
||||
112, 112, 112, 112, 112, 112, 112, 112, 112, 112,
|
||||
113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
|
||||
113, 113, 113, 114, 114, 114, 114, 114, 114, 114,
|
||||
114, 114, 114, 114, 114, 114, 115, 115, 115, 115,
|
||||
115, 115, 115, 115, 115, 115, 115, 115, 115, 116,
|
||||
116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
|
||||
116, 116, 117, 117, 117, 117, 117, 117, 117, 117,
|
||||
117, 117, 117, 117, 117, 117, 118, 118, 118, 118,
|
||||
118, 118, 118, 118, 118, 118, 118, 118, 118, 119,
|
||||
119, 119, 119, 119, 119, 119, 119, 119, 119, 119,
|
||||
119, 119, 119, 120, 120, 120, 120, 120, 120, 120,
|
||||
120, 120, 120, 120, 120, 120, 120, 121, 121, 121,
|
||||
121, 121, 121, 121, 121, 121, 121, 121, 121, 121,
|
||||
122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
|
||||
122, 122, 122, 122, 122, 123, 123, 123, 123, 123,
|
||||
123, 123, 123, 123, 123, 123, 123, 123, 123, 124,
|
||||
124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
|
||||
124, 124, 124, 125, 125, 125, 125, 125, 125, 125,
|
||||
125, 125, 125, 125, 125, 125, 125, 125, 126, 126,
|
||||
126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
|
||||
126, 126, 127, 127, 127, 127, 127, 127, 127, 127,
|
||||
127, 127, 127, 127, 127, 127, 127, 128, 128, 128,
|
||||
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
|
||||
128, 128, 129, 129, 129, 129, 129, 129, 129, 129,
|
||||
129, 129, 129, 129, 129, 129, 129, 130, 130, 130,
|
||||
130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
|
||||
130, 130, 131, 131, 131, 131, 131, 131, 131, 131,
|
||||
131, 131, 131, 131, 131, 131, 131, 131, 132, 132,
|
||||
132, 132, 132, 132, 132, 132, 132, 132, 132, 132,
|
||||
132, 132, 132, 133, 133, 133, 133, 133, 133, 133,
|
||||
133, 133, 133, 133, 133, 133, 133, 133, 133, 134,
|
||||
134, 134, 134, 134, 134, 134, 134, 134, 134, 134,
|
||||
134, 134, 134, 134, 134, 135, 135, 135, 135, 135,
|
||||
135, 135, 135, 135, 135, 135, 135, 135, 135, 135,
|
||||
135, 136, 136, 136, 136, 136, 136, 136, 136, 136,
|
||||
136, 136, 136, 136, 136, 136, 136, 137, 137, 137,
|
||||
137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
|
||||
137, 137, 137, 138, 138, 138, 138, 138, 138, 138,
|
||||
138, 138, 138, 138, 138, 138, 138, 138, 138, 139,
|
||||
139, 139, 139, 139, 139, 139, 139, 139, 139, 139,
|
||||
139, 139, 139, 139, 139, 139, 140, 140, 140, 140,
|
||||
140, 140, 140, 140, 140, 140, 140, 140, 140, 140,
|
||||
140, 140, 140, 141, 141, 141, 141, 141, 141, 141,
|
||||
141, 141, 141, 141, 141, 141, 141, 141, 141, 141,
|
||||
142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
|
||||
142, 142, 142, 142, 142, 142, 142, 143, 143, 143,
|
||||
143, 143, 143, 143, 143, 143, 143, 143, 143, 143,
|
||||
143, 143, 143, 143, 144, 144, 144, 144, 144, 144,
|
||||
144, 144, 144, 144, 144, 144, 144, 144, 144, 144,
|
||||
144, 145, 145, 145, 145, 145, 145, 145, 145, 145,
|
||||
145, 145, 145, 145, 145, 145, 145, 145, 145, 146,
|
||||
146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
|
||||
146, 146, 146, 146, 146, 146, 147, 147, 147, 147,
|
||||
147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
|
||||
147, 147, 147, 147, 148, 148, 148, 148, 148, 148,
|
||||
148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
|
||||
148, 148, 149, 149, 149, 149, 149, 149, 149, 149,
|
||||
149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
|
||||
150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
|
||||
150, 150, 150, 150, 150, 150, 150, 150, 150, 151,
|
||||
151, 151, 151, 151, 151, 151, 151, 151, 151, 151,
|
||||
151, 151, 151, 151, 151, 151, 151, 152, 152, 152,
|
||||
152, 152, 152, 152, 152, 152, 152, 152, 152, 152,
|
||||
152, 152, 152, 152, 152, 152, 153, 153, 153, 153,
|
||||
153, 153, 153, 153, 153, 153, 153, 153, 153, 153,
|
||||
153, 153, 153, 153, 154, 154, 154, 154, 154, 154,
|
||||
154, 154, 154, 154, 154, 154, 154, 154, 154, 154,
|
||||
154, 154, 154, 155, 155, 155, 155, 155, 155, 155,
|
||||
155, 155, 155, 155, 155, 155, 155, 155, 155, 155,
|
||||
155, 155, 156, 156, 156, 156, 156, 156, 156, 156,
|
||||
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
|
||||
156, 156, 157, 157, 157, 157, 157, 157, 157, 157,
|
||||
157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
|
||||
157, 158, 158, 158, 158, 158, 158, 158, 158, 158,
|
||||
158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
|
||||
159, 159, 159, 159, 159, 159, 159, 159, 159, 159,
|
||||
159, 159, 159, 159, 159, 159, 159, 159, 159, 159,
|
||||
160, 160, 160, 160, 160, 160, 160, 160, 160, 160,
|
||||
160, 160, 160, 160, 160, 160, 160, 160, 160, 160,
|
||||
161, 161, 161, 161, 161, 161, 161, 161, 161, 161,
|
||||
161, 161, 161, 161, 161, 161, 161, 161, 161, 161,
|
||||
162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
|
||||
162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
|
||||
163, 163, 163, 163, 163, 163, 163, 163, 163, 163,
|
||||
163, 163, 163, 163, 163, 163, 163, 163, 163, 163,
|
||||
164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
|
||||
164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
|
||||
164, 165, 165, 165, 165, 165, 165, 165, 165, 165,
|
||||
165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
|
||||
165, 165, 166, 166, 166, 166, 166, 166, 166, 166,
|
||||
166, 166, 166, 166, 166, 166, 166, 166, 166, 166,
|
||||
166, 166, 167, 167, 167, 167, 167, 167, 167, 167,
|
||||
167, 167, 167, 167, 167, 167, 167, 167, 167, 167,
|
||||
167, 167, 167, 168, 168, 168, 168, 168, 168, 168,
|
||||
168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
|
||||
168, 168, 168, 168, 168, 169, 169, 169, 169, 169,
|
||||
169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
|
||||
169, 169, 169, 169, 169, 169, 170, 170, 170, 170,
|
||||
170, 170, 170, 170, 170, 170, 170, 170, 170, 170,
|
||||
170, 170, 170, 170, 170, 170, 170, 171, 171, 171,
|
||||
171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
|
||||
171, 171, 171, 171, 171, 171, 171, 171, 171, 172,
|
||||
172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
|
||||
172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
|
||||
172, 173, 173, 173, 173, 173, 173, 173, 173, 173,
|
||||
173, 173, 173, 173, 173, 173, 173, 173, 173, 173,
|
||||
173, 173, 173, 174, 174, 174, 174, 174, 174, 174,
|
||||
174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
|
||||
174, 174, 174, 174, 174, 175, 175, 175, 175, 175,
|
||||
175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
|
||||
175, 175, 175, 175, 175, 175, 175, 176, 176, 176,
|
||||
176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
|
||||
176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
|
||||
177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
|
||||
177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
|
||||
177, 177, 178, 178, 178, 178, 178, 178, 178, 178,
|
||||
178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
|
||||
178, 178, 178, 178, 178, 179, 179, 179, 179, 179,
|
||||
179, 179, 179, 179, 179, 179, 179, 179, 179, 179,
|
||||
179, 179, 179, 179, 179, 179, 179, 179, 180, 180,
|
||||
180, 180, 180, 180, 180, 180, 180, 180, 180, 180,
|
||||
180, 180, 180, 180, 180, 180, 180, 180, 180, 180,
|
||||
180, 181, 181, 181, 181, 181, 181, 181, 181, 181,
|
||||
181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
|
||||
181, 181, 181, 181, 182, 182, 182, 182, 182, 182,
|
||||
182, 182, 182, 182, 182, 182, 182, 182, 182, 182,
|
||||
182, 182, 182, 182, 182, 182, 182, 182, 183, 183,
|
||||
183, 183, 183, 183, 183, 183, 183, 183, 183, 183,
|
||||
183, 183, 183, 183, 183, 183, 183, 183, 183, 183,
|
||||
183, 184, 184, 184, 184, 184, 184, 184, 184, 184,
|
||||
184, 184, 184, 184, 184, 184, 184, 184, 184, 184,
|
||||
184, 184, 184, 184, 184, 185, 185, 185, 185, 185,
|
||||
185, 185, 185, 185, 185, 185, 185, 185, 185, 185,
|
||||
185, 185, 185, 185, 185, 185, 185, 185, 185, 186,
|
||||
186, 186, 186, 186, 186, 186, 186, 186, 186, 186,
|
||||
186, 186, 186, 186, 186, 186, 186, 186, 186, 186,
|
||||
186, 186, 186, 187, 187, 187, 187, 187, 187, 187,
|
||||
187, 187, 187, 187, 187, 187, 187, 187, 187, 187,
|
||||
187, 187, 187, 187, 187, 187, 187, 187, 188, 188,
|
||||
188, 188, 188, 188, 188, 188, 188, 188, 188, 188,
|
||||
188, 188, 188, 188, 188, 188, 188, 188, 188, 188,
|
||||
188, 188, 189, 189, 189, 189, 189, 189, 189, 189,
|
||||
189, 189, 189, 189, 189, 189, 189, 189, 189, 189,
|
||||
189, 189, 189, 189, 189, 189, 189, 190, 190, 190,
|
||||
190, 190, 190, 190, 190, 190, 190, 190, 190, 190,
|
||||
190, 190, 190, 190, 190, 190, 190, 190, 190, 190,
|
||||
190, 190, 191, 191, 191, 191, 191, 191, 191, 191,
|
||||
191, 191, 191, 191, 191, 191, 191, 191, 191, 191,
|
||||
191, 191, 191, 191, 191, 191, 192, 192, 192, 192,
|
||||
192, 192, 192, 192, 192, 192, 192, 192, 192, 192,
|
||||
192, 192, 192, 192, 192, 192, 192, 192, 192, 192,
|
||||
192, 192, 193, 193, 193, 193, 193, 193, 193, 193,
|
||||
193, 193, 193, 193, 193, 193, 193, 193, 193, 193,
|
||||
193, 193, 193, 193, 193, 193, 193, 194, 194, 194,
|
||||
194, 194, 194, 194, 194, 194, 194, 194, 194, 194,
|
||||
194, 194, 194, 194, 194, 194, 194, 194, 194, 194,
|
||||
194, 194, 195, 195, 195, 195, 195, 195, 195, 195,
|
||||
195, 195, 195, 195, 195, 195, 195, 195, 195, 195,
|
||||
195, 195, 195, 195, 195, 195, 195, 195, 196, 196,
|
||||
196, 196, 196, 196, 196, 196, 196, 196, 196, 196,
|
||||
196, 196, 196, 196, 196, 196, 196, 196, 196, 196,
|
||||
196, 196, 196, 196, 197, 197, 197, 197, 197, 197,
|
||||
197, 197, 197, 197, 197, 197, 197, 197, 197, 197,
|
||||
197, 197, 197, 197, 197, 197, 197, 197, 197, 197,
|
||||
198, 198, 198, 198, 198, 198, 198, 198, 198, 198,
|
||||
198, 198, 198, 198, 198, 198, 198, 198, 198, 198,
|
||||
198, 198, 198, 198, 198, 198, 199, 199, 199, 199,
|
||||
199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
|
||||
199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
|
||||
199, 199, 200, 200, 200, 200, 200, 200, 200, 200,
|
||||
200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
|
||||
200, 200, 200, 200, 200, 200, 200, 200, 200, 201,
|
||||
201, 201, 201, 201, 201, 201, 201, 201, 201, 201,
|
||||
201, 201, 201, 201, 201, 201, 201, 201, 201, 201,
|
||||
201, 201, 201, 201, 201, 201, 202, 202, 202, 202,
|
||||
202, 202, 202, 202, 202, 202, 202, 202, 202, 202,
|
||||
202, 202, 202, 202, 202, 202, 202, 202, 202, 202,
|
||||
202, 202, 202, 203, 203, 203, 203, 203, 203, 203,
|
||||
203, 203, 203, 203, 203, 203, 203, 203, 203, 203,
|
||||
203, 203, 203, 203, 203, 203, 203, 203, 203, 203,
|
||||
204, 204, 204, 204, 204, 204, 204, 204, 204, 204,
|
||||
204, 204, 204, 204, 204, 204, 204, 204, 204, 204,
|
||||
204, 204, 204, 204, 204, 204, 204, 205, 205, 205,
|
||||
205, 205, 205, 205, 205, 205, 205, 205, 205, 205,
|
||||
205, 205, 205, 205, 205, 205, 205, 205, 205, 205,
|
||||
205, 205, 205, 205, 206, 206, 206, 206, 206, 206,
|
||||
206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
|
||||
206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
|
||||
206, 206, 207, 207, 207, 207, 207, 207, 207, 207,
|
||||
207, 207, 207, 207, 207, 207, 207, 207, 207, 207,
|
||||
207, 207, 207, 207, 207, 207, 207, 207, 207, 207,
|
||||
208, 208, 208, 208, 208, 208, 208, 208, 208, 208,
|
||||
208, 208, 208, 208, 208, 208, 208, 208, 208, 208,
|
||||
208, 208, 208, 208, 208, 208, 208, 209, 209, 209,
|
||||
209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
|
||||
209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
|
||||
209, 209, 209, 209, 209, 209, 210, 210, 210, 210,
|
||||
210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
|
||||
210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
|
||||
210, 210, 210, 210, 211, 211, 211, 211, 211, 211,
|
||||
211, 211, 211, 211, 211, 211, 211, 211, 211, 211,
|
||||
211, 211, 211, 211, 211, 211, 211, 211, 211, 211,
|
||||
211, 211, 212, 212, 212, 212, 212, 212, 212, 212,
|
||||
212, 212, 212, 212, 212, 212, 212, 212, 212, 212,
|
||||
212, 212, 212, 212, 212, 212, 212, 212, 212, 212,
|
||||
212, 213, 213, 213, 213, 213, 213, 213, 213, 213,
|
||||
213, 213, 213, 213, 213, 213, 213, 213, 213, 213,
|
||||
213, 213, 213, 213, 213, 213, 213, 213, 213, 213,
|
||||
214, 214, 214, 214, 214, 214, 214, 214, 214, 214,
|
||||
214, 214, 214, 214, 214, 214, 214, 214, 214, 214,
|
||||
214, 214, 214, 214, 214, 214, 214, 214, 214, 215,
|
||||
215, 215, 215, 215, 215, 215, 215, 215, 215, 215,
|
||||
215, 215, 215, 215, 215, 215, 215, 215, 215, 215,
|
||||
215, 215, 215, 215, 215, 215, 215, 215, 216, 216,
|
||||
216, 216, 216, 216, 216, 216, 216, 216, 216, 216,
|
||||
216, 216, 216, 216, 216, 216, 216, 216, 216, 216,
|
||||
216, 216, 216, 216, 216, 216, 216, 217, 217, 217,
|
||||
217, 217, 217, 217, 217, 217, 217, 217, 217, 217,
|
||||
217, 217, 217, 217, 217, 217, 217, 217, 217, 217,
|
||||
217, 217, 217, 217, 217, 217, 217, 218, 218, 218,
|
||||
218, 218, 218, 218, 218, 218, 218, 218, 218, 218,
|
||||
218, 218, 218, 218, 218, 218, 218, 218, 218, 218,
|
||||
218, 218, 218, 218, 218, 218, 219, 219, 219, 219,
|
||||
219, 219, 219, 219, 219, 219, 219, 219, 219, 219,
|
||||
219, 219, 219, 219, 219, 219, 219, 219, 219, 219,
|
||||
219, 219, 219, 219, 219, 219, 220, 220, 220, 220,
|
||||
220, 220, 220, 220, 220, 220, 220, 220, 220, 220,
|
||||
220, 220, 220, 220, 220, 220, 220, 220, 220, 220,
|
||||
220, 220, 220, 220, 220, 220, 221, 221, 221, 221,
|
||||
221, 221, 221, 221, 221, 221, 221, 221, 221, 221,
|
||||
221, 221, 221, 221, 221, 221, 221, 221, 221, 221,
|
||||
221, 221, 221, 221, 221, 221, 221, 222, 222, 222,
|
||||
222, 222, 222, 222, 222, 222, 222, 222, 222, 222,
|
||||
222, 222, 222, 222, 222, 222, 222, 222, 222, 222,
|
||||
222, 222, 222, 222, 222, 222, 222, 223, 223, 223,
|
||||
223, 223, 223, 223, 223, 223, 223, 223, 223, 223,
|
||||
223, 223, 223, 223, 223, 223, 223, 223, 223, 223,
|
||||
223, 223, 223, 223, 223, 223, 223, 223, 224, 224,
|
||||
224, 224, 224, 224, 224, 224, 224, 224, 224, 224,
|
||||
224, 224, 224, 224, 224, 224, 224, 224, 224, 224,
|
||||
224, 224, 224, 224, 224, 224, 224, 224, 225, 225,
|
||||
225, 225, 225, 225, 225, 225, 225, 225, 225, 225,
|
||||
225, 225, 225, 225, 225, 225, 225, 225, 225, 225,
|
||||
225, 225, 225, 225, 225, 225, 225, 225, 225, 226,
|
||||
226, 226, 226, 226, 226, 226, 226, 226, 226, 226,
|
||||
226, 226, 226, 226, 226, 226, 226, 226, 226, 226,
|
||||
226, 226, 226, 226, 226, 226, 226, 226, 226, 226,
|
||||
227, 227, 227, 227, 227, 227, 227, 227, 227, 227,
|
||||
227, 227, 227, 227, 227, 227, 227, 227, 227, 227,
|
||||
227, 227, 227, 227, 227, 227, 227, 227, 227, 227,
|
||||
227, 227, 228, 228, 228, 228, 228, 228, 228, 228,
|
||||
228, 228, 228, 228, 228, 228, 228, 228, 228, 228,
|
||||
228, 228, 228, 228, 228, 228, 228, 228, 228, 228,
|
||||
228, 228, 228, 229, 229, 229, 229, 229, 229, 229,
|
||||
229, 229, 229, 229, 229, 229, 229, 229, 229, 229,
|
||||
229, 229, 229, 229, 229, 229, 229, 229, 229, 229,
|
||||
229, 229, 229, 229, 229, 230, 230, 230, 230, 230,
|
||||
230, 230, 230, 230, 230, 230, 230, 230, 230, 230,
|
||||
230, 230, 230, 230, 230, 230, 230, 230, 230, 230,
|
||||
230, 230, 230, 230, 230, 230, 230, 231, 231, 231,
|
||||
231, 231, 231, 231, 231, 231, 231, 231, 231, 231,
|
||||
231, 231, 231, 231, 231, 231, 231, 231, 231, 231,
|
||||
231, 231, 231, 231, 231, 231, 231, 231, 231, 232,
|
||||
232, 232, 232, 232, 232, 232, 232, 232, 232, 232,
|
||||
232, 232, 232, 232, 232, 232, 232, 232, 232, 232,
|
||||
232, 232, 232, 232, 232, 232, 232, 232, 232, 232,
|
||||
232, 233, 233, 233, 233, 233, 233, 233, 233, 233,
|
||||
233, 233, 233, 233, 233, 233, 233, 233, 233, 233,
|
||||
233, 233, 233, 233, 233, 233, 233, 233, 233, 233,
|
||||
233, 233, 233, 233, 234, 234, 234, 234, 234, 234,
|
||||
234, 234, 234, 234, 234, 234, 234, 234, 234, 234,
|
||||
234, 234, 234, 234, 234, 234, 234, 234, 234, 234,
|
||||
234, 234, 234, 234, 234, 234, 235, 235, 235, 235,
|
||||
235, 235, 235, 235, 235, 235, 235, 235, 235, 235,
|
||||
235, 235, 235, 235, 235, 235, 235, 235, 235, 235,
|
||||
235, 235, 235, 235, 235, 235, 235, 235, 235, 236,
|
||||
236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
|
||||
236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
|
||||
236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
|
||||
236, 236, 237, 237, 237, 237, 237, 237, 237, 237,
|
||||
237, 237, 237, 237, 237, 237, 237, 237, 237, 237,
|
||||
237, 237, 237, 237, 237, 237, 237, 237, 237, 237,
|
||||
237, 237, 237, 237, 237, 238, 238, 238, 238, 238,
|
||||
238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
|
||||
238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
|
||||
238, 238, 238, 238, 238, 238, 238, 238, 239, 239,
|
||||
239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
|
||||
239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
|
||||
239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
|
||||
239, 239, 240, 240, 240, 240, 240, 240, 240, 240,
|
||||
240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
|
||||
240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
|
||||
240, 240, 240, 240, 240, 240, 241, 241, 241, 241,
|
||||
241, 241, 241, 241, 241, 241, 241, 241, 241, 241,
|
||||
241, 241, 241, 241, 241, 241, 241, 241, 241, 241,
|
||||
241, 241, 241, 241, 241, 241, 241, 241, 241, 241,
|
||||
242, 242, 242, 242, 242, 242, 242, 242, 242, 242,
|
||||
242, 242, 242, 242, 242, 242, 242, 242, 242, 242,
|
||||
242, 242, 242, 242, 242, 242, 242, 242, 242, 242,
|
||||
242, 242, 242, 242, 243, 243, 243, 243, 243, 243,
|
||||
243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
|
||||
243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
|
||||
243, 243, 243, 243, 243, 243, 243, 243, 244, 244,
|
||||
244, 244, 244, 244, 244, 244, 244, 244, 244, 244,
|
||||
244, 244, 244, 244, 244, 244, 244, 244, 244, 244,
|
||||
244, 244, 244, 244, 244, 244, 244, 244, 244, 244,
|
||||
244, 244, 245, 245, 245, 245, 245, 245, 245, 245,
|
||||
245, 245, 245, 245, 245, 245, 245, 245, 245, 245,
|
||||
245, 245, 245, 245, 245, 245, 245, 245, 245, 245,
|
||||
245, 245, 245, 245, 245, 245, 245, 246, 246, 246,
|
||||
246, 246, 246, 246, 246, 246, 246, 246, 246, 246,
|
||||
246, 246, 246, 246, 246, 246, 246, 246, 246, 246,
|
||||
246, 246, 246, 246, 246, 246, 246, 246, 246, 246,
|
||||
246, 246, 247, 247, 247, 247, 247, 247, 247, 247,
|
||||
247, 247, 247, 247, 247, 247, 247, 247, 247, 247,
|
||||
247, 247, 247, 247, 247, 247, 247, 247, 247, 247,
|
||||
247, 247, 247, 247, 247, 247, 247, 248, 248, 248,
|
||||
248, 248, 248, 248, 248, 248, 248, 248, 248, 248,
|
||||
248, 248, 248, 248, 248, 248, 248, 248, 248, 248,
|
||||
248, 248, 248, 248, 248, 248, 248, 248, 248, 248,
|
||||
248, 248, 249, 249, 249, 249, 249, 249, 249, 249,
|
||||
249, 249, 249, 249, 249, 249, 249, 249, 249, 249,
|
||||
249, 249, 249, 249, 249, 249, 249, 249, 249, 249,
|
||||
249, 249, 249, 249, 249, 249, 249, 250, 250, 250,
|
||||
250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
|
||||
250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
|
||||
250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
|
||||
250, 250, 250, 251, 251, 251, 251, 251, 251, 251,
|
||||
251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
|
||||
251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
|
||||
251, 251, 251, 251, 251, 251, 251, 251, 251, 252,
|
||||
252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
|
||||
252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
|
||||
252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
|
||||
252, 252, 252, 252, 252, 253, 253, 253, 253, 253,
|
||||
253, 253, 253, 253, 253, 253, 253, 253, 253, 253,
|
||||
253, 253, 253, 253, 253, 253, 253, 253, 253, 253,
|
||||
253, 253, 253, 253, 253, 253, 253, 253, 253, 253,
|
||||
253, 254, 254, 254, 254, 254, 254, 254, 254, 254,
|
||||
254, 254, 254, 254, 254, 254, 254, 254, 254, 254,
|
||||
254, 254, 254, 254, 254, 254, 254, 254, 254, 254,
|
||||
254, 254, 254, 254, 254, 254, 254, 255, 255, 255,
|
||||
255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
|
||||
255, 255, 255, 255, 255, 255,
|
||||
};
|
||||
|
||||
const uint16_t srgb_to_linear[256] =
|
||||
{
|
||||
0, 20, 40, 64, 80, 99, 119, 144, 160, 179,
|
||||
199, 224, 241, 264, 288, 313, 340, 368, 396, 427,
|
||||
458, 491, 526, 562, 599, 637, 677, 718, 761, 805,
|
||||
851, 898, 947, 997, 1048, 1101, 1156, 1212, 1270, 1330,
|
||||
1391, 1453, 1517, 1583, 1651, 1720, 1790, 1863, 1937, 2013,
|
||||
2090, 2170, 2250, 2333, 2418, 2504, 2592, 2681, 2773, 2866,
|
||||
2961, 3058, 3157, 3258, 3360, 3464, 3570, 3678, 3788, 3900,
|
||||
4014, 4129, 4247, 4366, 4488, 4611, 4736, 4864, 4993, 5124,
|
||||
5257, 5392, 5530, 5669, 5810, 5953, 6099, 6246, 6395, 6547,
|
||||
6700, 6856, 7014, 7174, 7335, 7500, 7666, 7834, 8004, 8177,
|
||||
8352, 8528, 8708, 8889, 9072, 9258, 9445, 9635, 9828, 10022,
|
||||
10219, 10417, 10619, 10822, 11028, 11235, 11446, 11658, 11873, 12090,
|
||||
12309, 12530, 12754, 12980, 13209, 13440, 13673, 13909, 14146, 14387,
|
||||
14629, 14874, 15122, 15371, 15623, 15878, 16135, 16394, 16656, 16920,
|
||||
17187, 17456, 17727, 18001, 18277, 18556, 18837, 19121, 19407, 19696,
|
||||
19987, 20281, 20577, 20876, 21177, 21481, 21787, 22096, 22407, 22721,
|
||||
23038, 23357, 23678, 24002, 24329, 24658, 24990, 25325, 25662, 26001,
|
||||
26344, 26688, 27036, 27386, 27739, 28094, 28452, 28813, 29176, 29542,
|
||||
29911, 30282, 30656, 31033, 31412, 31794, 32179, 32567, 32957, 33350,
|
||||
33745, 34143, 34544, 34948, 35355, 35764, 36176, 36591, 37008, 37429,
|
||||
37852, 38278, 38706, 39138, 39572, 40009, 40449, 40891, 41337, 41785,
|
||||
42236, 42690, 43147, 43606, 44069, 44534, 45002, 45473, 45947, 46423,
|
||||
46903, 47385, 47871, 48359, 48850, 49344, 49841, 50341, 50844, 51349,
|
||||
51858, 52369, 52884, 53401, 53921, 54445, 54971, 55500, 56032, 56567,
|
||||
57105, 57646, 58190, 58737, 59287, 59840, 60396, 60955, 61517, 62082,
|
||||
62650, 63221, 63795, 64372, 64952, 65535,
|
||||
};
|
|
@ -146,7 +146,7 @@ pack_565_2packedx128_128 (__m128i lo, __m128i hi)
|
|||
return _mm_packs_epi32 (t0, t1);
|
||||
}
|
||||
|
||||
__m128i
|
||||
static force_inline __m128i
|
||||
pack_565_2x128_128 (__m128i lo, __m128i hi)
|
||||
{
|
||||
__m128i data;
|
||||
|
@ -3309,18 +3309,22 @@ sse2_composite_over_n_8_8888 (pixman_implementation_t *imp,
|
|||
|
||||
}
|
||||
|
||||
#if defined(__GNUC__) && !defined(__x86_64__) && !defined(__amd64__)
|
||||
__attribute__((__force_align_arg_pointer__))
|
||||
#endif
|
||||
static pixman_bool_t
|
||||
pixman_fill_sse2 (uint32_t *bits,
|
||||
int stride,
|
||||
int bpp,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height,
|
||||
uint32_t data)
|
||||
sse2_fill (pixman_implementation_t *imp,
|
||||
uint32_t * bits,
|
||||
int stride,
|
||||
int bpp,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height,
|
||||
uint32_t xor)
|
||||
{
|
||||
uint32_t byte_width;
|
||||
uint8_t *byte_line;
|
||||
uint8_t *byte_line;
|
||||
|
||||
__m128i xmm_def;
|
||||
|
||||
|
@ -3334,9 +3338,9 @@ pixman_fill_sse2 (uint32_t *bits,
|
|||
byte_width = width;
|
||||
stride *= 1;
|
||||
|
||||
b = data & 0xff;
|
||||
b = xor & 0xff;
|
||||
w = (b << 8) | b;
|
||||
data = (w << 16) | w;
|
||||
xor = (w << 16) | w;
|
||||
}
|
||||
else if (bpp == 16)
|
||||
{
|
||||
|
@ -3345,7 +3349,7 @@ pixman_fill_sse2 (uint32_t *bits,
|
|||
byte_width = 2 * width;
|
||||
stride *= 2;
|
||||
|
||||
data = (data & 0xffff) * 0x00010001;
|
||||
xor = (xor & 0xffff) * 0x00010001;
|
||||
}
|
||||
else if (bpp == 32)
|
||||
{
|
||||
|
@ -3359,7 +3363,7 @@ pixman_fill_sse2 (uint32_t *bits,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
xmm_def = create_mask_2x32_128 (data, data);
|
||||
xmm_def = create_mask_2x32_128 (xor, xor);
|
||||
|
||||
while (height--)
|
||||
{
|
||||
|
@ -3370,21 +3374,21 @@ pixman_fill_sse2 (uint32_t *bits,
|
|||
|
||||
if (w >= 1 && ((unsigned long)d & 1))
|
||||
{
|
||||
*(uint8_t *)d = data;
|
||||
*(uint8_t *)d = xor;
|
||||
w -= 1;
|
||||
d += 1;
|
||||
}
|
||||
|
||||
while (w >= 2 && ((unsigned long)d & 3))
|
||||
{
|
||||
*(uint16_t *)d = data;
|
||||
*(uint16_t *)d = xor;
|
||||
w -= 2;
|
||||
d += 2;
|
||||
}
|
||||
|
||||
while (w >= 4 && ((unsigned long)d & 15))
|
||||
{
|
||||
*(uint32_t *)d = data;
|
||||
*(uint32_t *)d = xor;
|
||||
|
||||
w -= 4;
|
||||
d += 4;
|
||||
|
@ -3435,7 +3439,7 @@ pixman_fill_sse2 (uint32_t *bits,
|
|||
|
||||
while (w >= 4)
|
||||
{
|
||||
*(uint32_t *)d = data;
|
||||
*(uint32_t *)d = xor;
|
||||
|
||||
w -= 4;
|
||||
d += 4;
|
||||
|
@ -3443,14 +3447,14 @@ pixman_fill_sse2 (uint32_t *bits,
|
|||
|
||||
if (w >= 2)
|
||||
{
|
||||
*(uint16_t *)d = data;
|
||||
*(uint16_t *)d = xor;
|
||||
w -= 2;
|
||||
d += 2;
|
||||
}
|
||||
|
||||
if (w >= 1)
|
||||
{
|
||||
*(uint8_t *)d = data;
|
||||
*(uint8_t *)d = xor;
|
||||
w -= 1;
|
||||
d += 1;
|
||||
}
|
||||
|
@ -3479,9 +3483,9 @@ sse2_composite_src_n_8_8888 (pixman_implementation_t *imp,
|
|||
srca = src >> 24;
|
||||
if (src == 0)
|
||||
{
|
||||
pixman_fill_sse2 (dest_image->bits.bits, dest_image->bits.rowstride,
|
||||
PIXMAN_FORMAT_BPP (dest_image->bits.format),
|
||||
dest_x, dest_y, width, height, 0);
|
||||
sse2_fill (imp, dest_image->bits.bits, dest_image->bits.rowstride,
|
||||
PIXMAN_FORMAT_BPP (dest_image->bits.format),
|
||||
dest_x, dest_y, width, height, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -4523,18 +4527,19 @@ sse2_composite_add_8888_8888 (pixman_implementation_t *imp,
|
|||
}
|
||||
|
||||
static pixman_bool_t
|
||||
pixman_blt_sse2 (uint32_t *src_bits,
|
||||
uint32_t *dst_bits,
|
||||
int src_stride,
|
||||
int dst_stride,
|
||||
int src_bpp,
|
||||
int dst_bpp,
|
||||
int src_x,
|
||||
int src_y,
|
||||
int dest_x,
|
||||
int dest_y,
|
||||
int width,
|
||||
int height)
|
||||
sse2_blt (pixman_implementation_t *imp,
|
||||
uint32_t * src_bits,
|
||||
uint32_t * dst_bits,
|
||||
int src_stride,
|
||||
int dst_stride,
|
||||
int src_bpp,
|
||||
int dst_bpp,
|
||||
int src_x,
|
||||
int src_y,
|
||||
int dest_x,
|
||||
int dest_y,
|
||||
int width,
|
||||
int height)
|
||||
{
|
||||
uint8_t * src_bytes;
|
||||
uint8_t * dst_bytes;
|
||||
|
@ -4640,7 +4645,6 @@ pixman_blt_sse2 (uint32_t *src_bits,
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -4649,13 +4653,13 @@ sse2_composite_copy_area (pixman_implementation_t *imp,
|
|||
pixman_composite_info_t *info)
|
||||
{
|
||||
PIXMAN_COMPOSITE_ARGS (info);
|
||||
pixman_blt_sse2 (src_image->bits.bits,
|
||||
dest_image->bits.bits,
|
||||
src_image->bits.rowstride,
|
||||
dest_image->bits.rowstride,
|
||||
PIXMAN_FORMAT_BPP (src_image->bits.format),
|
||||
PIXMAN_FORMAT_BPP (dest_image->bits.format),
|
||||
src_x, src_y, dest_x, dest_y, width, height);
|
||||
sse2_blt (imp, src_image->bits.bits,
|
||||
dest_image->bits.bits,
|
||||
src_image->bits.rowstride,
|
||||
dest_image->bits.rowstride,
|
||||
PIXMAN_FORMAT_BPP (src_image->bits.format),
|
||||
PIXMAN_FORMAT_BPP (dest_image->bits.format),
|
||||
src_x, src_y, dest_x, dest_y, width, height);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -5958,58 +5962,6 @@ static const pixman_fast_path_t sse2_fast_paths[] =
|
|||
{ PIXMAN_OP_NONE },
|
||||
};
|
||||
|
||||
static pixman_bool_t
|
||||
sse2_blt (pixman_implementation_t *imp,
|
||||
uint32_t * src_bits,
|
||||
uint32_t * dst_bits,
|
||||
int src_stride,
|
||||
int dst_stride,
|
||||
int src_bpp,
|
||||
int dst_bpp,
|
||||
int src_x,
|
||||
int src_y,
|
||||
int dest_x,
|
||||
int dest_y,
|
||||
int width,
|
||||
int height)
|
||||
{
|
||||
if (!pixman_blt_sse2 (
|
||||
src_bits, dst_bits, src_stride, dst_stride, src_bpp, dst_bpp,
|
||||
src_x, src_y, dest_x, dest_y, width, height))
|
||||
|
||||
{
|
||||
return _pixman_implementation_blt (
|
||||
imp->delegate,
|
||||
src_bits, dst_bits, src_stride, dst_stride, src_bpp, dst_bpp,
|
||||
src_x, src_y, dest_x, dest_y, width, height);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#if defined(__GNUC__) && !defined(__x86_64__) && !defined(__amd64__)
|
||||
__attribute__((__force_align_arg_pointer__))
|
||||
#endif
|
||||
static pixman_bool_t
|
||||
sse2_fill (pixman_implementation_t *imp,
|
||||
uint32_t * bits,
|
||||
int stride,
|
||||
int bpp,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height,
|
||||
uint32_t xor)
|
||||
{
|
||||
if (!pixman_fill_sse2 (bits, stride, bpp, x, y, width, height, xor))
|
||||
{
|
||||
return _pixman_implementation_fill (
|
||||
imp->delegate, bits, stride, bpp, x, y, width, height, xor);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static uint32_t *
|
||||
sse2_fetch_x8r8g8b8 (pixman_iter_t *iter, const uint32_t *mask)
|
||||
{
|
||||
|
@ -6152,7 +6104,7 @@ static const fetcher_info_t fetchers[] =
|
|||
{ PIXMAN_null }
|
||||
};
|
||||
|
||||
static void
|
||||
static pixman_bool_t
|
||||
sse2_src_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter)
|
||||
{
|
||||
pixman_image_t *image = iter->image;
|
||||
|
@ -6177,12 +6129,12 @@ sse2_src_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter)
|
|||
iter->stride = s;
|
||||
|
||||
iter->get_scanline = f->get_scanline;
|
||||
return;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
imp->delegate->src_iter_init (imp->delegate, iter);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#if defined(__GNUC__) && !defined(__x86_64__) && !defined(__amd64__)
|
||||
|
|
|
@ -230,11 +230,11 @@ pixman_line_fixed_edge_init (pixman_edge_t * e,
|
|||
}
|
||||
|
||||
PIXMAN_EXPORT void
|
||||
pixman_add_traps (pixman_image_t * image,
|
||||
int16_t x_off,
|
||||
int16_t y_off,
|
||||
int ntrap,
|
||||
pixman_trap_t * traps)
|
||||
pixman_add_traps (pixman_image_t * image,
|
||||
int16_t x_off,
|
||||
int16_t y_off,
|
||||
int ntrap,
|
||||
const pixman_trap_t *traps)
|
||||
{
|
||||
int bpp;
|
||||
int height;
|
||||
|
@ -387,18 +387,95 @@ pixman_rasterize_trapezoid (pixman_image_t * image,
|
|||
}
|
||||
}
|
||||
|
||||
static const pixman_bool_t zero_src_has_no_effect[PIXMAN_N_OPERATORS] =
|
||||
{
|
||||
FALSE, /* Clear 0 0 */
|
||||
FALSE, /* Src 1 0 */
|
||||
TRUE, /* Dst 0 1 */
|
||||
TRUE, /* Over 1 1-Aa */
|
||||
TRUE, /* OverReverse 1-Ab 1 */
|
||||
FALSE, /* In Ab 0 */
|
||||
FALSE, /* InReverse 0 Aa */
|
||||
FALSE, /* Out 1-Ab 0 */
|
||||
TRUE, /* OutReverse 0 1-Aa */
|
||||
TRUE, /* Atop Ab 1-Aa */
|
||||
FALSE, /* AtopReverse 1-Ab Aa */
|
||||
TRUE, /* Xor 1-Ab 1-Aa */
|
||||
TRUE, /* Add 1 1 */
|
||||
};
|
||||
|
||||
static pixman_bool_t
|
||||
get_trap_extents (pixman_op_t op, pixman_image_t *dest,
|
||||
const pixman_trapezoid_t *traps, int n_traps,
|
||||
pixman_box32_t *box)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* When the operator is such that a zero source has an
|
||||
* effect on the underlying image, we have to
|
||||
* composite across the entire destination
|
||||
*/
|
||||
if (!zero_src_has_no_effect [op])
|
||||
{
|
||||
box->x1 = 0;
|
||||
box->y1 = 0;
|
||||
box->x2 = dest->bits.width;
|
||||
box->y2 = dest->bits.height;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
box->x1 = INT32_MAX;
|
||||
box->y1 = INT32_MAX;
|
||||
box->x2 = INT32_MIN;
|
||||
box->y2 = INT32_MIN;
|
||||
|
||||
for (i = 0; i < n_traps; ++i)
|
||||
{
|
||||
const pixman_trapezoid_t *trap = &(traps[i]);
|
||||
int y1, y2;
|
||||
|
||||
if (!pixman_trapezoid_valid (trap))
|
||||
continue;
|
||||
|
||||
y1 = pixman_fixed_to_int (trap->top);
|
||||
if (y1 < box->y1)
|
||||
box->y1 = y1;
|
||||
|
||||
y2 = pixman_fixed_to_int (pixman_fixed_ceil (trap->bottom));
|
||||
if (y2 > box->y2)
|
||||
box->y2 = y2;
|
||||
|
||||
#define EXTEND_MIN(x) \
|
||||
if (pixman_fixed_to_int ((x)) < box->x1) \
|
||||
box->x1 = pixman_fixed_to_int ((x));
|
||||
#define EXTEND_MAX(x) \
|
||||
if (pixman_fixed_to_int (pixman_fixed_ceil ((x))) > box->x2) \
|
||||
box->x2 = pixman_fixed_to_int (pixman_fixed_ceil ((x)));
|
||||
|
||||
#define EXTEND(x) \
|
||||
EXTEND_MIN(x); \
|
||||
EXTEND_MAX(x);
|
||||
|
||||
EXTEND(trap->left.p1.x);
|
||||
EXTEND(trap->left.p2.x);
|
||||
EXTEND(trap->right.p1.x);
|
||||
EXTEND(trap->right.p2.x);
|
||||
}
|
||||
|
||||
if (box->x1 >= box->x2 || box->y1 >= box->y2)
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
* pixman_composite_trapezoids()
|
||||
*
|
||||
* All the trapezoids are conceptually rendered to an infinitely big image.
|
||||
* The (0, 0) coordinates of this image are then aligned with the (x, y)
|
||||
* coordinates of the source image, and then both images are aligned with
|
||||
* the (x, y) coordinates of the destination. Then, in principle, compositing
|
||||
* of these three images takes place across the entire destination.
|
||||
*
|
||||
* FIXME: However, there is currently a bug, where we restrict this compositing
|
||||
* to the bounding box of the trapezoids. This is incorrect for operators such
|
||||
* as SRC and IN where blank source pixels do have an effect on the destination.
|
||||
* the (x, y) coordinates of the destination. Then these three images are
|
||||
* composited across the entire destination.
|
||||
*/
|
||||
PIXMAN_EXPORT void
|
||||
pixman_composite_trapezoids (pixman_op_t op,
|
||||
|
@ -439,46 +516,9 @@ pixman_composite_trapezoids (pixman_op_t op,
|
|||
{
|
||||
pixman_image_t *tmp;
|
||||
pixman_box32_t box;
|
||||
|
||||
box.x1 = INT32_MAX;
|
||||
box.y1 = INT32_MAX;
|
||||
box.x2 = INT32_MIN;
|
||||
box.y2 = INT32_MIN;
|
||||
|
||||
for (i = 0; i < n_traps; ++i)
|
||||
{
|
||||
const pixman_trapezoid_t *trap = &(traps[i]);
|
||||
int y1, y2;
|
||||
|
||||
if (!pixman_trapezoid_valid (trap))
|
||||
continue;
|
||||
|
||||
y1 = pixman_fixed_to_int (trap->top);
|
||||
if (y1 < box.y1)
|
||||
box.y1 = y1;
|
||||
|
||||
y2 = pixman_fixed_to_int (pixman_fixed_ceil (trap->bottom));
|
||||
if (y2 > box.y2)
|
||||
box.y2 = y2;
|
||||
|
||||
#define EXTEND_MIN(x) \
|
||||
if (pixman_fixed_to_int ((x)) < box.x1) \
|
||||
box.x1 = pixman_fixed_to_int ((x));
|
||||
#define EXTEND_MAX(x) \
|
||||
if (pixman_fixed_to_int (pixman_fixed_ceil ((x))) > box.x2) \
|
||||
box.x2 = pixman_fixed_to_int (pixman_fixed_ceil ((x)));
|
||||
|
||||
#define EXTEND(x) \
|
||||
EXTEND_MIN(x); \
|
||||
EXTEND_MAX(x);
|
||||
|
||||
EXTEND(trap->left.p1.x);
|
||||
EXTEND(trap->left.p2.x);
|
||||
EXTEND(trap->right.p1.x);
|
||||
EXTEND(trap->right.p2.x);
|
||||
}
|
||||
|
||||
if (box.x1 >= box.x2 || box.y1 >= box.y2)
|
||||
int i;
|
||||
|
||||
if (!get_trap_extents (op, dst, traps, n_traps, &box))
|
||||
return;
|
||||
|
||||
tmp = pixman_image_create_bits (
|
||||
|
|
|
@ -31,118 +31,6 @@
|
|||
|
||||
#include "pixman-private.h"
|
||||
|
||||
#define N_CACHED_FAST_PATHS 8
|
||||
|
||||
typedef struct
|
||||
{
|
||||
struct
|
||||
{
|
||||
pixman_implementation_t * imp;
|
||||
pixman_fast_path_t fast_path;
|
||||
} cache [N_CACHED_FAST_PATHS];
|
||||
} cache_t;
|
||||
|
||||
PIXMAN_DEFINE_THREAD_LOCAL (cache_t, fast_path_cache);
|
||||
|
||||
pixman_bool_t
|
||||
_pixman_lookup_composite_function (pixman_implementation_t *toplevel,
|
||||
pixman_op_t op,
|
||||
pixman_format_code_t src_format,
|
||||
uint32_t src_flags,
|
||||
pixman_format_code_t mask_format,
|
||||
uint32_t mask_flags,
|
||||
pixman_format_code_t dest_format,
|
||||
uint32_t dest_flags,
|
||||
pixman_implementation_t **out_imp,
|
||||
pixman_composite_func_t *out_func)
|
||||
{
|
||||
pixman_implementation_t *imp;
|
||||
cache_t *cache;
|
||||
int i;
|
||||
|
||||
/* Check cache for fast paths */
|
||||
cache = PIXMAN_GET_THREAD_LOCAL (fast_path_cache);
|
||||
|
||||
for (i = 0; i < N_CACHED_FAST_PATHS; ++i)
|
||||
{
|
||||
const pixman_fast_path_t *info = &(cache->cache[i].fast_path);
|
||||
|
||||
/* Note that we check for equality here, not whether
|
||||
* the cached fast path matches. This is to prevent
|
||||
* us from selecting an overly general fast path
|
||||
* when a more specific one would work.
|
||||
*/
|
||||
if (info->op == op &&
|
||||
info->src_format == src_format &&
|
||||
info->mask_format == mask_format &&
|
||||
info->dest_format == dest_format &&
|
||||
info->src_flags == src_flags &&
|
||||
info->mask_flags == mask_flags &&
|
||||
info->dest_flags == dest_flags &&
|
||||
info->func)
|
||||
{
|
||||
*out_imp = cache->cache[i].imp;
|
||||
*out_func = cache->cache[i].fast_path.func;
|
||||
|
||||
goto update_cache;
|
||||
}
|
||||
}
|
||||
|
||||
for (imp = toplevel; imp != NULL; imp = imp->delegate)
|
||||
{
|
||||
const pixman_fast_path_t *info = imp->fast_paths;
|
||||
|
||||
while (info->op != PIXMAN_OP_NONE)
|
||||
{
|
||||
if ((info->op == op || info->op == PIXMAN_OP_any) &&
|
||||
/* Formats */
|
||||
((info->src_format == src_format) ||
|
||||
(info->src_format == PIXMAN_any)) &&
|
||||
((info->mask_format == mask_format) ||
|
||||
(info->mask_format == PIXMAN_any)) &&
|
||||
((info->dest_format == dest_format) ||
|
||||
(info->dest_format == PIXMAN_any)) &&
|
||||
/* Flags */
|
||||
(info->src_flags & src_flags) == info->src_flags &&
|
||||
(info->mask_flags & mask_flags) == info->mask_flags &&
|
||||
(info->dest_flags & dest_flags) == info->dest_flags)
|
||||
{
|
||||
*out_imp = imp;
|
||||
*out_func = info->func;
|
||||
|
||||
/* Set i to the last spot in the cache so that the
|
||||
* move-to-front code below will work
|
||||
*/
|
||||
i = N_CACHED_FAST_PATHS - 1;
|
||||
|
||||
goto update_cache;
|
||||
}
|
||||
|
||||
++info;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
|
||||
update_cache:
|
||||
if (i)
|
||||
{
|
||||
while (i--)
|
||||
cache->cache[i + 1] = cache->cache[i];
|
||||
|
||||
cache->cache[0].imp = *out_imp;
|
||||
cache->cache[0].fast_path.op = op;
|
||||
cache->cache[0].fast_path.src_format = src_format;
|
||||
cache->cache[0].fast_path.src_flags = src_flags;
|
||||
cache->cache[0].fast_path.mask_format = mask_format;
|
||||
cache->cache[0].fast_path.mask_flags = mask_flags;
|
||||
cache->cache[0].fast_path.dest_format = dest_format;
|
||||
cache->cache[0].fast_path.dest_flags = dest_flags;
|
||||
cache->cache[0].fast_path.func = *out_func;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
pixman_bool_t
|
||||
_pixman_multiply_overflows_size (size_t a, size_t b)
|
||||
{
|
||||
|
@ -184,59 +72,96 @@ pixman_malloc_abc (unsigned int a,
|
|||
return malloc (a * b * c);
|
||||
}
|
||||
|
||||
static void
|
||||
unorm_to_unorm_params (int in_width, int out_width, uint32_t *factor, int *shift)
|
||||
static force_inline uint16_t
|
||||
float_to_unorm (float f, int n_bits)
|
||||
{
|
||||
int w = 0;
|
||||
uint32_t u;
|
||||
|
||||
*factor = 0;
|
||||
while (in_width != 0 && w < out_width)
|
||||
{
|
||||
*factor |= 1 << w;
|
||||
w += in_width;
|
||||
}
|
||||
if (f > 1.0)
|
||||
f = 1.0;
|
||||
if (f < 0.0)
|
||||
f = 0.0;
|
||||
|
||||
/* Did we generate too many bits? */
|
||||
*shift = w - out_width;
|
||||
u = f * (1 << n_bits);
|
||||
u -= (u >> n_bits);
|
||||
|
||||
return u;
|
||||
}
|
||||
|
||||
static force_inline float
|
||||
unorm_to_float (uint16_t u, int n_bits)
|
||||
{
|
||||
uint32_t m = ((1 << n_bits) - 1);
|
||||
|
||||
return (u & m) * (1.f / (float)m);
|
||||
}
|
||||
|
||||
/*
|
||||
* This function expands images from ARGB8 format to ARGB16. To preserve
|
||||
* precision, it needs to know the original source format. For example, if the
|
||||
* source was PIXMAN_x1r5g5b5 and the red component contained bits 12345, then
|
||||
* the expanded value is 12345123. To correctly expand this to 16 bits, it
|
||||
* should be 1234512345123451 and not 1234512312345123.
|
||||
* This function expands images from a8r8g8b8 to argb_t. To preserve
|
||||
* precision, it needs to know from which source format the a8r8g8b8 pixels
|
||||
* originally came.
|
||||
*
|
||||
* For example, if the source was PIXMAN_x1r5g5b5 and the red component
|
||||
* contained bits 12345, then the 8-bit value is 12345123. To correctly
|
||||
* expand this to floating point, it should be 12345 / 31.0 and not
|
||||
* 12345123 / 255.0.
|
||||
*/
|
||||
void
|
||||
pixman_expand (uint64_t * dst,
|
||||
const uint32_t * src,
|
||||
pixman_format_code_t format,
|
||||
int width)
|
||||
pixman_expand_to_float (argb_t *dst,
|
||||
const uint32_t *src,
|
||||
pixman_format_code_t format,
|
||||
int width)
|
||||
{
|
||||
static const float multipliers[16] = {
|
||||
0.0f,
|
||||
1.0f / ((1 << 1) - 1),
|
||||
1.0f / ((1 << 2) - 1),
|
||||
1.0f / ((1 << 3) - 1),
|
||||
1.0f / ((1 << 4) - 1),
|
||||
1.0f / ((1 << 5) - 1),
|
||||
1.0f / ((1 << 6) - 1),
|
||||
1.0f / ((1 << 7) - 1),
|
||||
1.0f / ((1 << 8) - 1),
|
||||
1.0f / ((1 << 9) - 1),
|
||||
1.0f / ((1 << 10) - 1),
|
||||
1.0f / ((1 << 11) - 1),
|
||||
1.0f / ((1 << 12) - 1),
|
||||
1.0f / ((1 << 13) - 1),
|
||||
1.0f / ((1 << 14) - 1),
|
||||
1.0f / ((1 << 15) - 1),
|
||||
};
|
||||
int a_size, r_size, g_size, b_size;
|
||||
int a_shift, r_shift, g_shift, b_shift;
|
||||
float a_mul, r_mul, g_mul, b_mul;
|
||||
uint32_t a_mask, r_mask, g_mask, b_mask;
|
||||
int i;
|
||||
|
||||
if (!PIXMAN_FORMAT_VIS (format))
|
||||
format = PIXMAN_a8r8g8b8;
|
||||
|
||||
/*
|
||||
* Determine the sizes of each component and the masks and shifts
|
||||
* required to extract them from the source pixel.
|
||||
*/
|
||||
const int a_size = PIXMAN_FORMAT_A (format),
|
||||
r_size = PIXMAN_FORMAT_R (format),
|
||||
g_size = PIXMAN_FORMAT_G (format),
|
||||
b_size = PIXMAN_FORMAT_B (format);
|
||||
const int a_shift = 32 - a_size,
|
||||
r_shift = 24 - r_size,
|
||||
g_shift = 16 - g_size,
|
||||
b_shift = 8 - b_size;
|
||||
const uint8_t a_mask = ~(~0 << a_size),
|
||||
r_mask = ~(~0 << r_size),
|
||||
g_mask = ~(~0 << g_size),
|
||||
b_mask = ~(~0 << b_size);
|
||||
uint32_t au_factor, ru_factor, gu_factor, bu_factor;
|
||||
int au_shift, ru_shift, gu_shift, bu_shift;
|
||||
int i;
|
||||
a_size = PIXMAN_FORMAT_A (format);
|
||||
r_size = PIXMAN_FORMAT_R (format);
|
||||
g_size = PIXMAN_FORMAT_G (format);
|
||||
b_size = PIXMAN_FORMAT_B (format);
|
||||
|
||||
unorm_to_unorm_params (a_size, 16, &au_factor, &au_shift);
|
||||
unorm_to_unorm_params (r_size, 16, &ru_factor, &ru_shift);
|
||||
unorm_to_unorm_params (g_size, 16, &gu_factor, &gu_shift);
|
||||
unorm_to_unorm_params (b_size, 16, &bu_factor, &bu_shift);
|
||||
a_shift = 32 - a_size;
|
||||
r_shift = 24 - r_size;
|
||||
g_shift = 16 - g_size;
|
||||
b_shift = 8 - b_size;
|
||||
|
||||
a_mask = ((1 << a_size) - 1);
|
||||
r_mask = ((1 << r_size) - 1);
|
||||
g_mask = ((1 << g_size) - 1);
|
||||
b_mask = ((1 << b_size) - 1);
|
||||
|
||||
a_mul = multipliers[a_size];
|
||||
r_mul = multipliers[r_size];
|
||||
g_mul = multipliers[g_size];
|
||||
b_mul = multipliers[b_size];
|
||||
|
||||
/* Start at the end so that we can do the expansion in place
|
||||
* when src == dst
|
||||
|
@ -244,59 +169,43 @@ pixman_expand (uint64_t * dst,
|
|||
for (i = width - 1; i >= 0; i--)
|
||||
{
|
||||
const uint32_t pixel = src[i];
|
||||
uint8_t a, r, g, b;
|
||||
uint64_t a16, r16, g16, b16;
|
||||
|
||||
if (a_size)
|
||||
{
|
||||
a = (pixel >> a_shift) & a_mask;
|
||||
a16 = a * au_factor >> au_shift;
|
||||
}
|
||||
else
|
||||
{
|
||||
a16 = 0xffff;
|
||||
}
|
||||
|
||||
if (r_size)
|
||||
{
|
||||
r = (pixel >> r_shift) & r_mask;
|
||||
g = (pixel >> g_shift) & g_mask;
|
||||
b = (pixel >> b_shift) & b_mask;
|
||||
r16 = r * ru_factor >> ru_shift;
|
||||
g16 = g * gu_factor >> gu_shift;
|
||||
b16 = b * bu_factor >> bu_shift;
|
||||
}
|
||||
else
|
||||
{
|
||||
r16 = g16 = b16 = 0;
|
||||
}
|
||||
|
||||
dst[i] = a16 << 48 | r16 << 32 | g16 << 16 | b16;
|
||||
dst[i].a = a_mask? ((pixel >> a_shift) & a_mask) * a_mul : 1.0f;
|
||||
dst[i].r = ((pixel >> r_shift) & r_mask) * r_mul;
|
||||
dst[i].g = ((pixel >> g_shift) & g_mask) * g_mul;
|
||||
dst[i].b = ((pixel >> b_shift) & b_mask) * b_mul;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Contracting is easier than expanding. We just need to truncate the
|
||||
* components.
|
||||
*/
|
||||
uint16_t
|
||||
pixman_float_to_unorm (float f, int n_bits)
|
||||
{
|
||||
return float_to_unorm (f, n_bits);
|
||||
}
|
||||
|
||||
float
|
||||
pixman_unorm_to_float (uint16_t u, int n_bits)
|
||||
{
|
||||
return unorm_to_float (u, n_bits);
|
||||
}
|
||||
|
||||
void
|
||||
pixman_contract (uint32_t * dst,
|
||||
const uint64_t *src,
|
||||
int width)
|
||||
pixman_contract_from_float (uint32_t *dst,
|
||||
const argb_t *src,
|
||||
int width)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* Start at the beginning so that we can do the contraction in
|
||||
* place when src == dst
|
||||
*/
|
||||
for (i = 0; i < width; i++)
|
||||
for (i = 0; i < width; ++i)
|
||||
{
|
||||
const uint8_t a = src[i] >> 56,
|
||||
r = src[i] >> 40,
|
||||
g = src[i] >> 24,
|
||||
b = src[i] >> 8;
|
||||
uint8_t a, r, g, b;
|
||||
|
||||
dst[i] = a << 24 | r << 16 | g << 8 | b;
|
||||
a = float_to_unorm (src[i].a, 8);
|
||||
r = float_to_unorm (src[i].r, 8);
|
||||
g = float_to_unorm (src[i].g, 8);
|
||||
b = float_to_unorm (src[i].b, 8);
|
||||
|
||||
dst[i] = (a << 24) | (r << 16) | (g << 8) | (b << 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -375,6 +284,15 @@ pixman_region32_copy_from_region16 (pixman_region32_t *dst,
|
|||
return retval;
|
||||
}
|
||||
|
||||
/* This function is exported for the sake of the test suite and not part
|
||||
* of the ABI.
|
||||
*/
|
||||
PIXMAN_EXPORT pixman_implementation_t *
|
||||
_pixman_internal_only_get_implementation (void)
|
||||
{
|
||||
return get_implementation ();
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
|
||||
void
|
||||
|
|
|
@ -605,6 +605,7 @@ pixman_image_composite32 (pixman_op_t op,
|
|||
if ((mask_format == PIXMAN_a8r8g8b8 || mask_format == PIXMAN_a8b8g8r8) &&
|
||||
(src->type == BITS && src->bits.bits == mask->bits.bits) &&
|
||||
(src->common.repeat == mask->common.repeat) &&
|
||||
(src_flags & mask_flags & FAST_PATH_ID_TRANSFORM) &&
|
||||
(src_x == mask_x && src_y == mask_y))
|
||||
{
|
||||
if (src_format == PIXMAN_x8b8g8r8)
|
||||
|
@ -669,7 +670,7 @@ pixman_image_composite32 (pixman_op_t op,
|
|||
*/
|
||||
op = optimize_operator (op, src_flags, mask_flags, dest_flags);
|
||||
|
||||
if (_pixman_lookup_composite_function (
|
||||
if (_pixman_implementation_lookup_composite (
|
||||
get_implementation (), op,
|
||||
src_format, src_flags, mask_format, mask_flags, dest_format, dest_flags,
|
||||
&imp, &func))
|
||||
|
@ -774,9 +775,9 @@ color_to_uint32 (const pixman_color_t *color)
|
|||
}
|
||||
|
||||
static pixman_bool_t
|
||||
color_to_pixel (pixman_color_t * color,
|
||||
uint32_t * pixel,
|
||||
pixman_format_code_t format)
|
||||
color_to_pixel (const pixman_color_t *color,
|
||||
uint32_t * pixel,
|
||||
pixman_format_code_t format)
|
||||
{
|
||||
uint32_t c = color_to_uint32 (color);
|
||||
|
||||
|
@ -833,7 +834,7 @@ color_to_pixel (pixman_color_t * color,
|
|||
PIXMAN_EXPORT pixman_bool_t
|
||||
pixman_image_fill_rectangles (pixman_op_t op,
|
||||
pixman_image_t * dest,
|
||||
pixman_color_t * color,
|
||||
const pixman_color_t * color,
|
||||
int n_rects,
|
||||
const pixman_rectangle16_t *rects)
|
||||
{
|
||||
|
@ -872,7 +873,7 @@ pixman_image_fill_rectangles (pixman_op_t op,
|
|||
PIXMAN_EXPORT pixman_bool_t
|
||||
pixman_image_fill_boxes (pixman_op_t op,
|
||||
pixman_image_t * dest,
|
||||
pixman_color_t * color,
|
||||
const pixman_color_t *color,
|
||||
int n_boxes,
|
||||
const pixman_box32_t *boxes)
|
||||
{
|
||||
|
|
|
@ -739,18 +739,18 @@ pixman_bool_t pixman_format_supported_destination (pixman_format_code_t format);
|
|||
pixman_bool_t pixman_format_supported_source (pixman_format_code_t format);
|
||||
|
||||
/* Constructors */
|
||||
pixman_image_t *pixman_image_create_solid_fill (pixman_color_t *color);
|
||||
pixman_image_t *pixman_image_create_linear_gradient (pixman_point_fixed_t *p1,
|
||||
pixman_point_fixed_t *p2,
|
||||
pixman_image_t *pixman_image_create_solid_fill (const pixman_color_t *color);
|
||||
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_image_t *pixman_image_create_radial_gradient (pixman_point_fixed_t *inner,
|
||||
pixman_point_fixed_t *outer,
|
||||
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_image_t *pixman_image_create_conical_gradient (pixman_point_fixed_t *center,
|
||||
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);
|
||||
|
@ -759,6 +759,11 @@ pixman_image_t *pixman_image_create_bits (pixman_format_code_t
|
|||
int height,
|
||||
uint32_t *bits,
|
||||
int rowstride_bytes);
|
||||
pixman_image_t *pixman_image_create_bits_no_clear (pixman_format_code_t format,
|
||||
int width,
|
||||
int height,
|
||||
uint32_t * bits,
|
||||
int rowstride_bytes);
|
||||
|
||||
/* Destructor */
|
||||
pixman_image_t *pixman_image_ref (pixman_image_t *image);
|
||||
|
@ -806,12 +811,12 @@ int pixman_image_get_depth (pixman_image_t *image);
|
|||
pixman_format_code_t pixman_image_get_format (pixman_image_t *image);
|
||||
pixman_bool_t pixman_image_fill_rectangles (pixman_op_t op,
|
||||
pixman_image_t *image,
|
||||
pixman_color_t *color,
|
||||
const pixman_color_t *color,
|
||||
int n_rects,
|
||||
const pixman_rectangle16_t *rects);
|
||||
pixman_bool_t pixman_image_fill_boxes (pixman_op_t op,
|
||||
pixman_image_t *dest,
|
||||
pixman_color_t *color,
|
||||
const pixman_color_t *color,
|
||||
int n_boxes,
|
||||
const pixman_box32_t *boxes);
|
||||
|
||||
|
@ -905,7 +910,7 @@ void pixman_glyph_get_extents (pixman_glyph_cache_t *cac
|
|||
pixman_box32_t *extents);
|
||||
pixman_format_code_t pixman_glyph_get_mask_format (pixman_glyph_cache_t *cache,
|
||||
int n_glyphs,
|
||||
pixman_glyph_t * glyphs);
|
||||
const pixman_glyph_t *glyphs);
|
||||
void pixman_composite_glyphs (pixman_op_t op,
|
||||
pixman_image_t *src,
|
||||
pixman_image_t *dest,
|
||||
|
@ -920,7 +925,7 @@ void pixman_composite_glyphs (pixman_op_t op,
|
|||
int32_t height,
|
||||
pixman_glyph_cache_t *cache,
|
||||
int n_glyphs,
|
||||
pixman_glyph_t *glyphs);
|
||||
const pixman_glyph_t *glyphs);
|
||||
void pixman_composite_glyphs_no_mask (pixman_op_t op,
|
||||
pixman_image_t *src,
|
||||
pixman_image_t *dest,
|
||||
|
@ -930,7 +935,7 @@ void pixman_composite_glyphs_no_mask (pixman_op_t op,
|
|||
int32_t dest_y,
|
||||
pixman_glyph_cache_t *cache,
|
||||
int n_glyphs,
|
||||
pixman_glyph_t *glyphs);
|
||||
const pixman_glyph_t *glyphs);
|
||||
|
||||
/*
|
||||
* Trapezoids
|
||||
|
@ -1016,7 +1021,7 @@ void pixman_add_traps (pixman_image_t *image,
|
|||
int16_t x_off,
|
||||
int16_t y_off,
|
||||
int ntrap,
|
||||
pixman_trap_t *traps);
|
||||
const pixman_trap_t *traps);
|
||||
void pixman_add_trapezoids (pixman_image_t *image,
|
||||
int16_t x_off,
|
||||
int y_off,
|
||||
|
|
Загрузка…
Ссылка в новой задаче