[PATCH weston] xwm: Fix opaque region system.

Pekka Paalanen ppaalanen at gmail.com
Sat Nov 24 00:38:27 PST 2012


On Sat, 24 Nov 2012 03:56:25 +1100
Daniel Stone <daniel at fooishbar.org> wrote:

> Hi Pekka,
> 
> 
> On 23 November 2012 18:35, Pekka Paalanen <ppaalanen at gmail.com> wrote:
> 
> > \Weston_surface:opaque is referenced only in the transform_disable()
> > path, because we never bothered to write an algorithm for the
> > transform_enable() path. A pixman region deals with axis-aligned
> > rectangles, and the conversion from an arbitrary rectangle to an
> > approximating set of axis-aligned rectangles is not trivial nor
> > unique. In the transform enabled case, we just imagine that nothing is
> > opaque, and compute repaint regions accordingly. The only downside is
> > that we may repaint more than absolutely necessary. It should not cause
> > misrendering, though.
> >
> 
> It does cause misrendering with XWayland though, as we often have an
> A8R8G8B8 frame window enclosing an X8R8G8B8 content window.  While the
> frame has a proper alpha channel, assuming the content window has a valid
> alpha channel causes serious misrendering.  So in this case, it's not just
> an optimisation, but a necessity.

Yes, setting weston_surface:opaque is a necessity. However, I was
talking about repaint regions, i.e. weston_surface:transform.opaque.

The renderer uses weston_surface:opaque, which is in surface-local
coordinate frame. The repaint clipping uses the derived
weston_surface:transform.opaque region, which is a very different
thing, and in global coordinate frame. Computing the repaint
regions, and sampling the surface texture with or without alpha
channel, are two different algorithms, that use different regions.

If you set weston_surface:opaque right, the renderer will use it,
and ignore the alpha channel on the opaque region. It is
irrelevant, whether weston_surface:transform.opaque gets set or
empty. If it is empty, we just repaint the surfaces below, and then
the current surface on top. As I said, the only downside of not
implementing transform.opaque for the transformed case is, that we
repaint the below surfaces, when we do not strictly need to paint
them. The XWayland window is painted right regardless.

Therefore I claim that any problems are in setting
weston_surface:opaque to begin with, not in the transformation code
ignoring to transform the opaque region. Scott's patch seems to
imply that, too.


Thanks,
pq


More information about the wayland-devel mailing list