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

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



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.

d#

> > Vincent
> >