xserver: Branch 'xorg-server-1.6-apple' - 4 commits

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Fri May 29 14:47:41 PDT 2009


 configure.ac                    |    2 +-
 glx/glxcmds.c                   |   22 ++++++++++++++++------
 glx/glxscreens.c                |    2 +-
 glx/glxserver.h                 |    3 +--
 mi/miexpose.c                   |   27 ++++++++++++++++++++++-----
 miext/rootless/rootlessScreen.c |    3 +--
 6 files changed, 42 insertions(+), 17 deletions(-)

New commits:
commit 3f6ae7007c0e49fe24e74f9a6fe131e3ad4d1b4f
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Fri May 29 14:47:18 2009 -0700

    GLX: Purge glxint.h usage
    
    Change (__GLXvisualConfig *) to (void *) in ABI compat stubs.
    (cherry picked from commit b4adec886c65e49cfbd30d1e3a41b613f75ed3f5)

diff --git a/glx/glxscreens.c b/glx/glxscreens.c
index 95d35eb..43956e6 100644
--- a/glx/glxscreens.c
+++ b/glx/glxscreens.c
@@ -224,7 +224,7 @@ glxGetScreen(ScreenPtr pScreen)
 }
 
 void GlxSetVisualConfigs(int nconfigs, 
-                         __GLXvisualConfig *configs, void **privates)
+                         void *configs, void **privates)
 {
     /* We keep this stub around for the DDX drivers that still
      * call it. */
diff --git a/glx/glxserver.h b/glx/glxserver.h
index a5ca0a2..3e44b71 100644
--- a/glx/glxserver.h
+++ b/glx/glxserver.h
@@ -55,7 +55,6 @@
 #define GL_GLEXT_PROTOTYPES /* we want prototypes */
 #include <GL/gl.h>
 #include <GL/glxproto.h>
-#include <GL/glxint.h>
 
 /* For glxscreens.h */
 typedef struct __GLXdrawable __GLXdrawable;
@@ -93,7 +92,7 @@ extern __GLXclientState *glxGetClient(ClientPtr pClient);
 void GlxExtensionInit(void);
 
 void GlxSetVisualConfigs(int nconfigs, 
-                         __GLXvisualConfig *configs, void **privates);
+                         void *configs, void **privates);
 
 struct _glapi_table;
 void GlxSetRenderTables (struct _glapi_table *table);
commit b5e871e44c7ff701231379f6286cd421b81ce3db
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Fri May 29 14:27:46 2009 -0700

    GLX: Purge some glxint.h usage in glxcmds.c
    
    This is related to d0b249f1c5df81f3941d638f9625fe1e16c31807 in the 1.4 branch and was ok'd by krh
    (cherry picked from commit e587436cf2e1237813c924699ff0662aea3034e1)

diff --git a/glx/glxcmds.c b/glx/glxcmds.c
index 24ef893..2da23f8 100644
--- a/glx/glxcmds.c
+++ b/glx/glxcmds.c
@@ -855,6 +855,14 @@ int __glXDisp_CopyContext(__GLXclientState *cl, GLbyte *pc)
     return Success;
 }
 
+enum {
+    GLX_VIS_CONFIG_UNPAIRED = 18,
+    GLX_VIS_CONFIG_PAIRED = 20
+};
+
+enum {
+    GLX_VIS_CONFIG_TOTAL = GLX_VIS_CONFIG_UNPAIRED + GLX_VIS_CONFIG_PAIRED
+};
 
 int __glXDisp_GetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
 {
@@ -863,7 +871,7 @@ int __glXDisp_GetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
     xGLXGetVisualConfigsReply reply;
     __GLXscreen *pGlxScreen;
     __GLXconfig *modes;
-    CARD32 buf[__GLX_TOTAL_CONFIG];
+    CARD32 buf[GLX_VIS_CONFIG_TOTAL];
     int p, i, err;
     __GLX_DECLARE_SWAP_VARIABLES;
     __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
@@ -872,8 +880,8 @@ int __glXDisp_GetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
 	return err;
 
     reply.numVisuals = pGlxScreen->numVisuals;
-    reply.numProps = __GLX_TOTAL_CONFIG;
-    reply.length = (reply.numVisuals * __GLX_SIZE_CARD32 * __GLX_TOTAL_CONFIG) >> 2;
+    reply.numProps = GLX_VIS_CONFIG_TOTAL;
+    reply.length = (reply.numVisuals * __GLX_SIZE_CARD32 * GLX_VIS_CONFIG_TOTAL) >> 2;
     reply.type = X_Reply;
     reply.sequenceNumber = client->sequence;
 
@@ -911,6 +919,8 @@ int __glXDisp_GetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
 	buf[p++] = modes->stencilBits;
 	buf[p++] = modes->numAuxBuffers;
 	buf[p++] = modes->level;
+
+	assert(p == GLX_VIS_CONFIG_UNPAIRED);
 	/* 
 	** Add token/value pairs for extensions.
 	*/
@@ -935,11 +945,11 @@ int __glXDisp_GetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
 	buf[p++] = 0; /* copy over visualSelectGroup (GLX_VISUAL_SELECT_GROUP_SGIX)? */
 	buf[p++] = 0;
 
+	assert(p == GLX_VIS_CONFIG_TOTAL);
 	if (client->swapped) {
-	    __GLX_SWAP_INT_ARRAY(buf, __GLX_TOTAL_CONFIG);
+	    __GLX_SWAP_INT_ARRAY(buf, p);
 	}
-	WriteToClient(client, __GLX_SIZE_CARD32 * __GLX_TOTAL_CONFIG, 
-		(char *)buf);
+	WriteToClient(client, __GLX_SIZE_CARD32 * p, (char *)buf);
     }
     return Success;
 }
commit ab66b27fa995074d8f046108d91ce93f4f4d9463
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Fri May 29 14:09:41 2009 -0700

    XQuartz: Fix alpha to be 1 (screenshots bug, etc)
    
    This is related to: bc964ff1e3f3d8ab590eab40d767c6241e9480d4
    XQuartz: Stab at fixing the alpha 0/1 bug (screenshots, etc) by pulling in some old code that got gutted from rootless.
    
    which was on the 1.4 branch and implemented in fbPaintWindow.  Now that fbPaintWindow is gone, this is now in miPaintWindow().
    (cherry picked from commit 032173f693f75385a40e144ffe2b7b5378bb6f2e)

diff --git a/configure.ac b/configure.ac
index 911423f..eed3599 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1542,7 +1542,7 @@ if test "x$XQUARTZ" = xyes; then
 
 	AC_CHECK_LIB([Xplugin],[xp_init],[:])
 
-	CFLAGS="${CFLAGS} -DROOTLESS_WORKAROUND -DNO_ALLOCA"
+	CFLAGS="${CFLAGS} -DROOTLESS_WORKAROUND -DROOTLESS_SAFEALPHA -DNO_ALLOCA"
 
 	PKG_CHECK_MODULES(XPBPROXY, [applewmproto >= 1.2] [applewm >= 1.2] xfixes fixesproto x11)
 
diff --git a/mi/miexpose.c b/mi/miexpose.c
index f8a9e2f..2d8cc1a 100644
--- a/mi/miexpose.c
+++ b/mi/miexpose.c
@@ -518,7 +518,7 @@ void
 miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
 {
     ScreenPtr	pScreen = pWin->drawable.pScreen;
-    ChangeGCVal gcval[5];
+    ChangeGCVal gcval[6];
     BITS32	gcmask;
     GCPtr	pGC;
     int		i;
@@ -586,18 +586,35 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
     gcval[0].val = GXcopy;
     gcmask = GCFunction;
 
+#ifdef ROOTLESS_SAFEALPHA
+/* Bit mask for alpha channel with a particular number of bits per
+ * pixel. Note that we only care for 32bpp data. Mac OS X uses planar
+ * alpha for 16bpp.
+ */
+#define RootlessAlphaMask(bpp) ((bpp) == 32 ? 0xFF000000 : 0)
+#endif
+    
     if (solid)
     {
+#ifdef ROOTLESS_SAFEALPHA
+	gcval[1].val = fill.pixel | RootlessAlphaMask(pWin->drawable.bitsPerPixel);
+#else
 	gcval[1].val = fill.pixel;
+#endif
 	gcval[2].val  = FillSolid;
 	gcmask |= GCForeground | GCFillStyle;
     }
     else
     {
-	gcval[1].val = FillTiled;
-	gcval[2].ptr = (pointer)fill.pixmap;
-	gcval[3].val = tile_x_off;
-	gcval[4].val = tile_y_off;
+	int c=1;
+#ifdef ROOTLESS_SAFEALPHA
+	gcval[c++].val = ((CARD32)-1) & ~RootlessAlphaMask(pWin->drawable.bitsPerPixel);
+	gcmask |= GCPlaneMask;
+#endif
+	gcval[c++].val = FillTiled;
+	gcval[c++].ptr = (pointer)fill.pixmap;
+	gcval[c++].val = tile_x_off;
+	gcval[c++].val = tile_y_off;
 	gcmask |= GCFillStyle | GCTile | GCTileStipXOrigin | GCTileStipYOrigin;
     }
 
commit 81a061eef45f07d4f220806cfd35cb71b78bf00e
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Fri May 29 14:02:18 2009 -0700

    Rootless: Use miPaintWindow since PaintWindowBackground is dead
    (cherry picked from commit 4975c087257b52189a5c21d93d121f183e60e4c8)

diff --git a/miext/rootless/rootlessScreen.c b/miext/rootless/rootlessScreen.c
index 75dd439..88d3869 100644
--- a/miext/rootless/rootlessScreen.c
+++ b/miext/rootless/rootlessScreen.c
@@ -481,8 +481,7 @@ static void expose_1 (WindowPtr pWin) {
     if (!pWin->realized)
         return;
     
-    (*pWin->drawable.pScreen->PaintWindowBackground) (pWin, &pWin->borderClip,
-                                                      PW_BACKGROUND);
+    miPaintWindow(pWin, &pWin->borderClip, PW_BACKGROUND);
     
     /* FIXME: comments in windowstr.h indicate that borderClip doesn't
      include subwindow visibility. But I'm not so sure.. so we may


More information about the xorg-commit mailing list