support all advertised formats

SVN revision: 21713
This commit is contained in:
Carsten Haitzler 2006-04-02 07:47:31 +00:00
parent 9f41b13cb3
commit d6690d7514
3 changed files with 56 additions and 12 deletions

View File

@ -80,7 +80,7 @@ _output_setup(int w,
else if (depth_type == EVAS_ENGINE_BUFFER_DEPTH_RGB32)
dep = OUTBUF_DEPTH_RGB_32BPP_888_8888;
else if (depth_type == EVAS_ENGINE_BUFFER_DEPTH_BGRA32)
dep = OUTBUF_DEPTH_BGR_32BPP_888_8888;
dep = OUTBUF_DEPTH_BGRA_32BPP_8888_8888;
else if (depth_type == EVAS_ENGINE_BUFFER_DEPTH_RGB24)
dep = OUTBUF_DEPTH_RGB_24BPP_888_888;
else if (depth_type == EVAS_ENGINE_BUFFER_DEPTH_BGR24)
@ -345,4 +345,4 @@ Evas_Module_Api evas_modapi =
EVAS_MODULE_TYPE_ENGINE,
"buffer",
"none"
};
};

View File

@ -9,6 +9,7 @@ enum _Outbuf_Depth
{
OUTBUF_DEPTH_NONE,
OUTBUF_DEPTH_ARGB_32BPP_8888_8888,
OUTBUF_DEPTH_BGRA_32BPP_8888_8888,
OUTBUF_DEPTH_RGB_32BPP_888_8888,
OUTBUF_DEPTH_BGR_32BPP_888_8888,
OUTBUF_DEPTH_RGB_24BPP_888_888,

View File

@ -107,7 +107,9 @@ evas_buffer_outbuf_buf_new_region_for_update(Outbuf *buf, int x, int y, int w, i
im = evas_common_image_create(w, h);
if (im)
{
if ((buf->depth == OUTBUF_DEPTH_ARGB_32BPP_8888_8888))
printf("bleh\n");
if (((buf->depth == OUTBUF_DEPTH_ARGB_32BPP_8888_8888)) ||
((buf->depth == OUTBUF_DEPTH_BGRA_32BPP_8888_8888)))
{
im->flags |= RGBA_IMAGE_HAS_ALPHA;
memset(im->image->data, 0, w * h * sizeof(DATA32));
@ -264,23 +266,64 @@ evas_buffer_outbuf_buf_push_updated_region(Outbuf *buf, RGBA_Image *update, int
break;
case OUTBUF_DEPTH_BGR_32BPP_888_8888:
{
DATA32 *src;
DATA32 *src, *dst;
DATA8 *dest;
int yy, row_bytes;
Gfx_Func_Blend_Src_Dst func;
int xx, yy, row_bytes;
row_bytes = buf->dest_row_bytes;
dest = (DATA8 *)(buf->dest) + (y * row_bytes) + (x * 4);
func = evas_common_draw_func_copy_get(w, 0);
if (func)
if (buf->func.new_update_region)
{
for (yy = 0; yy < h; yy++)
dest = buf->func.new_update_region(x, y, w, h, &row_bytes);
}
for (yy = 0; yy < h; yy++)
{
dst = dest + (yy * row_bytes);
src = update->image->data + (yy * update->image->w);
for (xx = 0; xx < w; xx++)
{
src = update->image->data + (yy * update->image->w);
func(src, dest, w);
dest += row_bytes;
A_VAL(dst) = B_VAL(src);
R_VAL(dst) = G_VAL(src);
G_VAL(dst) = R_VAL(src);
dst++;
src++;
}
}
if (buf->func.free_update_region)
{
buf->func.free_update_region(x, y, w, h, dest);
}
}
break;
case OUTBUF_DEPTH_BGRA_32BPP_8888_8888:
{
DATA32 *src, *dst;
DATA8 *dest;
int xx, yy, row_bytes;
row_bytes = buf->dest_row_bytes;
dest = (DATA8 *)(buf->dest) + (y * row_bytes) + (x * 4);
if (buf->func.new_update_region)
{
dest = buf->func.new_update_region(x, y, w, h, &row_bytes);
}
for (yy = 0; yy < h; yy++)
{
dst = dest + (yy * row_bytes);
src = update->image->data + (yy * update->image->w);
for (xx = 0; xx < w; xx++)
{
A_VAL(dst) = B_VAL(src);
R_VAL(dst) = G_VAL(src);
G_VAL(dst) = R_VAL(src);
dst++;
src++;
}
}
if (buf->func.free_update_region)
{
buf->func.free_update_region(x, y, w, h, dest);
}
}
break;
default: