[PATCH weston] compositor: add a masking mechanism to weston_layer
Pekka Paalanen
ppaalanen at gmail.com
Tue Dec 10 05:28:11 PST 2013
On Tue, 10 Dec 2013 14:13:50 +0100
Giulio Camuffo <giuliocamuffo at gmail.com> wrote:
> 2013/12/10 Pekka Paalanen <ppaalanen at gmail.com>:
> > On Tue, 10 Dec 2013 11:13:42 +0100
> > Giulio Camuffo <giuliocamuffo at gmail.com> wrote:
> >
> >> 2013/12/10 Jason Ekstrand <jason at jlekstrand.net>:
> >> > Giulio,
> >> > Couple thoughts. First, you don't provide an implementation of
> >> > the clipping in any of the renderers. Probably have to wait on
> >> > the Collabora people for the RPi renderer, but we should have
> >> > pixman and gl implementations of this.
> >>
> >> There is no need to add support in the renderers for that. The
> >> masking is done in view_accumulate_damage(): the part of the view's
> >> boundingbox that doesn't fit in the mask is added to the view's
> >> clip, and the renderers then clip that away already.
> >
> > Does this work if the renderer paints the whole surface regardless
> > of damage? Rpi-renderer does that, since every surface is on its own
> > overlay.
> >
> > The whole damage tracking is kind of unused on the rpi-renderer,
> > since the firmware will probably redraw everything anyway.
> > Prohibiting damage will not prevent parts of a surface from being
> > painted. Damage is just a hint saying what is not necessary to
> > repaint.
>
> No, the masking isn't done by not damaging the parts not in the mask,
> but by adding the opposite of the mask in weston_view::clip. But i see
> that the rpi renderer doesn't clip away that, so no, currently this
> wouldn't work with it. I guess it could work though, right?
We do not have arbitrary clip rectangles. We can only pick one
arbitrary but axis-aligned rectangle from within the buffer to map onto
the screen and that's it, just like your average overlay hardware.
We could do more complex clips by using one dispmanx element (overlay)
per rectangle of the final paint region, but that gets complicated, and
even though there can be many elements, they are still a limited
resource. I do not think this would be feasible.
So if the surface can still be just a single rect on screen, overlaid
with other surfaces in the z-order, then it would be possible. But I
guess you'd have to separate occlusion clips from mask clips. Note
though, that a rect minus a rect is not in general a rect but a region.
Thanks,
pq
More information about the wayland-devel
mailing list