[PATCH] Support on-the-fly transparency changes in pixman renderer

Manuel Bachmann manuel.bachmann at open.eurogiciel.org
Mon Apr 7 03:06:50 PDT 2014


Hi Kristian,

Thanks a lot for your review !
You're totally right, I was leaking the mask (shame on me :-( ) and wasn't
totally consistent on the code style part.
I just submitted another patch, which should address most of our concerns :

http://lists.freedesktop.org/archives/wayland-devel/2014-April/014080.html

This fixes :
- the leak ;
- code style (added brackets, put definitions on top) ;

Additionally, this fixes the case of clients using an opaque surface
(weston-terminal e.g.) ; the surface was still computed when using
transparency, which would make them render an ugly black rectangle. The
patch now totally disables the opaque surface in this case.

For the window fade out animation, you're right, it doesn't happen ; I
think I saw the shell fade out and considered it should work everywhere.
Will address that.

Regards,
Manuel


2014-04-07 7:59 GMT+02:00 Kristian Høgsberg <hoegsberg at gmail.com>:

> On Sat, Apr 05, 2014 at 05:31:37AM +0200, Manuel Bachmann wrote:
> > When the alpha channel of a surface is changed and the surface
> > refreshed, pixman renderer will now apply a mask corresponding
> > to the alpha channel value.
> >
> > This allows visual effects like shell fade in, shell fade out,
> > window switching, to work when using pixman renderer.
> >
> > Signed-off-by: Manuel Bachmann <manuel.bachmann at open.eurogiciel.org>
> > ---
> >  src/pixman-renderer.c |    9 ++++++++-
> >  1 file changed, 8 insertions(+), 1 deletion(-)
> >
> > diff --git a/src/pixman-renderer.c b/src/pixman-renderer.c
> > index b999343..eff7201 100644
> > --- a/src/pixman-renderer.c
> > +++ b/src/pixman-renderer.c
> > @@ -340,9 +340,16 @@ repaint_region(struct weston_view *ev, struct
> weston_output *output,
> >       if (ps->buffer_ref.buffer)
> >
> wl_shm_buffer_begin_access(ps->buffer_ref.buffer->shm_buffer);
> >
> > +     pixman_image_t *mask_image;
> > +     if (ev->alpha < 1.0) {
> > +             pixman_color_t mask = { 0x0000, 0x0000, 0x0000,
> 0xffff*ev->alpha };
> > +             mask_image = pixman_image_create_solid_fill(&mask);
> > +     } else
> > +             mask_image = NULL;
>
> I like this but it doesn't quite look right, it looks like the surface
> also fades
> from black.  I also doesn't see it trigger on the close window fade
> anmation.
> And stylistically, please don't mix code and declarations (move mask_image
> declartion up) and use braces for both branches (the rule is both or none).
>
> >       pixman_image_composite32(pixman_op,
> >                                ps->image, /* src */
> > -                              NULL /* mask */,
> > +                              mask_image, /* mask */
> >                                po->shadow_image, /* dest */
> >                                0, 0, /* src_x, src_y */
> >                                0, 0, /* mask_x, mask_y */
>
> We're leaking mask_image.
>
> Kristian
>
> > --
> > 1.7.10.4
> >
> > _______________________________________________
> > wayland-devel mailing list
> > wayland-devel at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/wayland-devel
>



-- 
Regards,



*Manuel BACHMANN Tizen Project VANNES-FR*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20140407/74467b73/attachment-0001.html>


More information about the wayland-devel mailing list