debrix/render Makefile.am, 1.2, 1.3 filter.c, 1.3, 1.4 picture.c, 1.3, 1.4

Daniel Stone xserver-commit at pdx.freedesktop.org
Thu Jul 1 10:49:56 PDT 2004


Committed by: daniel

Update of /cvs/xserver/debrix/render
In directory pdx:/tmp/cvs-serv31934/render

Modified Files:
	Makefile.am filter.c picture.c 
Log Message:
2004-06-29  Daniel Stone  <daniel at freedesktop.org>

	* configure.ac:
	Made CFLAGS a little less embarassingly large; fix it so the script
	actually runs and works fine (no more sed errors); remove XF86keysym.h
	check, which probably never actually worked. Get rid of INCLUDES;
	merge it into CFLAGS.

	* */Makefile.am:
	Sanitise INCLUDES/CFLAGS usage to radically decrease length of gcc
	lines.

	* include/Makefile.am:
	Make debrix.h depend on config.h, so they stay in sync. Oops.

	* hw/xorg/int10/xf86int10module.c:
	Change int10VersRec declaration from static, so debrixInit can see it.

	* hw/xorg/common/xf86KbdLnx.c:
	* hw/xorg/os-support/linux/lnx_KbdMap.c:
	Axe unused DECkeysym.h header dep.

	* hw/xorg/include/X11/extensions/Makefile.am:
	Finally fix the ext_HEADERS debacle.

	* hw/xorg/loader/dlloader.c:
	* hw/xorg/loader/loader.c:
	dlopen() NULL at startup, and include it in dlsym() searches, so we
	can find symbols included in the main binary with the standard module
	search.

	* hw/xorg/loader/loader.c:
	* hw/xorg/loader/loadmod.c:
	* hw/xorg/loader/xf86sym.c:
	* hw/xorg/common/xf86Init.c:
	Change loader API to introduce a new 'builtin' class, which doesn't
	actually load a module, but goes through all the motions; get rid of
	baseModules list for the time being (we don't want bitmap, and pcidata
	is already loaded). Explicitly add all ModuleData objects being loaded
	to xf86sym.c, so they don't get 'optimised' out.
	
	* hw/xorg/common/debrixInit.c:
	* hw/xorg/common/xf86Init.c:
	Add new debrixInit() function, which adds a few modules as builtins.

	* hw/xorg/loader/xf86sym.c:
	* hw/xorg/os-support/linux/Makefile.am:
	Re-enable a few missing os-support functions (xf86UDelay, xf86IODelay,
	xf86BusToMem, xf86MemToBus, xf86LoadKernelModule).

	* configure.ac:
	* fb/Makefile.am:
	* miext/shadow/Makefile.am:
	Make fb and shadow modular once more.

	* fb/fb.h:
	* render/filter.c:
	* render/picture.c:
	* include/picturestr.h:
	Rolled back to X.Org versions until I can figure out why pictures
	don't actually display in most cases.

	The following two are thanks to Jabuk Piotr C?apa.
	* os/xdmauth.c:
	"Xdmcp.h" -> <X11/Xdmcp.h>

	* hw/xorg/os-support/shared/drm/kernel/drm.h:
	Guard linux/config.h inclusion with #ifdef __KERNEL__.


Index: Makefile.am
===================================================================
RCS file: /cvs/xserver/debrix/render/Makefile.am,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- Makefile.am	12 Jun 2004 17:33:00 -0000	1.2
+++ Makefile.am	1 Jul 2004 17:49:52 -0000	1.3
@@ -1,8 +1,3 @@
-INCLUDES = 					\
-	-I$(top_srcdir)/include			\
-	-I$(top_srcdir)/mi			\
-	@XSERVER_CFLAGS@
-
 noinst_LIBRARIES = librender.a
 
 librender_a_SOURCES =	\
@@ -18,5 +13,4 @@
 	picture.c	\
 	render.c
 
-AM_CFLAGS = $(XORG_CFLAGS)
 sdk_HEADERS = picture.h mipict.h

Index: filter.c
===================================================================
RCS file: /cvs/xserver/debrix/render/filter.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- filter.c	10 Jun 2004 19:42:07 -0000	1.3
+++ filter.c	1 Jul 2004 17:49:52 -0000	1.4
@@ -1,7 +1,7 @@
 /*
- * $Id$
+ * $XFree86$
  *
- * Copyright © 2002 Keith Packard
+ * Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc.
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
@@ -25,6 +25,7 @@
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
+
 #include "misc.h"
 #include "scrnintstr.h"
 #include "os.h"
@@ -43,12 +44,6 @@
 static char **filterNames;
 static int  nfilterNames;
 
-/*
- * standard but not required filters don't have constant indices
- */
-
-int pictFilterConvolution;
-
 int
 PictureGetFilterId (char *filter, int len, Bool makeit)
 {
@@ -59,14 +54,15 @@
     if (len < 0)
 	len = strlen (filter);
     for (i = 0; i < nfilterNames; i++)
-	if (!CompareISOLatin1Lowered (filterNames[i], -1, filter, len))
+	if (len == strlen (filterNames[i]) && 
+	    !strncmp (filterNames[i], filter, len))
 	    return i;
     if (!makeit)
 	return -1;
-    name = xalloc (len + 1);
+    name = xalloc (strlen (filter) + 1);
     if (!name)
 	return -1;
-    memcpy (name, filter, len);
+    strncpy (name, filter, len);
     name[len] = '\0';
     if (filterNames)
 	names = xrealloc (filterNames, (nfilterNames + 1) * sizeof (char *));
@@ -124,9 +120,7 @@
 }
 
 int
-PictureAddFilter (ScreenPtr			    pScreen,
-		  char				    *filter,
-		  PictFilterValidateParamsProcPtr   ValidateParams)
+PictureAddFilter (ScreenPtr pScreen, char *filter, xFixed *params, int nparams)
 {
     PictureScreenPtr    ps = GetPictureScreen(pScreen);
     int			id = PictureGetFilterId (filter, -1,  TRUE);
@@ -150,8 +144,9 @@
     ps->filters = filters;
     i = ps->nfilters++;
     ps->filters[i].name = PictureGetFilterName (id);
+    ps->filters[i].params = params;
+    ps->filters[i].nparams = nparams;
     ps->filters[i].id = id;
-    ps->filters[i].ValidateParams = ValidateParams;
     return id;
 }
 
@@ -218,12 +213,11 @@
     if (!filterNames)
 	if (!PictureSetDefaultIds ())
 	    return FALSE;
-
-    if (PictureAddFilter (pScreen, FilterNearest, 0) < 0)
+    if (PictureAddFilter (pScreen, FilterNearest, 0, 0) < 0)
 	return FALSE;
-    if (PictureAddFilter (pScreen, FilterBilinear, 0) < 0)
+    if (PictureAddFilter (pScreen, FilterBilinear, 0, 0) < 0)
 	return FALSE;
-    
+
     if (!PictureSetFilterAlias (pScreen, FilterNearest, FilterFast))
 	return FALSE;
     if (!PictureSetFilterAlias (pScreen, FilterBilinear, FilterGood))
@@ -253,25 +247,21 @@
 
     if (!pFilter)
 	return BadName;
-    if (pFilter->ValidateParams)
-    {
-	if (!(*pFilter->ValidateParams) (pPicture, pFilter->id, params, nparams))
-	    return BadMatch;
-    }
-    else if (nparams)
+    if (nparams > pFilter->nparams)
 	return BadMatch;
-
-    if (nparams != pPicture->filter_nparams)
+    if (pFilter->nparams != pPicture->filter_nparams)
     {
-	new_params = xalloc (nparams * sizeof (xFixed));
+	new_params = xalloc (pFilter->nparams * sizeof (xFixed));
 	if (!new_params)
 	    return BadAlloc;
 	xfree (pPicture->filter_params);
 	pPicture->filter_params = new_params;
-	pPicture->filter_nparams = nparams;
+	pPicture->filter_nparams = pFilter->nparams;
     }
     for (i = 0; i < nparams; i++)
 	pPicture->filter_params[i] = params[i];
+    for (; i < pFilter->nparams; i++)
+	pPicture->filter_params[i] = pFilter->params[i];
     pPicture->filter = pFilter->id;
     return Success;
 }

Index: picture.c
===================================================================
RCS file: /cvs/xserver/debrix/render/picture.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- picture.c	10 Jun 2004 19:42:07 -0000	1.3
+++ picture.c	1 Jul 2004 17:49:52 -0000	1.4
@@ -1,5 +1,5 @@
 /*
- * $Id$
+ * $XFree86: xc/programs/Xserver/render/picture.c,v 1.29 2002/11/23 02:38:15 keithp Exp $
  *
  * Copyright © 2000 SuSE, Inc.
  *
@@ -26,6 +26,7 @@
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
+
 #include "misc.h"
 #include "scrnintstr.h"
 #include "os.h"
@@ -370,7 +371,7 @@
 	case PICT_TYPE_COLOR:
 	case PICT_TYPE_GRAY:
 	    pFormats[f].type = PictTypeIndexed;
-	    pFormats[f].index.vid = pScreen->visuals[PICT_FORMAT_VIS(format)].vid;
+	    pFormats[f].index.pVisual = &pScreen->visuals[PICT_FORMAT_VIS(format)];
 	    break;
 	}
     }
@@ -378,21 +379,6 @@
     return pFormats;
 }
 
-static VisualPtr
-PictureFindVisual (ScreenPtr pScreen, VisualID visual)
-{
-    int		i;
-    VisualPtr	pVisual;
-    for (i = 0, pVisual = pScreen->visuals;
-	 i < pScreen->numVisuals;
-	 i++, pVisual++)
-    {
-	if (pVisual->vid == visual)
-	    return pVisual;
-    }
-    return 0;
-}
-
 Bool
 PictureInitIndexedFormats (ScreenPtr pScreen)
 {
@@ -408,16 +394,13 @@
     {
 	if (format->type == PictTypeIndexed && !format->index.pColormap)
 	{
-	    if (format->index.vid == pScreen->rootVisual)
+	    if (format->index.pVisual->vid == pScreen->rootVisual)
 		format->index.pColormap = (ColormapPtr) LookupIDByType(pScreen->defColormap,
 								       RT_COLORMAP);
 	    else
 	    {
-		VisualPtr   pVisual;
-
-		pVisual = PictureFindVisual (pScreen, format->index.vid);
 		if (CreateColormap (FakeClientID (0), pScreen,
-				    pVisual,
+				    format->index.pVisual,
 				    &format->index.pColormap, AllocNone,
 				    0) != Success)
 		{
@@ -501,16 +484,16 @@
 	{
 	    if (type == PictTypeIndexed)
 	    {
-		if (format->index.vid == pVisual->vid)
+		if (format->index.pVisual == pVisual)
 		    return format;
 	    }
 	    else
 	    {
-		if ((unsigned long) format->direct.redMask << format->direct.red == 
+		if (format->direct.redMask << format->direct.red == 
 		    pVisual->redMask &&
-		    (unsigned long) format->direct.greenMask << format->direct.green == 
+		    format->direct.greenMask << format->direct.green == 
 		    pVisual->greenMask &&
-		    (unsigned long) format->direct.blueMask << format->direct.blue == 
+		    format->direct.blueMask << format->direct.blue == 
 		    pVisual->blueMask)
 		{
 		    return format;
@@ -582,7 +565,7 @@
 	    return FALSE;
 	PictureWindowPrivateIndex = AllocateWindowPrivateIndex();
 	PictureGeneration = serverGeneration;
-#ifdef RES
+#ifdef XResExtension
 	RegisterResourceName (PictureType, "PICTURE");
 	RegisterResourceName (PictFormatType, "PICTFORMAT");
 	RegisterResourceName (GlyphSetType, "GLYPHSET");
@@ -606,8 +589,7 @@
 	}
 	if (formats[n].type == PictTypeIndexed)
 	{
-	    VisualPtr	pVisual = PictureFindVisual (pScreen, formats[n].index.vid);
-	    if ((pVisual->class | DynamicClass) == PseudoColor)
+	    if ((formats[n].index.pVisual->class | DynamicClass) == PseudoColor)
 		type = PICT_TYPE_COLOR;
 	    else
 		type = PICT_TYPE_GRAY;
@@ -1031,6 +1013,7 @@
     PictureScreenPtr	ps = GetPictureScreen(pScreen);
     RegionPtr		clientClip;
     int			result;
+
     clientClip = RECTS_TO_REGION(pScreen,
 				 nRect, rects, CT_UNSORTED);
     if (!clientClip)
@@ -1048,50 +1031,6 @@
 }
 
 int
-SetPictureClipRegion (PicturePtr    pPicture,
-		      int	    xOrigin,
-		      int	    yOrigin,
-		      RegionPtr	    pRegion)
-{
-    ScreenPtr		pScreen = pPicture->pDrawable->pScreen;
-    PictureScreenPtr	ps = GetPictureScreen(pScreen);
-    RegionPtr		clientClip;
-    int			result;
-    int			type;
-
-    if (pRegion)
-    {
-	type = CT_REGION;
-	clientClip = REGION_CREATE (pScreen, 
-				    REGION_EXTENTS(pScreen, pRegion),
-				    REGION_NUM_RECTS(pRegion));
-	if (!clientClip)
-	    return BadAlloc;
-	if (!REGION_COPY (pSCreen, clientClip, pRegion))
-	{
-	    REGION_DESTROY (pScreen, clientClip);
-	    return BadAlloc;
-	}
-    }
-    else
-    {
-	type = CT_NONE;
-	clientClip = 0;
-    }
-
-    result =(*ps->ChangePictureClip) (pPicture, type, 
-				      (pointer) clientClip, 0);
-    if (result == Success)
-    {
-	pPicture->clipOrigin.x = xOrigin;
-	pPicture->clipOrigin.y = yOrigin;
-	pPicture->stateChanges |= CPClipXOrigin|CPClipYOrigin|CPClipMask;
-	pPicture->serialNumber |= GC_CHANGE_SERIAL_BIT;
-    }
-    return result;
-}
-
-int
 SetPictureTransform (PicturePtr	    pPicture,
 		     PictTransform  *transform)
 {




More information about the xserver-commit mailing list