Wayland blur/other effect reigons?

Bill Spitzak spitzak at gmail.com
Thu Jun 9 11:29:22 PDT 2011


I believe the question is about the Windows-style blurring of lower
windows by the overlaid one. For the client to draw this correctly it
would need to retrieve an image of all the windows and desktop below
it's window.

I think the compositor will have to do this.

I am not sure how the client will be able to control it.

Fully black transparent areas of the client window must not blur the
background, since otherwise non-square windows would not work. So the
compositor cannot simply blur a rectangle and stick the window over it.

The simplest method is for the compositor to do an erode filter on the
alpha of the client window (to move the blur in from the antialiased
edges) and use the non-zero values of this to composite a blurry version
of the background over itself before compositing the window.

Another method is to have "additive" parts of the client window (where
any of the rgb is greater than the alpha) indicate the blur region. This
gives the client a control of exactly where the blur is but means a
non-blurring compositor would draw the transparent areas very bright if
it did a simple "over" (it can instead max the alpha with rgb to fix it).

A more complex scheme is for the client to make another window below
their main one, marked as being the "blur effect". The color and alpha
of this window would control the blur somehow. This allows unlimited
effects by adding more windows marked with other effects. There would
have to be some agreement on how these windows are marked with the
effect, so that compositors that don't do the effects can at least
ignore them.

Andreas Ericsson wrote:
> On 06/03/2011 04:39 AM, nerdopolis wrote:
>> Hi.
>>
>> I was wondering, how are you planning to allow Wayland applications put blur
>> on the screen?
>>
>> Will it be specified by the app as a reigion for the compistor to handle, or
>> will the effect be handled by the clients? (someone suggested that the effects
>> could be client side)
>>
>> There might also be other effects that an app might want, like invert,
>> magnify, or reflect...
>>
>> If its done by the clients, that would mean they will have to be constantly
>> grabbing the piximaps or whatever, right?
>>
> 
> Everything drawing-related will be handled by the clients, which
> then write the completed application image to a buffer which is
> drawn as-is to the screen. There's no grabbing of pixmaps because
> the client already has them.
> 
> Naturally, this should be handled pretty much seamlessly by the
> toolkit used (gtk+, qt or whatever).
> 


More information about the wayland-devel mailing list