op, dest, src, mask, width);
}
+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 dst_x,
+ int dst_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, dst_x, dst_y,
+ width, height);
+}
+
pixman_implementation_t *
_pixman_implementation_create (pixman_implementation_t *toplevel,
pixman_implementation_t *delegate)
/* Fill out function pointers with ones that just delegate
*/
imp->composite = delegate_composite;
+ imp->blt = delegate_blt;
for (i = 0; i < PIXMAN_OP_LAST; ++i)
{
src_x, src_y, mask_x, mask_y, dest_x, dest_y,
width, height);
}
+
+pixman_bool_t
+_pixman_implementation_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 dst_x,
+ int dst_y,
+ int width,
+ int height)
+{
+ return (* imp->blt) (imp, src_bits, dst_bits, src_stride, dst_stride,
+ src_bpp, dst_bpp, src_x, src_y, dst_x, dst_y,
+ width, height);
+}
_mm_empty();
}
-pixman_bool_t
+static pixman_bool_t
pixman_blt_mmx (uint32_t *src_bits,
uint32_t *dst_bits,
int src_stride,
return TRUE;
}
-void
+static void
fbCompositeCopyAreammx (pixman_implementation_t *imp,
pixman_op_t op,
pixman_image_t * pSrc,
_mm_empty();
}
-static const FastPathInfo mmx_fast_path_array[] =
+static const FastPathInfo mmx_fast_paths[] =
{
{ PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8, PIXMAN_r5g6b5, fbCompositeSolidMask_nx8x0565mmx, 0 },
{ PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8, PIXMAN_b5g6r5, fbCompositeSolidMask_nx8x0565mmx, 0 },
{ PIXMAN_OP_NONE },
};
-const FastPathInfo *const mmx_fast_paths = mmx_fast_path_array;
static void
mmx_composite (pixman_implementation_t *imp,
width, height);
}
+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 dst_x, int dst_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, dst_x, dst_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, dst_x, dst_y, width, height);
+ }
+
+ return TRUE;
+}
+
pixman_implementation_t *
_pixman_implementation_create_mmx (pixman_implementation_t *toplevel)
{
imp->combine_32_ca[PIXMAN_OP_ADD] = mmxCombineAddC;
imp->composite = mmx_composite;
-
+ imp->blt = mmx_blt;
+
return imp;
}
#ifdef USE_MMX
-extern const FastPathInfo *const mmx_fast_paths;
-
-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 dst_x, int dst_y,
- int width, int height);
pixman_bool_t
pixman_fill_mmx (uint32_t *bits,
int stride,
int height,
uint32_t xor);
-void fbComposeSetupMMX(void);
-void fbCompositeCopyAreammx (pixman_implementation_t *imp,
- pixman_op_t op,
- pixman_image_t * pSrc,
- pixman_image_t * pMask,
- pixman_image_t * pDst,
- int32_t xSrc,
- int32_t ySrc,
- int32_t xMask,
- int32_t yMask,
- int32_t xDst,
- int32_t yDst,
- int32_t width,
- int32_t height);
-
#endif /* USE_MMX */
#endif /* _PIXMAN_MMX_H_ */
}
+static pixman_implementation_t *imp;
+
PIXMAN_EXPORT void
pixman_image_composite (pixman_op_t op,
pixman_image_t * src,
uint16_t width,
uint16_t height)
{
- static pixman_implementation_t *imp;
-
/*
* Check if we can replace our operator by a simpler one if the src or dest are opaque
* The output operator should be mathematically equivalent to the source.
int32_t dest_y,
int32_t width,
int32_t height);
+typedef pixman_bool_t (* pixman_blt_func_t) (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 dst_x,
+ int dst_y,
+ int width,
+ int height);
void
_pixman_walk_composite_region (pixman_implementation_t *imp,
pixman_implementation_t * delegate;
pixman_composite_func_t composite;
+ pixman_blt_func_t blt;
pixman_combine_32_func_t combine_32[PIXMAN_OP_LAST];
pixman_combine_32_func_t combine_32_ca[PIXMAN_OP_LAST];
int32_t width,
int32_t height);
+pixman_bool_t
+_pixman_implementation_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 dst_x,
+ int dst_y,
+ int width,
+ int height);
+
/* Specific implementations */
pixman_implementation_t *
_pixman_implementation_create_general (pixman_implementation_t *toplevel);
* fbCompositeCopyAreasse2
*/
-pixman_bool_t
+static pixman_bool_t
pixmanBltsse2 (uint32_t *src_bits,
uint32_t *dst_bits,
int src_stride,
width, height);
}
+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 dst_x, int dst_y,
+ int width, int height)
+{
+ if (!pixmanBltsse2 (
+ src_bits, dst_bits, src_stride, dst_stride, src_bpp, dst_bpp,
+ src_x, src_y, dst_x, dst_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, dst_x, dst_y, width, height);
+ }
+
+ return TRUE;
+}
+
pixman_implementation_t *
_pixman_implementation_create_sse2 (pixman_implementation_t *toplevel)
{
imp->combine_32_ca[PIXMAN_OP_ADD] = sse2CombineAddC;
imp->composite = sse2_composite;
+ imp->blt = sse2_blt;
return imp;
}
int height,
uint32_t data);
-pixman_bool_t
-pixmanBltsse2 (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 dst_x, int dst_y,
- int width, int height);
-
#endif /* USE_SSE2 */
#endif /* _PIXMAN_SSE_H_ */
#include "pixman-mmx.h"
#include "pixman-sse2.h"
-#if defined(USE_SSE2) && defined(__GNUC__) && !defined(__x86_64__) && !defined(__amd64__)
-__attribute__((__force_align_arg_pointer__))
-#endif
-PIXMAN_EXPORT pixman_bool_t
-pixman_blt (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 dst_x, int dst_y,
- int width, int height)
-{
-#ifdef USE_SSE2
- if (pixman_have_sse2())
- {
- return pixmanBltsse2 (src_bits, dst_bits, src_stride, dst_stride, src_bpp, dst_bpp,
- src_x, src_y, dst_x, dst_y, width, height);
- }
- else
-#endif
-#ifdef USE_MMX
- if (pixman_have_mmx())
- {
- return pixman_blt_mmx (src_bits, dst_bits, src_stride, dst_stride, src_bpp, dst_bpp,
- src_x, src_y, dst_x, dst_y, width, height);
- }
- else
-#endif
- return FALSE;
-}
-
static void
pixman_fill8 (uint32_t *bits,
int stride,