[PATCH weston] xwm: Fix opaque region system.

Kristian Høgsberg hoegsberg at gmail.com
Fri Nov 23 20:09:42 PST 2012


On Sat, Nov 24, 2012 at 03:56:25AM +1100, Daniel Stone 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.

There's a subtle distinction here: the opaque region you set throught
the protocol request is only an optimization hint.  The client is
still require to provide a valid alpha channel (ie alpha 1.0) for
opaque regions.  This behavior is actually documented in the XML [1].

Inside weston, however, the opaque region is however rendered without
blending, ie, we ignore the alpha channel and assume opaque.  So for
the X case, where we want that behavior we can rely on that, but it's
not something we want to require of a compositor.

So, for out-of-process xwm, we actually need a new request (part of
the xserver interface) to specify this opaque-override region.  Inside
weston, this will set the same region as wl_surface.set_opaque_region,
but that's an implementation detail.  As for the interaction with
wl_surface.set_opaque_region (I think Pekka brought that up), the
assumption is that the xserver will never set the opaque region, so
there won't be any fighting over what it should be.

Kristian


[1] Now that we have documentation, I won't hesitate to very smugly
    refer to it.

> Cheers,
> Daniel

> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel



More information about the wayland-devel mailing list