- Add non-mmx solid fill
+- make the wrapper functions global instead of image specific
+
done:
- Make sure the endian-ness macros are defined correctly.
lib_LTLIBRARIES = libpixman.la
-
-libpixman_la_LIBADD = @DEP_LIBS@ -lm
-
+libpixman_la_LIBADD = @DEP_LIBS@ -lm libpixmanwrapper.la
libpixman_la_SOURCES = \
pixman.h \
pixman-region.c \
pixman-trap.c \
pixman-compute-region.c
+libpixmanincludedir = $(includedir)/pixman
+libpixmaninclude_HEADERS = pixman.h
+
+# wrapper library
+noinst_LTLIBRARIES = libpixmanwrapper.la
+libpixmanwrapper_la_SOURCES = \
+ pixman-compose.c
+libpixmanwrapper_la_CFLAGS = $(DEP_CFLAGS) -DPIXMAN_FB_ACCESSORS
+
+
+
+# mmx code
if USE_MMX
-noinst_LTLIBRARIES = libpixman-mmx.la
+noinst_LTLIBRARIES += libpixman-mmx.la
libpixman_mmx_la_SOURCES = \
pixman-mmx.c \
pixman-mmx.h
libpixman_mmx_la_LIBADD = $(DEP_LIBS)
libpixman_la_LIBADD += libpixman-mmx.la
endif
-
-libpixmanincludedir = $(includedir)/pixman
-libpixmaninclude_HEADERS = pixman.h
};
-FbComposeFunctions pixman_composeFunctions = {
- pixman_fbCombineFuncU,
- pixman_fbCombineFuncC,
- pixman_fbCombineMaskU
-};
-
-
static void fbFetchSolid(bits_image_t * pict, int x, int y, int width, uint32_t *buffer, uint32_t *mask, uint32_t maskBits)
{
uint32_t *bits;
fetch((pixman_image_t *)pict, bits, x, width, buffer, indexed);
}
+#ifdef PIXMAN_FB_ACCESSORS
+#define PIXMAN_COMPOSITE_RECT_GENERAL pixman_composite_rect_general_accessors
+#define PIXMAN_COMPOSE_FUNCTIONS pixman_composeFunctions_accessors
+static const FbComposeFunctions pixman_composeFunctions_accessors = {
+ pixman_fbCombineFuncU,
+ pixman_fbCombineFuncC,
+ pixman_fbCombineMaskU
+};
+#else
+#define PIXMAN_COMPOSITE_RECT_GENERAL pixman_composite_rect_general_no_accessors
+#define PIXMAN_COMPOSE_FUNCTIONS pixman_composeFunctions
+FbComposeFunctions pixman_composeFunctions = {
+ pixman_fbCombineFuncU,
+ pixman_fbCombineFuncC,
+ pixman_fbCombineMaskU
+};
+#endif
+
typedef struct
{
uint32_t left_ag;
typedef void (*scanFetchProc)(pixman_image_t *, int, int, int, uint32_t *,
uint32_t *, uint32_t);
+#ifndef PIXMAN_FB_ACCESSORS
+static
+#endif
void
-pixmanCompositeRect (const FbComposeData *data, uint32_t *scanline_buffer)
+PIXMAN_COMPOSITE_RECT_GENERAL (const FbComposeData *data,
+ uint32_t *scanline_buffer)
{
uint32_t *src_buffer = scanline_buffer;
uint32_t *dest_buffer = src_buffer + data->width;
PIXMAN_FORMAT_RGB (data->mask->bits.format))
{
uint32_t *mask_buffer = dest_buffer + data->width;
- CombineFuncC compose = pixman_composeFunctions.combineC[data->op];
+ CombineFuncC compose = PIXMAN_COMPOSE_FUNCTIONS.combineC[data->op];
if (!compose)
return;
else
{
uint32_t *src_mask_buffer = 0, *mask_buffer = 0;
- CombineFuncU compose = pixman_composeFunctions.combineU[data->op];
+ CombineFuncU compose = PIXMAN_COMPOSE_FUNCTIONS.combineU[data->op];
if (!compose)
return;
0xff000000);
if (mask_buffer)
- pixman_composeFunctions.combineMaskU (src_buffer,
- mask_buffer,
- data->width);
+ PIXMAN_COMPOSE_FUNCTIONS.combineMaskU (src_buffer,
+ mask_buffer,
+ data->width);
src_mask_buffer = src_buffer;
}
if (!store)
fbFinishAccess (data->dest->pDrawable);
}
+
+#ifndef PIXMAN_FB_ACCESSORS
+
+void
+pixman_composite_rect_general (const FbComposeData *data,
+ uint32_t *scanline_buffer)
+{
+ if (data->src->common.read_func ||
+ data->src->common.write_func ||
+ (data->mask && data->mask->common.read_func) ||
+ (data->mask && data->mask->common.write_func) ||
+ data->dest->common.read_func ||
+ data->dest->common.write_func)
+ {
+ return pixman_composite_rect_general_accessors (data, scanline_buffer);
+ }
+ else
+ {
+ return pixman_composite_rect_general_no_accessors (data, scanline_buffer);
+ }
+}
+
+#endif
_mm_empty();
}
-/* FIXME: this should be reinstated after adding fbmmx to pixman */
-extern FbComposeFunctions pixman_composeFunctions;
-
void fbComposeSetupMMX(void)
{
/* check if we have MMX support and initialize accordingly */
- if (pixman_have_mmx()) {
+ if (pixman_have_mmx())
+ {
pixman_composeFunctions.combineU[PIXMAN_OP_OVER] = mmxCombineOverU;
pixman_composeFunctions.combineU[PIXMAN_OP_OVER_REVERSE] = mmxCombineOverReverseU;
pixman_composeFunctions.combineU[PIXMAN_OP_IN] = mmxCombineInU;
compose_data.width = width;
compose_data.height = height;
- pixmanCompositeRect (&compose_data, scanline_buffer);
+ pixman_composite_rect_general (&compose_data, scanline_buffer);
if (scanline_buffer != _scanline_buffer)
free (scanline_buffer);
typedef FASTCALL void (*CombineFuncU) (uint32_t *dest, const uint32_t *src, int width);
typedef FASTCALL void (*CombineFuncC) (uint32_t *dest, uint32_t *src, uint32_t *mask, int width);
-typedef struct _FbComposeFunctions {
- CombineFuncU *combineU;
- CombineFuncC *combineC;
- CombineMaskU combineMaskU;
-} FbComposeFunctions;
-
typedef struct _FbComposeData {
uint8_t op;
pixman_image_t *src;
uint16_t height;
} FbComposeData;
+typedef struct _FbComposeFunctions {
+ CombineFuncU *combineU;
+ CombineFuncC *combineC;
+ CombineMaskU combineMaskU;
+} FbComposeFunctions;
+
+extern FbComposeFunctions pixman_composeFunctions;
+
+void pixman_composite_rect_general_accessors (const FbComposeData *data,
+ uint32_t *scanline_buffer);
+void pixman_composite_rect_general_no_acessors (const FbComposeData *data,
+ uint32_t *scanline_buffer);
+void pixman_composite_rect_general (const FbComposeData *data,
+ uint32_t *scanline_buffer);
/* end */
solid_fill_t solid;
};
-void pixmanCompositeRect (const FbComposeData *data,
- uint32_t *scanline_buffer);
-
#define LOG2_BITMAP_PAD 5
#define FB_STIP_SHIFT LOG2_BITMAP_PAD
#define FB_STIP_UNIT (1 << FB_STIP_SHIFT)