Mirco Müller
2006-Apr-02 03:15 UTC
[compiz] Greetings, first remarks about trying to do customizable drop-shadows
Hello there everybody! Terrific... a mailing-list for compiz with David on board! Ok, I started off with writing some functions using cairo to draw me the needed elements for drop-shadows (atm stand-alone to focus on the proper generation of the shadow-parts) and currently still fiddle with the tweakable parameters. Right now I have... shadow-radius (e.g. 20 pixels) 2D-offset vector (e.g. 10 pixels right, 15 pixels downwards) start-color as rgba (e.g. 0.2/0.2/0.2/1.0) end-color as rgba (e.g. 0.2/0.2/0.2/0.0) and try to figure out how I best approach the splitting up of the 5 to 8 shadow-elements (top-left, top, top-right, left, right, bottom-left, bottom, bottom-right) depeding on the length of the offset-vector being =, < or > to the radius. I am also not sure how to attack the problem of rounded corners of the windows decoration-frame. If the shadow-textures will align with the outter edges of the decoration-frame there will be "unshadowed" gaps at the rounded corners. If I have the shadow-textures overlap a bit inwards it might look funny if the windows opacity changes to transparent. Right now the only solution for this is to fill the inner part of the drop-shadow with a rectangle having the start-color. But this solution causes heavy overdraw. While my midrange GeForce might deal with this happily I don't know how e.g. integrated graphic-chips from intel on shared memory can deal with the bandwidth issues that might arise from such an approach. What's your opinion on this? BTW, did I make myself clear enough or should I gimp up a quick schematic of the whole issue? Once that's finished I intend them to be stuffed into textures and then injected in gnome-window-decorator.c as a first test (replacing the hard-coded inline pixmaps) to see if everything regarding the tweakable parameters works as expected. Best regards... MacSlow -- email - macslow@bangang.de www - http://macslow.thepimp.net lowfat - http://macslow.thepimp.net/sponsor-it
David Reveman
2006-Apr-03 05:16 UTC
[compiz] Greetings, first remarks about trying to do customizable drop-shadows
On Sun, 2006-04-02 at 12:09 +0200, Mirco M?ller wrote:> Hello there everybody! > > Terrific... a mailing-list for compiz with David on board! Ok, I > started off with writing some functions using cairo to draw me the > needed elements for drop-shadows (atm stand-alone to focus on the proper > generation of the shadow-parts) and currently still fiddle with the > tweakable parameters. Right now I have... > > shadow-radius (e.g. 20 pixels) > 2D-offset vector (e.g. 10 pixels right, 15 pixels downwards) > start-color as rgba (e.g. 0.2/0.2/0.2/1.0) > end-color as rgba (e.g. 0.2/0.2/0.2/0.0) > > and try to figure out how I best approach the splitting up of the 5 to 8 > shadow-elements (top-left, top, top-right, left, right, bottom-left, > bottom, bottom-right) depeding on the length of the offset-vector being > =, < or > to the radius. I am also not sure how to attack the problem of > rounded corners of the windows decoration-frame. If the shadow-textures > will align with the outter edges of the decoration-frame there will be > "unshadowed" gaps at the rounded corners. If I have the shadow-textures > overlap a bit inwards it might look funny if the windows opacity changes > to transparent. Right now the only solution for this is to fill the > inner part of the drop-shadow with a rectangle having the start-color. > But this solution causes heavy overdraw. While my midrange GeForce might > deal with this happily I don't know how e.g. integrated graphic-chips > from intel on shared memory can deal with the bandwidth issues that > might arise from such an approach. What's your opinion on this? BTW, did > I make myself clear enough or should I gimp up a quick schematic of the > whole issue?I assume that you want to put this code in compiz as a plugin. I suggest not doing that. I've implemented drop-shadows like that before and it's not a good solution. I strongly believe that drop shadows as part of the decorations is currently the best solution. Like gnome-window-decorator is doing but they should be made fully tweakable, of course. Read the section about drop-shadows in the following post, if you haven't already. http://lists.freedesktop.org/archives/compiz/2006-April/000009.html -David