[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwin
Subject:    Re: Blur effect
From:       Rivo Laks <rivolaks () hot ! ee>
Date:       2007-04-29 21:04:45
Message-ID: 200704300004.45307.rivolaks () hot ! ee
[Download RAW message or body]

Ühel kenal päeval (pühapäev 29 aprill 2007) kirjutas Lubos Lunak:
> On so 28. dubna 2007, Rivo Laks wrote:
> > Finally, there is a strange rendering bug when multiple translucent
> > windows are active (there's weird 1-pixel border around some widgets
> > when/after they're highlighted). Screenshot:
> > http://freehackers.org/~rivo/kwin/kwin-blur-bug.jpg Maybe someone can
> > guess what's causing this...
>
>  That looks like it paints outside of the actual window area (when a window
> moves only its old geometry is marked to be repainted, if something remains
> then it's probably outside). It may be some rounding error somewhere, or
> possibly the rect adjusting in BlurEffect::updateBlurTexture(), I don't
> understand that code much.

The rect adjusting was actually meant to prevent this very thing :-S
Problem is that if we e.g. have white window on a black one, then the blurred 
texture will be grey a few pixels outside the white window's area. And if 
then the white one is deleted, then a bit larger part of the blurred texture 
has to be update because otherwise those border pixels (just outside the 
white window) would remain grey.

What I missed is that the translucent window using the blurred texture has to 
be updated at those border regions as well. Otherwise it would still show the 
obsolete parts of the blurred texture. And this is exactly what seems to be 
causing this problem.

To fix it, I first tried a hackish approach of just repainting a bigger 
region. This line in prePaintScreen() should have taken care of this:
    *region = QRegion(region->boundingRect().adjusted(-10, -10, 10, 10));
It should ensure that the region we're repainting is at least 10 pixels wider 
on every side. But it still doesn't fix the problem :-(
The only result of this is that the weird paint error is now about 10 pixels 
away from the closed window/widget that caused the repaint.
And another interesting observation is that the paint errors seem to be only 
below and to the left of what's causing them. I haven't seen them above or to 
the right...

Anyway, maybe I'm just too tired right now and will get fresh ideas after some 
sleep. If you come up with any possible problems, let me know.

Rivo
_______________________________________________
Kwin mailing list
Kwin@kde.org
https://mail.kde.org/mailman/listinfo/kwin

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic