Mike Cook
2007-Apr-07 19:46 UTC
[compiz] GWD button drawing prob-- any Cairo pro have insights?
Since I first tried nVidia's AIGLX with Compiz I've been seeing some pretty consistent drawing problems on GWD's minimize and maximize buttons on hover. It looks like part of the fill is drawn with low alpha. I haven't been able to duplicate it when using Xgl... Here's a quick vid of what I'm seeing: http://s154.photobucket.com/albums/s273/m1kecook/Compiz/?action=view¤t=gwd-button-prob.flv The following patch seems to work around the problem (but only if I set the alpha less than 1.0): --- gtk/window-decorator/gtk-window-decorator.c +++ gtk/window-decorator/gtk-window-decorator.c @@ -943,7 +943,7 @@ button_state_paint (cairo_t *cr, cairo_stroke_preserve (cr); if (state & IN_EVENT_WINDOW) - cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); + cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 0.99); else cairo_set_source_rgba (cr, color->r, color->g, color->b, 0.95); I'm not proficient enough with Cairo to know if this is a bug there, with nVidia's driver, or something in GWD or somewhere else. Anyone have insights? ...MC
Gerd Kohlberger
2007-Apr-07 20:48 UTC
[compiz] GWD button drawing prob-- any Cairo pro have insights?
I think that happens because of how cairo maps coordinates. You have to shift some coordinates by 0.5px depending on the line width. The first question here explains it better than i can: http://cairographics.org/FAQ ( btw, i guess i'm a 'pixels are little squares' person :) ) I already had a patch for that somewhere, I'll bring it up to date and post it. Mike Cook wrote:> Since I first tried nVidia's AIGLX with Compiz I've been seeing some pretty > consistent drawing problems on GWD's minimize and maximize buttons on hover. > It looks like part of the fill is drawn with low alpha. I haven't been able to > duplicate it when using Xgl... Here's a quick vid of what I'm seeing: > http://s154.photobucket.com/albums/s273/m1kecook/Compiz/?action=view¤t=gwd-button-prob.flv > > The following patch seems to work around the problem (but only if I set the > alpha less than 1.0): > --- gtk/window-decorator/gtk-window-decorator.c > +++ gtk/window-decorator/gtk-window-decorator.c > @@ -943,7 +943,7 @@ button_state_paint (cairo_t *cr, > cairo_stroke_preserve (cr); > > if (state & IN_EVENT_WINDOW) > - cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); > + cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 0.99); > else > cairo_set_source_rgba (cr, color->r, color->g, color->b, 0.95); > > > I'm not proficient enough with Cairo to know if this is a bug there, with > nVidia's driver, or something in GWD or somewhere else. Anyone have insights? > > ...MC > _______________________________________________ > compiz mailing list > compiz@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/compiz >
Gerd Kohlberger
2007-Apr-07 22:54 UTC
[compiz] GWD button drawing prob-- any Cairo pro have insights?
This patch should fix it. It seems to work good here. The x-shift is not really necessary, but the close button looks a little sharper that way. -------------- next part -------------- A non-text attachment was scrubbed... Name: gwd-button_drawing_fix.diff Type: text/x-patch Size: 1236 bytes Desc: not available Url : http://lists.freedesktop.org/archives/compiz/attachments/20070408/f1949751/gwd-button_drawing_fix.bin
David Reveman
2007-Apr-09 08:35 UTC
[compiz] GWD button drawing prob-- any Cairo pro have insights?
On Sat, 2007-04-07 at 20:46 -0600, Mike Cook wrote:> Since I first tried nVidia's AIGLX with Compiz I've been seeing some pretty > consistent drawing problems on GWD's minimize and maximize buttons on hover. > It looks like part of the fill is drawn with low alpha. I haven't been able to > duplicate it when using Xgl... Here's a quick vid of what I'm seeing: > http://s154.photobucket.com/albums/s273/m1kecook/Compiz/?action=view¤t=gwd-button-prob.flv > > The following patch seems to work around the problem (but only if I set the > alpha less than 1.0): > --- gtk/window-decorator/gtk-window-decorator.c > +++ gtk/window-decorator/gtk-window-decorator.c > @@ -943,7 +943,7 @@ button_state_paint (cairo_t *cr, > cairo_stroke_preserve (cr); > > if (state & IN_EVENT_WINDOW) > - cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); > + cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 0.99); > else > cairo_set_source_rgba (cr, color->r, color->g, color->b, 0.95); > > > I'm not proficient enough with Cairo to know if this is a bug there, with > nVidia's driver, or something in GWD or somewhere else. Anyone have insights?Seems very much like an X server issue to me. - David
Apparently Analagous Threads
- state of blur plugin
- [PATCH] Annotate shapes, text and dbus support
- 15 commits - libswfdec/swfdec_as_strings.c libswfdec/swfdec_initialize.as libswfdec/swfdec_initialize.h libswfdec/swfdec_movie.c libswfdec/swfdec_movie.h libswfdec/swfdec_sprite.c libswfdec/swfdec_sprite_movie.c libswfdec/swfdec_system_as.c
- [BUG] blurred decoration for gwd causes drawing artifacts
- Unable to start gwd under Fedora 7