From 7e5f9cf26e872ff39c28a1494c407d42b3d1d14c Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Thu, 9 Mar 2006 03:51:27 +0000 Subject: [PATCH] ARGB targets for sw engine supported SVN revision: 21119 --- .../engines/software_x11/evas_engine.c | 21 +++++++++++++++++ .../engines/software_x11/evas_outbuf.c | 23 ++++++++++++++++++- 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/legacy/evas/src/modules/engines/software_x11/evas_engine.c b/legacy/evas/src/modules/engines/software_x11/evas_engine.c index cd3842ac64..9ac5eabb9b 100644 --- a/legacy/evas/src/modules/engines/software_x11/evas_engine.c +++ b/legacy/evas/src/modules/engines/software_x11/evas_engine.c @@ -216,6 +216,27 @@ eng_setup(Evas *e, void *in) info->info.mask, info->info.shape_dither, info->info.destination_alpha); + else + { + re = e->engine.data.output; + evas_software_x11_outbuf_free(re->ob); + re->ob = evas_software_x11_outbuf_setup_x(e->output.w, + e->output.h, + info->info.rotation, + OUTBUF_DEPTH_INHERIT, + info->info.display, + info->info.drawable, + info->info.visual, + info->info.colormap, + info->info.depth, + evas_software_x11_outbuf_perf_restore_x(info->info.display, info->info.drawable, info->info.visual, info->info.colormap, info->info.depth), + info->info.alloc_grayscale, + info->info.alloc_colors_max, + info->info.mask, + info->info.shape_dither, + info->info.destination_alpha); + evas_software_x11_outbuf_debug_set(re->ob, info->info.debug); + } if (!e->engine.data.output) return; if (!e->engine.data.context) e->engine.data.context = diff --git a/legacy/evas/src/modules/engines/software_x11/evas_outbuf.c b/legacy/evas/src/modules/engines/software_x11/evas_outbuf.c index fcc7062a81..b3d08499f6 100644 --- a/legacy/evas/src/modules/engines/software_x11/evas_outbuf.c +++ b/legacy/evas/src/modules/engines/software_x11/evas_outbuf.c @@ -449,6 +449,27 @@ evas_software_x11_outbuf_push_updated_region(Outbuf * buf, RGBA_Image * update, bpl / ((evas_software_x11_x_output_buffer_depth(obr->xob) / 8)) - obr->w, obr->w, obr->h, x, y, NULL); + /* FIXME: this is evil - but it makes ARGB targets look correct */ + if ((buf->priv.destination_alpha) && (!obr->mxob) && + (evas_software_x11_x_output_buffer_depth(obr->xob) == 32)) + { + int i; + DATA32 a; + + for (i = 0; i < obr->h; i++) + { + s = ((DATA32 *)data) + ((bpl * i) / sizeof(DATA32)); + e = s + obr->w; + while (s < e) + { + a = A_VAL(s) + 1; + R_VAL(s) = (R_VAL(s) * a) >> 8; + G_VAL(s) = (G_VAL(s) * a) >> 8; + B_VAL(s) = (B_VAL(s) * a) >> 8; + s++; + } + } + } } if (obr->mxob) { @@ -461,7 +482,7 @@ evas_software_x11_outbuf_push_updated_region(Outbuf * buf, RGBA_Image * update, void evas_software_x11_outbuf_reconfigure(Outbuf * buf, int w, int h, int rot, - Outbuf_Depth depth) + Outbuf_Depth depth) { if ((w == buf->w) && (h == buf->h) && -- 2.34.1