#define div_255(x) (((x) + 0x80 + (((x) + 0x80) >> 8)) >> 8)
-typedef struct _FbComposeData {
- uint8_t op;
- image_t *src;
- image_t *mask;
- image_t *dest;
- int16_t xSrc;
- int16_t ySrc;
- int16_t xMask;
- int16_t yMask;
- int16_t xDest;
- int16_t yDest;
- uint16_t width;
- uint16_t height;
-} FbComposeData;
-
/* End of stuff added to get it to compile
*/
}
-#define SCANLINE_BUFFER_LENGTH 1024
-
+#define SCANLINE_BUFFER_LENGTH 2048
+
void
-pixman_composite (pixman_image_t *src_img,
- pixman_image_t *mask_img,
- pixman_image_t *dest_img,
- int src_x,
- int src_y,
- int mask_x,
- int mask_y,
- int dest_x,
- int dset_y,
- int width,
- int height)
+pixman_image_composite (pixman_op_t op,
+ pixman_image_t *src_img,
+ pixman_image_t *mask_img,
+ pixman_image_t *dest_img,
+ int src_x,
+ int src_y,
+ int mask_x,
+ int mask_y,
+ int dest_x,
+ int dest_y,
+ int width,
+ int height)
{
- image_t *src = (image_t *) src;
- image_t *mask = (image_t *) mask;
- image_t *dest = (image_t *) dest;
-
+ FbComposeData compose_data;
uint32_t _scanline_buffer[SCANLINE_BUFFER_LENGTH * 3];
uint32_t *scanline_buffer = _scanline_buffer;
if (width > SCANLINE_BUFFER_LENGTH)
+ {
scanline_buffer = (uint32_t *)malloc (width * 3 * sizeof (uint32_t));
- if (!scanline_buffer)
- return;
-
-
+ if (!scanline_buffer)
+ return;
+ }
+ compose_data.op = op;
+ compose_data.src = (image_t *)src_img;
+ compose_data.mask = (image_t *)mask_img;
+ compose_data.dest = (image_t *)dest_img;
+ compose_data.xSrc = src_x;
+ compose_data.ySrc = src_y;
+ compose_data.xMask = mask_x;
+ compose_data.yMask = mask_y;
+ compose_data.xDest = dest_x;
+ compose_data.yDest = dest_y;
+ compose_data.width = width;
+ compose_data.height = height;
+
+ fbCompositeRect (&compose_data, scanline_buffer);
+
if (scanline_buffer != _scanline_buffer)
free (scanline_buffer);
}
#define TRUE 1
#endif
+typedef union image image_t;
+typedef struct image_common image_common_t;
+typedef struct source_image source_image_t;
+typedef struct solid_fill solid_fill_t;
+typedef struct gradient gradient_t;
+typedef struct linear_gradient linear_gradient_t;
+typedef struct horizontal_gradient horizontal_gradient_t;
+typedef struct vertical_gradient vertical_gradient_t;
+typedef struct conical_gradient conical_gradient_t;
+typedef struct radial_gradient radial_gradient_t;
+typedef struct bits_image bits_image_t;
+typedef struct gradient_stop gradient_stop_t;
+typedef struct circle circle_t;
+typedef struct point point_t;
+
/* FIXME - the types and structures below should be give proper names
*/
CombineMaskU combineMaskU;
} FbComposeFunctions;
+typedef struct _FbComposeData {
+ uint8_t op;
+ image_t *src;
+ image_t *mask;
+ image_t *dest;
+ int16_t xSrc;
+ int16_t ySrc;
+ int16_t xMask;
+ int16_t yMask;
+ int16_t xDest;
+ int16_t yDest;
+ uint16_t width;
+ uint16_t height;
+} FbComposeData;
#define fbGetDrawable
/* end */
-
-typedef union image image_t;
-typedef struct image_common image_common_t;
-typedef struct source_image source_image_t;
-typedef struct solid_fill solid_fill_t;
-typedef struct gradient gradient_t;
-typedef struct linear_gradient linear_gradient_t;
-typedef struct horizontal_gradient horizontal_gradient_t;
-typedef struct vertical_gradient vertical_gradient_t;
-typedef struct conical_gradient conical_gradient_t;
-typedef struct radial_gradient radial_gradient_t;
-typedef struct bits_image bits_image_t;
-typedef struct gradient_stop gradient_stop_t;
-typedef struct circle circle_t;
-typedef struct point point_t;
-
typedef enum
{
BITS,
solid_fill_t solid;
};
+void fbCompositeRect (const FbComposeData *data, uint32_t *scanline_buffer);