X Strike Force Xrender SVN commit: rev 52 - trunk
Author: branden
Date: 2003-10-06 22:32:26 -0500 (Mon, 06 Oct 2003)
New Revision: 52
Modified:
trunk/ChangeLog
trunk/Filter.c
trunk/Makefile.am
trunk/Makefile.in
trunk/Xrender.c
trunk/Xrenderint.h
trunk/config.h.in
trunk/configure
trunk/configure.ac
Log:
Merge changes from Xrender 0.8.3.
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2003-10-07 03:29:36 UTC (rev 51)
+++ trunk/ChangeLog 2003-10-07 03:32:26 UTC (rev 52)
@@ -1,3 +1,14 @@
+2003-06-08 10:56 keithp
+
+ * Filter.c, Makefile.am, Xrender.c, Xrenderint.h, configure.ac:
+ Bail on bogus Xsun servers, compile with -DXTHREADS if necessary,
+ get rid of unecessary cast to XRenderInfo *
+
+2003-05-06 09:05 branden
+
+ * ChangeLog: Huh. Did Keith tag xrender-0_8_2 *before* running
+ cvs2cl? Running it again.
+
2003-05-05 20:56 keithp
* ChangeLog: Update ChangeLog with spiffy cvs2cl script (thanks
Modified: trunk/Filter.c
===================================================================
--- trunk/Filter.c 2003-10-07 03:29:36 UTC (rev 51)
+++ trunk/Filter.c 2003-10-07 03:32:26 UTC (rev 52)
@@ -1,5 +1,5 @@
/*
- * $Id: Filter.c,v 1.3 2003/04/24 03:29:15 nlevitt Exp $
+ * $Id: Filter.c,v 1.4 2003/06/08 17:56:37 keithp Exp $
*
* Copyright � 2002 Keith Packard
*
@@ -43,7 +43,7 @@
if (!XRenderQueryFormats (dpy))
return 0;
- xri = (XRenderInfo *) info->data;
+ xri = info->info;
if (xri->minor_version < 6)
return 0;
Modified: trunk/Makefile.am
===================================================================
--- trunk/Makefile.am 2003-10-07 03:29:36 UTC (rev 51)
+++ trunk/Makefile.am 2003-10-07 03:32:26 UTC (rev 52)
@@ -1,5 +1,5 @@
#
-# $Id: Makefile.am,v 1.7 2003/05/03 20:00:16 keithp Exp $
+# $Id: Makefile.am,v 1.9 2003/06/10 00:03:33 nlevitt Exp $
#
# Copyright © 2003 Keith Packard, Noah Levitt
#
@@ -21,7 +21,7 @@
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-AM_CFLAGS = $(RENDER_CFLAGS) $(X_CFLAGS)
+AM_CFLAGS = $(RENDER_CFLAGS) $(X_CFLAGS)
lib_LTLIBRARIES = libXrender.la
Modified: trunk/Makefile.in
===================================================================
--- trunk/Makefile.in 2003-10-07 03:29:36 UTC (rev 51)
+++ trunk/Makefile.in 2003-10-07 03:32:26 UTC (rev 52)
@@ -15,7 +15,7 @@
@SET_MAKE@
#
-# $Id: Makefile.am,v 1.7 2003/05/03 20:00:16 keithp Exp $
+# $Id: Makefile.am,v 1.9 2003/06/10 00:03:33 nlevitt Exp $
#
# Copyright © 2003 Keith Packard, Noah Levitt
#
@@ -148,7 +148,7 @@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
-AM_CFLAGS = $(RENDER_CFLAGS) $(X_CFLAGS)
+AM_CFLAGS = $(RENDER_CFLAGS) $(X_CFLAGS)
lib_LTLIBRARIES = libXrender.la
Modified: trunk/Xrender.c
===================================================================
--- trunk/Xrender.c 2003-10-07 03:29:36 UTC (rev 51)
+++ trunk/Xrender.c 2003-10-07 03:32:26 UTC (rev 52)
@@ -1,5 +1,5 @@
/*
- * $Id: Xrender.c,v 1.16 2003/04/24 03:29:15 nlevitt Exp $
+ * $Id: Xrender.c,v 1.17 2003/06/08 17:56:37 keithp Exp $
*
* Copyright © 2000 SuSE, Inc.
*
@@ -64,6 +64,42 @@
}
/*
+ * If the server is missing support for any of the required depths on
+ * any screen, tell the application that Render is not present.
+ */
+
+#define DEPTH_MASK(d) (1 << ((d) - 1))
+
+/*
+ * Render requires support for depth 1, 4, 8, 24 and 32 pixmaps
+ */
+
+#define REQUIRED_DEPTHS (DEPTH_MASK(1) | \
+ DEPTH_MASK(4) | \
+ DEPTH_MASK(8) | \
+ DEPTH_MASK(24) | \
+ DEPTH_MASK(32))
+
+static Bool
+XRenderHasDepths (Display *dpy)
+{
+ int s;
+
+ for (s = 0; s < ScreenCount (dpy); s++)
+ {
+ CARD32 depths = 0;
+ Screen *scr = ScreenOfDisplay (dpy, s);
+ int d;
+
+ for (d = 0; d < scr->ndepths; d++)
+ depths |= DEPTH_MASK(scr->depths[d].depth);
+ if (~depths & REQUIRED_DEPTHS)
+ return False;
+ }
+ return True;
+}
+
+/*
* XRenderExtAddDisplay - add a display to this extension. (Replaces
* XextAddDisplay)
*/
@@ -77,9 +113,13 @@
dpyinfo = (XRenderExtDisplayInfo *) Xmalloc (sizeof (XRenderExtDisplayInfo));
if (!dpyinfo) return NULL;
dpyinfo->display = dpy;
- dpyinfo->data = NULL;
- dpyinfo->codes = XInitExtension (dpy, ext_name);
+ dpyinfo->info = NULL;
+ if (XRenderHasDepths (dpy))
+ dpyinfo->codes = XInitExtension (dpy, ext_name);
+ else
+ dpyinfo->codes = NULL;
+
/*
* if the server has the extension, then we can initialize the
* appropriate function vectors
@@ -171,7 +211,7 @@
XRenderCloseDisplay (Display *dpy, XExtCodes *codes)
{
XRenderExtDisplayInfo *info = XRenderFindDisplay (dpy);
- if (info->data) XFree (info->data);
+ if (info->info) XFree (info->info);
return XRenderExtRemoveDisplay (&XRenderExtensionInfo, dpy);
}
@@ -209,7 +249,7 @@
if (!XRenderQueryFormats (dpy))
return 0;
- xri = (XRenderInfo *) info->data;
+ xri = info->info;
*major_versionp = xri->major_version;
*minor_versionp = xri->minor_version;
return 1;
@@ -293,7 +333,7 @@
RenderCheckExtension (dpy, info, 0);
LockDisplay (dpy);
- if (info->data)
+ if (info->info)
{
UnlockDisplay (dpy);
return 1;
@@ -425,7 +465,7 @@
xSubpixel++;
screen++;
}
- info->data = (XPointer) xri;
+ info->info = xri;
/*
* Skip any extra data
*/
@@ -450,7 +490,7 @@
if (!XRenderQueryFormats (dpy))
return SubPixelUnknown;
- xri = (XRenderInfo *) info->data;
+ xri = info->info;
return xri->screen[screen].subpixel;
}
@@ -466,7 +506,7 @@
if (!XRenderQueryFormats (dpy))
return False;
- xri = (XRenderInfo *) info->data;
+ xri = info->info;
xri->screen[screen].subpixel = subpixel;
return True;
}
@@ -482,7 +522,7 @@
RenderCheckExtension (dpy, info, 0);
if (!XRenderQueryFormats (dpy))
return 0;
- xri = (XRenderInfo *) info->data;
+ xri = info->info;
for (nv = 0, xrv = xri->visual; nv < xri->nvisual; nv++, xrv++)
if (xrv->visual == visual)
return xrv->format;
@@ -502,7 +542,7 @@
RenderCheckExtension (dpy, info, 0);
if (!XRenderQueryFormats (dpy))
return 0;
- xri = (XRenderInfo *) info->data;
+ xri = info->info;
for (nf = 0; nf < xri->nformat; nf++)
{
if (mask & PictFormatID)
Modified: trunk/Xrenderint.h
===================================================================
--- trunk/Xrenderint.h 2003-10-07 03:29:36 UTC (rev 51)
+++ trunk/Xrenderint.h 2003-10-07 03:32:26 UTC (rev 52)
@@ -1,5 +1,5 @@
/*
- * $Id: Xrenderint.h,v 1.11 2003/05/06 02:06:41 keithp Exp $
+ * $Id: Xrenderint.h,v 1.13 2003/06/10 00:08:32 keithp Exp $
*
* Copyright © 2000 SuSE, Inc.
*
@@ -26,6 +26,7 @@
#ifndef _XRENDERINT_H_
#define _XRENDERINT_H_
+#include "config.h"
#define NEED_EVENTS
#define NEED_REPLIES
#include <X11/Xlibint.h>
@@ -75,7 +76,7 @@
struct _XRenderExtDisplayInfo *next; /* keep a linked list */
Display *display; /* which display this is */
XExtCodes *codes; /* the extension protocol codes */
- XPointer data; /* extra data for the extension to use */
+ XRenderInfo *info; /* extra data for the extension to use */
} XRenderExtDisplayInfo;
/* replaces XExtensionInfo */
Modified: trunk/config.h.in
===================================================================
--- trunk/config.h.in 2003-10-07 03:29:36 UTC (rev 51)
+++ trunk/config.h.in 2003-10-07 03:32:26 UTC (rev 52)
@@ -63,5 +63,8 @@
/* Version number of package */
#undef VERSION
+/* Define if Xlib supports XTHREADS */
+#undef XTHREADS
+
/* Define to 1 if the X Window System is missing or not being used. */
#undef X_DISPLAY_MISSING
Modified: trunk/configure
===================================================================
--- trunk/configure 2003-10-07 03:29:36 UTC (rev 51)
+++ trunk/configure 2003-10-07 03:32:26 UTC (rev 52)
@@ -1713,7 +1713,7 @@
# Define the identity of the package.
PACKAGE=xrender
- VERSION=0.8.2
+ VERSION=0.8.3
cat >>confdefs.h <<_ACEOF
@@ -3342,7 +3342,7 @@
# This must be Linux ELF.
linux-gnu*)
case $host_cpu in
- alpha* | hppa* | i*86 | mips | mipsel | powerpc* | sparc* | ia64*)
+ alpha* | hppa* | i*86 | mips | mipsel | powerpc* | sparc* | ia64* | arm* | m68k)
lt_cv_deplibs_check_method=pass_all ;;
*)
# glibc up to 2.1.1 does not perform some relocations on ARM
@@ -8971,6 +8971,74 @@
{ (exit 1); exit 1; }; }
fi
+# Check for XTHREADS
+
+
+
+
+save_LIBS="$LIBS"
+save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $X_CFLAGS"
+LIBS="$LIBS $X_LIBS -lX11"
+
+echo "$as_me:$LINENO: checking for XTHREADS in Xlib" >&5
+echo $ECHO_N "checking for XTHREADS in Xlib... $ECHO_C" >&6
+if test "$cross_compiling" = yes; then
+ xthreads=yes
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <X11/Xlib.h>
+int
+main ()
+{
+return XInitThreads() == 0 ? 0 : 1;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ xthreads=no
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+xthreads=yes
+fi
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $xthreads" >&5
+echo "${ECHO_T}$xthreads" >&6
+
+LIBS="$save_LIBS"
+CFLAGS="$save_CFLAGS"
+
+if test "x$xthreads" = "xyes"
+then
+ cat >>confdefs.h <<\_ACEOF
+#define XTHREADS 1
+_ACEOF
+
+fi
+
# Check render configuration, strip extra digits from package version to
# find the required protocol version
Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac 2003-10-07 03:29:36 UTC (rev 51)
+++ trunk/configure.ac 2003-10-07 03:32:26 UTC (rev 52)
@@ -1,5 +1,5 @@
dnl
-dnl $Id: configure.ac,v 1.9 2003/05/06 03:49:18 keithp Exp $
+dnl $Id: configure.ac,v 1.12 2003/06/10 00:03:33 nlevitt Exp $
dnl
dnl Copyright © 2003 Keith Packard, Noah Levitt
dnl
@@ -33,7 +33,7 @@
dnl digit in the version number to track changes which don't affect the
dnl protocol, so Xrender version l.n.m corresponds to protocol version l.n
dnl
-AM_INIT_AUTOMAKE(xrender, 0.8.2)
+AM_INIT_AUTOMAKE(xrender, 0.8.3)
AM_CONFIG_HEADER(config.h)
# Check for progs
@@ -48,6 +48,33 @@
AC_MSG_ERROR([X is required, but it was either disabled or not found.])
fi
+# Check for XTHREADS
+
+AH_TEMPLATE([XTHREADS], [Define if Xlib supports XTHREADS])
+
+save_LIBS="$LIBS"
+save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $X_CFLAGS"
+LIBS="$LIBS $X_LIBS -lX11"
+
+AC_MSG_CHECKING([for XTHREADS in Xlib])
+AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM([[#include <X11/Xlib.h>]],
+ [[return XInitThreads() == 0 ? 0 : 1;]])],
+ [xthreads=no],
+ [xthreads=yes],
+ [xthreads=yes])
+
+AC_MSG_RESULT($xthreads)
+
+LIBS="$save_LIBS"
+CFLAGS="$save_CFLAGS"
+
+if test "x$xthreads" = "xyes"
+then
+ AC_DEFINE(XTHREADS, 1)
+fi
+
# Check render configuration, strip extra digits from package version to
# find the required protocol version
Reply to: