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

List:       kwin
Subject:    Re: patch: xrender shadows
From:       Thomas =?utf-8?q?L=C3=BCbking?= <thomas.luebking () web ! de>
Date:       2008-05-23 15:20:02
Message-ID: 200805231720.03116.thomas.luebking () web ! de
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Am Friday 23 May 2008 schrieb Lubos Lunak:
> > d) will need really custom (and sometimes even fullsize) shadow masks
>
>  This brings up the question how are doing to recognize them. XEyes is not
> going to tell you, and even if all apps did, I bet half of them would give
> broken info on this anyway.
i wrote some code to detect from the shape() QRegion whether a shadow can be
- rectangular (bit fuzzy, i.e. rounded decos /can/)
- orthogonal (like BII)
- or not

i'll try to finish it this WE and post another patch4 (at least for render, 
will try to extend it to GL)
(but somewhat efficient shadowing of "or not" may take some time, i.e. for 
xeyes you could break it down to 5 parts - top, left, right, center - and 
avoid blurring and caching on the center part...)

>  Not necessary. Compositing in KDE4 is in-process, you can simply get the
> shape from the decoration. Currently decorations call
> KDecoration::setMask() to set their shape and that can be retrieved using
> Client::mask(), so if necessary, it can be made available to effects too.

i allready use the effect window shape mask (that's used for clipping as well)

what i wanted was some tag to bypass the structure detection for most windows 
(though i cache the structure, it needs an update on ever reshape, so every 
resize and resizing isn't the smoothest thing on X anyway... ;-)

the problem here is as mentioned that we cannot rely on decorated windows 
being (allmost) rectangular

btw. is there some kwin signal for reshape events (could grep the headers, but 
i'm asking first - work then ;P


>  EffectWindow::shape()
*ggg* found that...

>  I don't like this. There are window type flag to recognize window types
> and I really don't think windows should take part in compositing itself.
> How are they going to know how exactly to draw the shadow, for example?
humm. seems as e.g. (some) krunner desktopthemes actually *do* paint their own 
shadows, so do some splashs (celestia)
so maybe we should at least have some UI guide here that shouts "DO NOT PAINT 
SHADOWS YOURSELF - NEVER!" - or so...

>  What exactly does expensive mean here? One 8bpp pixmap of the size of the
> window, roughly? Also, extensively shaped windows are rare, and I hope the
> reasonable ones stay that way.
... less in terms of RAM, more in terms of GPU =)

Thomas



[Attachment #5 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" \
"http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" \
content="1" /><style type="text/css"> p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'Fontin'; font-size:10pt; font-weight:400; \
font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Am Friday \
23 May 2008 schrieb Lubos Lunak:</p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;">&gt; &gt; d) will need really custom (and sometimes even fullsize) \
shadow masks</p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt;</p> <p \
style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt;  This brings up the \
question how are doing to recognize them. XEyes is not</p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">&gt; going to tell you, and even if all apps did, \
I bet half of them would give</p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;">&gt; broken info on this anyway.</p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">i wrote some code to detect from the shape() \
QRegion whether a shadow can be</p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;">- rectangular (bit fuzzy, i.e. rounded decos /can/)</p> <p style=" \
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">- orthogonal (like BII)</p> \
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">- or not</p> <p \
style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"></p> <p \
style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">i'll try to finish it this WE \
and post another patch4 (at least for render, will try to extend it to GL)</p> <p \
style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">(but somewhat efficient \
shadowing of "or not" may take some time, i.e. for xeyes you could break it down to 5 \
parts - top, left, right, center - and avoid blurring and caching on the center \
part...)</p> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;"></p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;">&gt;  Not necessary. Compositing in KDE4 is in-process, you can \
simply get the</p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; shape \
from the decoration. Currently decorations call</p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">&gt; KDecoration::setMask() to set their shape \
and that can be retrieved using</p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;">&gt; Client::mask(), so if necessary, it can be made available to \
effects too.</p> <p style="-qt-paragraph-type:empty; margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;"></p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">i allready use the effect window shape mask \
(that's used for clipping as well)</p> <p style="-qt-paragraph-type:empty; \
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;"></p> <p style=" \
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">what i wanted was some tag to \
bypass the structure detection for most windows (though i cache the structure, it \
needs an update on ever reshape, so every resize and resizing isn't the smoothest \
thing on X anyway... ;-)</p> <p style="-qt-paragraph-type:empty; margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;"></p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">the problem here is as mentioned that we cannot \
rely on decorated windows being (allmost) rectangular</p> <p \
style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"></p> <p \
style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">btw. is there some kwin \
signal for reshape events (could grep the headers, but i'm asking first - work then \
;P</p> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;"></p> <p style="-qt-paragraph-type:empty; margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;"></p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">&gt;  EffectWindow::shape()</p> <p style=" \
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">*ggg* found that...</p> <p \
style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"></p> <p \
style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt;  I don't like this. \
There are window type flag to recognize window types</p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">&gt; and I really don't think windows should take \
part in compositing itself.</p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;">&gt; How are they going to know how exactly to draw the shadow, \
for example?</p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">humm. seems \
as e.g. (some) krunner desktopthemes actually *do* paint their own shadows, so do \
some splashs (celestia)</p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;">so maybe we should at least have some UI guide here that shouts \
"DO NOT PAINT SHADOWS YOURSELF - NEVER!" - or so...</p> <p \
style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"></p> <p \
style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt;  What exactly does \
expensive mean here? One 8bpp pixmap of the size of the</p> <p style=" \
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; window, roughly? Also, \
extensively shaped windows are rare, and I hope the</p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">&gt; reasonable ones stay that way.</p> <p \
style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">... less in terms of RAM, \
more in terms of GPU =)</p> <p style="-qt-paragraph-type:empty; margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;"></p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">Thomas</p> <p style="-qt-paragraph-type:empty; \
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;"></p> <p \
style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;"></p></body></html>



_______________________________________________
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