[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [E-devel] something strange in xrender evas_engine.c



On Fri, 10 Mar 2006 19:38:11 -0800 "David Sharp" <whereami@gmail.com> babbled:

> On 3/10/06, The Rasterman Carsten Haitzler <raster@rasterman.com> wrote:
> > On Fri, 10 Mar 2006 18:58:33 +0100 (CET) Vincent Torri
> > <Vincent.Torri@iecn.u-nancy.fr> babbled:
> > > hey,
> > >
> > > in evas_engine.c, I can see (line 151 and after)
> > >
> > >
> > >    if (!re->mask)
> > >      re->output = _xr_render_surface_adopt(re->xinf, re->win, e->output.w,
> > > e->output.h, re->destination_alpha);
> > >    else
> > >      re->output = _xr_render_surface_adopt(re->xinf, re->win, e->output.w,
> > > e->output.h, 0);
> > >
> > >    if (re->mask)
> > >      re->mask_output = _xr_render_surface_format_adopt(re->xinf, re->mask,
> > >                                                      e->output.w,
> > > e->output.h,
> > >                                                      re->xinf->fmt1, 1);
> > >    else
> > >      re->mask_output = NULL;
> > >
> > > that is 2 if/else on re->mask. What is the point of doing them ?
> >
> > if re->mask is 0 (no destination mask target is given) BUT
> > re->destination_alpha is 1 then we still want the destination buffer to
> > have an alpha channel - this allows evas to render to argb windows and
> > literally produce alpha channels xcomposite can use with compositing.
> >
> 
> I think Vincent's point was that the two if/else clauses could be
> easily combined:
> 
>   if (!re->mask) {
>     re->output = _xr_render_surface_adopt(re->xinf, re->win,
> e->output.w, e->output.h, re->destination_alpha);
>     re->mask_output = NULL;
>   } else {
>     re->output = _xr_render_surface_adopt(re->xinf, re->win,
> e->output.w, e->output.h, 0);
>     re->mask_output = _xr_render_surface_format_adopt(re->xinf, re->mask,
>                                                       e->output.w,
> e->output.h, re->xinf->fmt1, 1);
>   }
> 
> might save an op or two as well.

aaah - well check in detail. you CAN have destination_alpha be 0. you can have it 0 and mask be 1 which means - we want destination alpha BUT we want to reduce it to a mask later. the logic there handles that pretty compactly.

ie valid combinations and what they do:

mask  dalpha | meaning
-------------+-------------------------------------------------------------------
0     0      | render to solid RGB dest
1     0      | render to ARGB dest but reduce the A channel to a mask
0     1      | render to ARGB dest but let a composite manager deal with the alpha
1     1      | render to ARGB dest but reduce the A channel to a mask

this is how the logic ends up working :)

> d#
> 
> > > Vincent
> > >
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting language
> that extends applications into web and mobile media. Attend the live webcast
> and join the prime developer group breaking into this new coding territory!
> http://sel.as-us.falkag.net/sel?cmd_______________________________________________
> enlightenment-devel mailing list
> enlightenment-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
> 


-- 
------------- Codito, ergo sum - "I code, therefore I am" --------------
The Rasterman (Carsten Haitzler)    raster@rasterman.com
裸好多
Tokyo, Japan (東京 日本)