From: Enlightenment C. <no...@cv...> - 2008-06-03 14:46:10
|
Enlightenment CVS committal Author : cedric Project : e17 Module : libs/evas Dir : e17/libs/evas/src/lib/engines/common_16 Modified Files: evas_soft16_image_scaled_sampled.c evas_soft16_image_unscaled.c evas_soft16_main.c evas_soft16_rectangle.c Log Message: Fix common 16bpp engine use of alpha. =================================================================== RCS file: /cvs/e/e17/libs/evas/src/lib/engines/common_16/evas_soft16_image_scaled_sampled.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- evas_soft16_image_scaled_sampled.c 12 Apr 2008 02:11:07 -0000 1.1 +++ evas_soft16_image_scaled_sampled.c 3 Jun 2008 14:45:38 -0000 1.2 @@ -93,17 +93,17 @@ int dst_offset, int w, int h, int *offset_x, int *offset_y) { - if (src->flags.have_alpha && (!dst->flags.have_alpha)) + if (src->cache_entry.flags.alpha && (!dst->cache_entry.flags.alpha)) _soft16_image_draw_scaled_transp_solid (src, dst, dc, dst_offset, w, h, offset_x, offset_y); - else if ((!src->flags.have_alpha) && (!dst->flags.have_alpha)) + else if ((!src->cache_entry.flags.alpha) && (!dst->cache_entry.flags.alpha)) _soft16_image_draw_scaled_solid_solid (src, dst, dc, dst_offset, w, h, offset_x, offset_y); else fprintf(stderr, - "Unsupported draw of scaled images src->flags.have_alpha=%d, " - "dst->flags.have_alpha=%d, WITHOUT COLOR MUL\n", - src->flags.have_alpha, dst->flags.have_alpha); + "Unsupported draw of scaled images src->cache_entry.flags.alpha=%d, " + "dst->cache_entry.flags.alpha=%d, WITHOUT COLOR MUL\n", + src->cache_entry.flags.alpha, dst->cache_entry.flags.alpha); } static void @@ -205,17 +205,17 @@ int dst_offset, int w, int h, int *offset_x, int *offset_y, DATA8 a) { - if (src->flags.have_alpha && (!dst->flags.have_alpha)) + if (src->cache_entry.flags.alpha && (!dst->cache_entry.flags.alpha)) _soft16_image_draw_scaled_transp_solid_mul_alpha (src, dst, dc, dst_offset, w, h, offset_x, offset_y, a); - else if ((!src->flags.have_alpha) && (!dst->flags.have_alpha)) + else if ((!src->cache_entry.flags.alpha) && (!dst->cache_entry.flags.alpha)) _soft16_image_draw_scaled_solid_solid_mul_alpha (src, dst, dc, dst_offset, w, h, offset_x, offset_y, a); else fprintf(stderr, - "Unsupported draw of scaled images src->flags.have_alpha=%d, " - "dst->flags.have_alpha=%d, WITH ALPHA MUL %d\n", - src->flags.have_alpha, dst->flags.have_alpha, A_VAL(&dc->mul.col)); + "Unsupported draw of scaled images src->cache_entry.flags.alpha=%d, " + "dst->cache_entry.flags.alpha=%d, WITH ALPHA MUL %d\n", + src->cache_entry.flags.alpha, dst->cache_entry.flags.alpha, A_VAL(&dc->mul.col)); } static void @@ -387,17 +387,17 @@ int *offset_x, int *offset_y, DATA8 r, DATA8 g, DATA8 b, DATA8 a) { - if (src->flags.have_alpha && (!dst->flags.have_alpha)) + if (src->cache_entry.flags.alpha && (!dst->cache_entry.flags.alpha)) _soft16_image_draw_scaled_transp_solid_mul_color (src, dst, dc, dst_offset, w, h, offset_x, offset_y, r, g, b, a); - else if ((!src->flags.have_alpha) && (!dst->flags.have_alpha)) + else if ((!src->cache_entry.flags.alpha) && (!dst->cache_entry.flags.alpha)) _soft16_image_draw_scaled_solid_solid_mul_color (src, dst, dc, dst_offset, w, h, offset_x, offset_y, r, g, b, a); else fprintf(stderr, - "Unsupported draw of scaled images src->flags.have_alpha=%d, " - "dst->flags.have_alpha=%d, WITH COLOR MUL 0x%08x\n", - src->flags.have_alpha, dst->flags.have_alpha, dc->mul.col); + "Unsupported draw of scaled images src->cache_entry.flags.alpha=%d, " + "dst->cache_entry.flags.alpha=%d, WITH COLOR MUL 0x%08x\n", + src->cache_entry.flags.alpha, dst->cache_entry.flags.alpha, dc->mul.col); } static inline void =================================================================== RCS file: /cvs/e/e17/libs/evas/src/lib/engines/common_16/evas_soft16_image_unscaled.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- evas_soft16_image_unscaled.c 12 Apr 2008 02:11:07 -0000 1.1 +++ evas_soft16_image_unscaled.c 3 Jun 2008 14:45:38 -0000 1.2 @@ -51,19 +51,19 @@ int src_offset, int dst_offset, int width, int height) { - if (src->flags.have_alpha && (!dst->flags.have_alpha)) + if (src->cache_entry.flags.alpha && (!dst->cache_entry.flags.alpha)) _soft16_image_draw_unscaled_transp_solid(src, dst, dc, src_offset, dst_offset, width, height); - else if ((!src->flags.have_alpha) && (!dst->flags.have_alpha)) + else if ((!src->cache_entry.flags.alpha) && (!dst->cache_entry.flags.alpha)) _soft16_image_draw_unscaled_solid_solid(src, dst, dc, src_offset, dst_offset, width, height); else fprintf(stderr, - "Unsupported draw of unscaled images src->flags.have_alpha=%d, " - "dst->flags.have_alpha=%d, WITHOUT COLOR MUL\n", - src->flags.have_alpha, dst->flags.have_alpha); + "Unsupported draw of unscaled images src->cache_entry.flags.alpha=%d, " + "dst->cache_entry.flags.alpha=%d, WITHOUT COLOR MUL\n", + src->cache_entry.flags.alpha, dst->cache_entry.flags.alpha); } static void @@ -121,17 +121,17 @@ int src_offset, int dst_offset, int width, int height, DATA8 a) { - if (src->flags.have_alpha && (!dst->flags.have_alpha)) + if (src->cache_entry.flags.alpha && (!dst->cache_entry.flags.alpha)) _soft16_image_draw_unscaled_transp_solid_mul_alpha (src, dst, dc, src_offset, dst_offset, width, height, a); - else if ((!src->flags.have_alpha) && (!dst->flags.have_alpha)) + else if ((!src->cache_entry.flags.alpha) && (!dst->cache_entry.flags.alpha)) _soft16_image_draw_unscaled_solid_solid_mul_alpha (src, dst, dc, src_offset, dst_offset, width, height, a); else fprintf(stderr, - "Unsupported draw of unscaled images src->flags.have_alpha=%d, " - "dst->flags.have_alpha=%d, WITH ALPHA MUL %d\n", - src->flags.have_alpha, dst->flags.have_alpha, A_VAL(&dc->mul.col)); + "Unsupported draw of unscaled images src->cache_entry.flags.alpha=%d, " + "dst->cache_entry.flags.alpha=%d, WITH ALPHA MUL %d\n", + src->cache_entry.flags.alpha, dst->cache_entry.flags.alpha, A_VAL(&dc->mul.col)); } static void @@ -212,17 +212,17 @@ int width, int height, DATA8 r, DATA8 g, DATA8 b, DATA8 a) { - if (src->flags.have_alpha && (!dst->flags.have_alpha)) + if (src->cache_entry.flags.alpha && (!dst->cache_entry.flags.alpha)) _soft16_image_draw_unscaled_transp_solid_mul_color (src, dst, dc, src_offset, dst_offset, width, height, r, g, b, a); - else if ((!src->flags.have_alpha) && (!dst->flags.have_alpha)) + else if ((!src->cache_entry.flags.alpha) && (!dst->cache_entry.flags.alpha)) _soft16_image_draw_unscaled_solid_solid_mul_color (src, dst, dc, src_offset, dst_offset, width, height, r, g, b, a); else fprintf(stderr, - "Unsupported draw of unscaled images src->flags.have_alpha=%d, " - "dst->flags.have_alpha=%d, WITH COLOR MUL 0x%08x\n", - src->flags.have_alpha, dst->flags.have_alpha, dc->mul.col); + "Unsupported draw of unscaled images src->cache_entry.flags.alpha=%d, " + "dst->cache_entry.flags.alpha=%d, WITH COLOR MUL 0x%08x\n", + src->cache_entry.flags.alpha, dst->cache_entry.flags.alpha, dc->mul.col); } static inline void =================================================================== RCS file: /cvs/e/e17/libs/evas/src/lib/engines/common_16/evas_soft16_main.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- evas_soft16_main.c 3 Jun 2008 09:09:35 -0000 1.3 +++ evas_soft16_main.c 3 Jun 2008 14:45:38 -0000 1.4 @@ -101,7 +101,7 @@ im->pixels = NULL; im->alpha = NULL; /* When is have_alpha set ? */ - im->flags.have_alpha = 0; +/* im->flags.have_alpha = 0; */ im->flags.free_pixels = 0; im->flags.free_alpha = 0; @@ -122,10 +122,10 @@ if (im->stride < 0) im->stride = _calc_stride(w); - im->pixels = realloc(im->pixels, IMG_BYTE_SIZE(im->stride, h, im->flags.have_alpha)); + im->pixels = realloc(im->pixels, IMG_BYTE_SIZE(im->stride, h, ie->flags.alpha)); if (!im->pixels) return -1; - if (im->flags.have_alpha) + if (ie->flags.alpha) { im->alpha = (DATA8 *)(im->pixels + (im->stride * h)); im->flags.free_alpha = 0; @@ -172,7 +172,7 @@ sim->cache_entry.w = sim->source->cache_entry.w; sim->cache_entry.h = sim->source->cache_entry.h; - sim->flags.have_alpha = im->cache_entry.flags.alpha; + ie->flags.alpha = im->cache_entry.flags.alpha; if (sim->stride < 0) sim->stride = _calc_stride(sim->cache_entry.w); return 0; @@ -209,7 +209,7 @@ Soft16_Image *im = (Soft16_Image *) ie; if (im->pixels && im->flags.free_pixels) - return IMG_BYTE_SIZE(im->stride, im->cache_entry.h, im->flags.have_alpha); + return IMG_BYTE_SIZE(im->stride, im->cache_entry.h, ie->flags.alpha); return 0; } @@ -232,14 +232,14 @@ /* FIXME: handle colorspace */ ie_dst->w = w; ie_dst->h = h; + ie_dst->flags.alpha = alpha; - im->flags.have_alpha = alpha; im->flags.free_pixels = 0; im->flags.free_alpha = 0; /* FIXME: That's bad, the application must be aware of the engine internal. */ im->pixels = (DATA16 *) image_data; - if (im->flags.have_alpha) + if (ie_dst->flags.alpha) im->alpha = (DATA8 *)(im->pixels + (im->stride * h)); return 0; @@ -251,12 +251,10 @@ Soft16_Image *im = (Soft16_Image *) ie_dst; /* FIXME: handle colorspace */ - im->flags.have_alpha = alpha; - evas_cache_image_surface_alloc(ie_dst, w, h); if (image_data) - memcpy(im->pixels, image_data, IMG_BYTE_SIZE(im->stride, h, im->flags.have_alpha)); + memcpy(im->pixels, image_data, IMG_BYTE_SIZE(im->stride, h, ie_dst->flags.alpha)); else - memset(im->pixels, 0, IMG_BYTE_SIZE(im->stride, h, im->flags.have_alpha)); + memset(im->pixels, 0, IMG_BYTE_SIZE(im->stride, h, ie_dst->flags.alpha)); return 0; } @@ -539,11 +537,11 @@ { Soft16_Image *new_im; - if (im->flags.have_alpha == have_alpha) return im; + if (im->cache_entry.flags.alpha == have_alpha) return im; new_im = (Soft16_Image *) evas_cache_image_alone(&im->cache_entry); - new_im->flags.have_alpha = have_alpha; + new_im->cache_entry.flags.alpha = have_alpha; if (im->cache_entry.w > 0 && im->cache_entry.h) =================================================================== RCS file: /cvs/e/e17/libs/evas/src/lib/engines/common_16/evas_soft16_rectangle.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- evas_soft16_rectangle.c 12 Apr 2008 02:11:07 -0000 1.1 +++ evas_soft16_rectangle.c 3 Jun 2008 14:45:38 -0000 1.2 @@ -54,7 +54,7 @@ dst_offset = dr.x + (dr.y * dst->cache_entry.w); - if (!dst->flags.have_alpha) + if (!dst->cache_entry.flags.alpha) { DATA16 rgb565; DATA8 alpha; |