extern int bcm_accel_init(void);
extern void bcm_accel_close(void);
extern void bcm_accel_blit(
- int src_addr, int src_width, int src_height, int src_stride,
+ int src_addr, int src_width, int src_height, int src_stride, int src_format,
int dst_addr, int dst_width, int dst_height, int dst_stride,
int src_x, int src_y, int width, int height,
- int dst_x, int dst_y, int dwidth, int dheight);
+ int dst_x, int dst_y, int dwidth, int dheight,
+ int pal_addr, int flags);
extern void bcm_accel_fill(
int dst_addr, int dst_width, int dst_height, int dst_stride,
int x, int y, int width, int height,
#ifdef BCM_ACCEL
if (!m_bcm_accel_state)
{
+ if (flags & (gPixmap::blitAlphaTest|gPixmap::blitAlphaBlend)) /* unsupported flags */
+ return -1;
+ unsigned long pal_addr = 0;
+ int src_format = 0;
+ if (src->bpp == 32)
+ src_format = 0;
+ else if ((src->bpp == 8) && src->clut.data)
+ {
+ src_format = 1;
+ /* sync pal */
+ int i;
+ pal_addr = src->stride * src->y;
+ unsigned long *pal = (unsigned long*)(((unsigned char*)src->data) + pal_addr);
+ pal_addr += src->data_phys;
+ for (i = 0; i < 256; ++i)
+ *pal++ = src->clut.data[i].argb() ^ 0xFF000000;
+ } else
+ return -1; /* unsupported source format */
+
bcm_accel_blit(
- src->data_phys, src->x, src->y, src->stride,
+ src->data_phys, src->x, src->y, src->stride, src_format,
dst->data_phys, dst->x, dst->y, dst->stride,
area.left(), area.top(), area.width(), area.height(),
- p.x(), p.y(), p.width(), p.height());
+ p.x(), p.y(), p.width(), p.height(),
+ pal_addr, flags);
return 0;
}
#endif