I verified, it seems to work fine with black desktop background, all blendings are correct. I tested with Nvidia and XOrg on Archlinux.

Below is the patch against GIT latest version., it enables ARGB visual by checking env variable CLUTTER_XRENDER. There are better ways to use it but for now it does the job.

Stéphane Esté-Gracias wrote:
Hello,

Do you have any information about issue found by Vlad Seryakov ?
Does patch exist and work with Perl binding ?

Thanks in advance,

Stephane

2009/2/10 Vlad Seryakov <[email protected]>:
Do you have any idea where this blending issue might be? Nvidia? GLX?

Also, i use compiz/emerald as my window manager, i am going to try it with
simpel xcompmgr and see if the result will be the same.

The primary goal for this is to be able to use video in separate window
instead of clutter-gst which makes video stutter when performing
transformations in Clutter.

Emmanuele Bassi wrote:
On Tue, 2009-02-10 at 11:16 -0500, Vlad Seryakov wrote:
I am still working on that, i use NVidia card and transparency works but
too aggressive.
ah, right. I was about to ask on which GPU you were testing.

yes, nvidia drivers will honour RGBA visuals on GLX; most of the other
drivers won't.

 I mean i have a stage with multiple textures, and textures with opacity
over 192 became completely transparent. Also, it seems, once a texture has
alpha, it burns through, so resulting window is transparent at this place. I
am not sure i even described it correctly.
I borrowed the idea from QT example called ARGB.
it's probably a blending issue.

ciao,
 Emmanuele.

--
To unsubscribe send a mail to [email protected]



--- clutter-stage-glx.c.orig	2009-02-27 14:58:42.000000000 -0500
+++ clutter-stage-glx.c	2009-02-27 15:00:53.000000000 -0500
@@ -46,6 +46,7 @@
 
 #include <GL/glx.h>
 #include <GL/gl.h>
+#include <X11/extensions/Xrender.h>
 
 static void clutter_stage_window_iface_init (ClutterStageWindowIface *iface);
 
@@ -114,6 +115,8 @@
   ClutterBackendGLX *backend_glx;
   ClutterBackendX11 *backend_x11;
   gboolean           is_offscreen;
+  int                eventBase, errorBase;
+
 
   CLUTTER_NOTE (MISC, "Realizing main stage");
 
@@ -141,6 +144,25 @@
           stage_x11->xvisinfo = None;
         }
 
+      if (getenv("CLUTTER_XRENDER") && XRenderQueryExtension(stage_x11->xdpy, &eventBase, &errorBase)) 
+        {
+          int i, nvi;
+          XVisualInfo templ;
+          templ.screen = DefaultScreen(stage_x11->xdpy);
+          templ.depth = 32;
+          templ.class = TrueColor;
+          XVisualInfo *xvi = XGetVisualInfo(stage_x11->xdpy, VisualScreenMask | VisualDepthMask | VisualClassMask, &templ, &nvi);
+
+          for (i = 0; i < nvi; ++i) {
+              XRenderPictFormat *format = XRenderFindVisualFormat(stage_x11->xdpy, xvi[i].visual);
+              if (format->type == PictTypeDirect && format->direct.alphaMask) 
+                {
+                  stage_x11->xvisinfo = g_memdup(&xvi[i], sizeof(Visual));
+                  break;
+                }
+          }
+       }
+
       /* The following check seems strange */
       if (stage_x11->xvisinfo == None)
         stage_x11->xvisinfo = glXChooseVisual (stage_x11->xdpy,

Reply via email to