void evas_outbuf_push_updated_region(Outbuf *ob, RGBA_Image *update, int x __UNUSED__, int y, int w, int h) { if (!ob->priv.dest) return; if (!ob->priv.buffer) { Gfx_Func_Copy func; func = evas_common_draw_func_copy_get(w, 0); if (func) { DATA32 *dst, *src; int yy = 0, bytes = 0; bytes = ((w * sizeof(int)) * h); for (yy = 0; yy < h; yy++) { src = update->image.data + (yy * update->cache_entry.w); dst = (DATA32 *)((DATA8 *)(ob->priv.dest) + ((y + yy) * bytes)); func(src, dst, w); } } } }
#include "evas_convert_rgb_32.h" #ifdef BUILD_CONVERT_32_RGB_8888 #ifdef BUILD_CONVERT_32_RGB_ROT0 void evas_common_convert_rgba_to_32bpp_rgb_8888 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x __UNUSED__, int dith_y __UNUSED__, DATA8 *pal __UNUSED__) { DATA32 *src_ptr; DATA32 *dst_ptr; int y; Gfx_Func_Copy func; dst_ptr = (DATA32 *)dst; src_ptr = src; func = evas_common_draw_func_copy_get(w, 0); for (y = 0; y < h; y++) { func(src_ptr, dst_ptr, w); src_ptr += w + src_jump; dst_ptr += w + dst_jump; } return; } #endif #endif #ifdef BUILD_CONVERT_32_RGB_8888 #ifdef BUILD_CONVERT_32_RGB_ROT180 void
void evas_buffer_outbuf_buf_push_updated_region(Outbuf *buf, RGBA_Image *update, int x, int y, int w, int h) { /* copy update image to out buf & convert */ switch (buf->depth) { case OUTBUF_DEPTH_RGB_24BPP_888_888: /* copy & pack into 24bpp - if colorkey is enabled... etc. */ { DATA8 thresh; int xx, yy; int row_bytes; DATA8 *dest; DATA32 colorkey; DATA32 *src; DATA8 *dst; colorkey = buf->color_key; thresh = buf->alpha_level; row_bytes = buf->dest_row_bytes; dest = (DATA8 *)(buf->dest) + (y * row_bytes) + (x * 3); if (buf->func.new_update_region) { dest = buf->func.new_update_region(x, y, w, h, &row_bytes); } if (!dest) break; if (buf->use_color_key) { for (yy = 0; yy < h; yy++) { dst = dest + (yy * row_bytes); src = update->image.data + (yy * update->cache_entry.w); for (xx = 0; xx < w; xx++) { if (A_VAL(src) > thresh) { *dst++ = R_VAL(src); *dst++ = G_VAL(src); *dst++ = B_VAL(src); } else { *dst++ = R_VAL(&colorkey); *dst++ = G_VAL(&colorkey); *dst++ = B_VAL(&colorkey); } src++; } } } else { for (yy = 0; yy < h; yy++) { dst = dest + (yy * row_bytes); src = update->image.data + (yy * update->cache_entry.w); for (xx = 0; xx < w; xx++) { *dst++ = R_VAL(src); *dst++ = G_VAL(src); *dst++ = B_VAL(src); src++; } } } if (buf->func.free_update_region) { buf->func.free_update_region(x, y, w, h, dest); } } break; case OUTBUF_DEPTH_BGR_24BPP_888_888: /* copy & pack into 24bpp - if colorkey is enabled... etc. */ { DATA8 thresh; int xx, yy; int row_bytes; DATA8 *dest; DATA32 colorkey; DATA32 *src; DATA8 *dst; colorkey = buf->color_key; thresh = buf->alpha_level; row_bytes = buf->dest_row_bytes; dest = (DATA8 *)(buf->dest) + (y * row_bytes) + (x * 3); if (buf->func.new_update_region) { dest = buf->func.new_update_region(x, y, w, h, &row_bytes); } if (!dest) break; if (buf->use_color_key) { for (yy = 0; yy < h; yy++) { dst = dest + (yy * row_bytes); src = update->image.data + (yy * update->cache_entry.w); for (xx = 0; xx < w; xx++) { if (A_VAL(src) > thresh) { *dst++ = B_VAL(src); *dst++ = G_VAL(src); *dst++ = R_VAL(src); } else { *dst++ = B_VAL(&colorkey); *dst++ = G_VAL(&colorkey); *dst++ = R_VAL(&colorkey); } src++; } } } else { for (yy = 0; yy < h; yy++) { dst = dest + (yy * row_bytes); src = update->image.data + (yy * update->cache_entry.w); for (xx = 0; xx < w; xx++) { *dst++ = B_VAL(src); *dst++ = G_VAL(src); *dst++ = R_VAL(src); src++; } } } if (buf->func.free_update_region) { buf->func.free_update_region(x, y, w, h, dest); } } break; case OUTBUF_DEPTH_RGB_32BPP_888_8888: case OUTBUF_DEPTH_ARGB_32BPP_8888_8888: { DATA32 *dest, *src, *dst; int yy, row_bytes; row_bytes = buf->dest_row_bytes; dest = (DATA32 *)((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); } /* no need src == dest */ if (!buf->priv.back_buf) { Gfx_Func_Copy func; func = evas_common_draw_func_copy_get(w, 0); if (func) { for (yy = 0; yy < h; yy++) { src = update->image.data + (yy * update->cache_entry.w); dst = (DATA32 *)((DATA8 *)(buf->dest) + ((y + yy) * row_bytes)); func(src, dst, w); } } } if (buf->func.free_update_region) { buf->func.free_update_region(x, y, w, h, dest); } } break; case OUTBUF_DEPTH_BGR_32BPP_888_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 = (DATA32 *)(dest + (yy * row_bytes)); src = update->image.data + (yy * update->cache_entry.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; 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 = (DATA32 *)(dest + (yy * row_bytes)); src = update->image.data + (yy * update->cache_entry.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: break; } }