debrix/render animcur.c, 1.2, 1.3 filter.c, 1.2, 1.3 glyph.c, 1.2, 1.3 glyphstr.h, 1.2, 1.3 miglyph.c, 1.2, 1.3 miindex.c, 1.2, 1.3 mipict.c, 1.2, 1.3 mipict.h, 1.2, 1.3 mirect.c, 1.2, 1.3 mitrap.c, 1.2, 1.3 mitri.c, 1.2, 1.3 picture.c, 1.2, 1.3 picture.h, 1.2, 1.3 render.c, 1.2, 1.3

Daniel Stone xserver-commit at pdx.freedesktop.org
Fri Jun 11 05:42:10 EST 2004


Committed by: daniel

Update of /cvs/xserver/debrix/render
In directory pdx:/home/daniel/x/debrix/debrix/render

Modified Files:
	animcur.c filter.c glyph.c glyphstr.h miglyph.c miindex.c 
	mipict.c mipict.h mirect.c mitrap.c mitri.c picture.c 
	picture.h render.c 
Log Message:
Initial import from modular sources.


Index: animcur.c
===================================================================
RCS file: /cvs/xserver/debrix/render/animcur.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- animcur.c	23 Apr 2004 19:54:29 -0000	1.2
+++ animcur.c	10 Jun 2004 19:42:07 -0000	1.3
@@ -32,8 +32,11 @@
  * delta times between each image.
  */
 
-#include "X.h"
-#include "Xmd.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#include <X11/X.h>
+#include <X11/Xmd.h>
 #include "servermd.h"
 #include "scrnintstr.h"
 #include "dixstruct.h"

Index: filter.c
===================================================================
RCS file: /cvs/xserver/debrix/render/filter.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- filter.c	23 Apr 2004 19:54:29 -0000	1.2
+++ filter.c	10 Jun 2004 19:42:07 -0000	1.3
@@ -1,7 +1,7 @@
 /*
- * $XFree86$
+ * $Id$
  *
- * Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc.
+ * Copyright © 2002 Keith Packard
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
@@ -22,6 +22,9 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 #include "misc.h"
 #include "scrnintstr.h"
 #include "os.h"
@@ -40,6 +43,12 @@
 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)
 {
@@ -50,15 +59,14 @@
     if (len < 0)
 	len = strlen (filter);
     for (i = 0; i < nfilterNames; i++)
-	if (len == strlen (filterNames[i]) && 
-	    !strncmp (filterNames[i], filter, len))
+	if (!CompareISOLatin1Lowered (filterNames[i], -1, filter, len))
 	    return i;
     if (!makeit)
 	return -1;
-    name = xalloc (strlen (filter) + 1);
+    name = xalloc (len + 1);
     if (!name)
 	return -1;
-    strncpy (name, filter, len);
+    memcpy (name, filter, len);
     name[len] = '\0';
     if (filterNames)
 	names = xrealloc (filterNames, (nfilterNames + 1) * sizeof (char *));
@@ -116,7 +124,9 @@
 }
 
 int
-PictureAddFilter (ScreenPtr pScreen, char *filter, xFixed *params, int nparams)
+PictureAddFilter (ScreenPtr			    pScreen,
+		  char				    *filter,
+		  PictFilterValidateParamsProcPtr   ValidateParams)
 {
     PictureScreenPtr    ps = GetPictureScreen(pScreen);
     int			id = PictureGetFilterId (filter, -1,  TRUE);
@@ -140,9 +150,8 @@
     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;
 }
 
@@ -209,11 +218,12 @@
     if (!filterNames)
 	if (!PictureSetDefaultIds ())
 	    return FALSE;
-    if (PictureAddFilter (pScreen, FilterNearest, 0, 0) < 0)
+
+    if (PictureAddFilter (pScreen, FilterNearest, 0) < 0)
 	return FALSE;
-    if (PictureAddFilter (pScreen, FilterBilinear, 0, 0) < 0)
+    if (PictureAddFilter (pScreen, FilterBilinear, 0) < 0)
 	return FALSE;
-
+    
     if (!PictureSetFilterAlias (pScreen, FilterNearest, FilterFast))
 	return FALSE;
     if (!PictureSetFilterAlias (pScreen, FilterBilinear, FilterGood))
@@ -243,21 +253,25 @@
 
     if (!pFilter)
 	return BadName;
-    if (nparams > pFilter->nparams)
+    if (pFilter->ValidateParams)
+    {
+	if (!(*pFilter->ValidateParams) (pPicture, pFilter->id, params, nparams))
+	    return BadMatch;
+    }
+    else if (nparams)
 	return BadMatch;
-    if (pFilter->nparams != pPicture->filter_nparams)
+
+    if (nparams != pPicture->filter_nparams)
     {
-	new_params = xalloc (pFilter->nparams * sizeof (xFixed));
+	new_params = xalloc (nparams * sizeof (xFixed));
 	if (!new_params)
 	    return BadAlloc;
 	xfree (pPicture->filter_params);
 	pPicture->filter_params = new_params;
-	pPicture->filter_nparams = pFilter->nparams;
+	pPicture->filter_nparams = 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: glyph.c
===================================================================
RCS file: /cvs/xserver/debrix/render/glyph.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- glyph.c	23 Apr 2004 19:54:29 -0000	1.2
+++ glyph.c	10 Jun 2004 19:42:07 -0000	1.3
@@ -23,6 +23,9 @@
  * Author:  Keith Packard, SuSE, Inc.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 #include "misc.h"
 #include "scrnintstr.h"
 #include "os.h"

Index: glyphstr.h
===================================================================
RCS file: /cvs/xserver/debrix/render/glyphstr.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- glyphstr.h	23 Apr 2004 19:54:29 -0000	1.2
+++ glyphstr.h	10 Jun 2004 19:42:07 -0000	1.3
@@ -23,10 +23,13 @@
  * Author:  Keith Packard, SuSE, Inc.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 #ifndef _GLYPHSTR_H_
 #define _GLYPHSTR_H_
 
-#include "renderproto.h"
+#include <X11/extensions/renderproto.h>
 #include "picture.h"
 #include "screenint.h"
 

Index: miglyph.c
===================================================================
RCS file: /cvs/xserver/debrix/render/miglyph.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- miglyph.c	23 Apr 2004 19:54:29 -0000	1.2
+++ miglyph.c	10 Jun 2004 19:42:07 -0000	1.3
@@ -23,6 +23,9 @@
  * Author:  Keith Packard, SuSE, Inc.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 #include "scrnintstr.h"
 #include "gcstruct.h"
 #include "pixmapstr.h"

Index: miindex.c
===================================================================
RCS file: /cvs/xserver/debrix/render/miindex.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- miindex.c	23 Apr 2004 19:54:29 -0000	1.2
+++ miindex.c	10 Jun 2004 19:42:07 -0000	1.3
@@ -22,6 +22,9 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 #ifndef _MIINDEX_H_
 #define _MIINDEX_H_
 

Index: mipict.c
===================================================================
RCS file: /cvs/xserver/debrix/render/mipict.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- mipict.c	23 Apr 2004 19:54:29 -0000	1.2
+++ mipict.c	10 Jun 2004 19:42:07 -0000	1.3
@@ -22,6 +22,9 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 #include "scrnintstr.h"
 #include "gcstruct.h"
 #include "pixmapstr.h"

Index: mipict.h
===================================================================
RCS file: /cvs/xserver/debrix/render/mipict.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- mipict.h	23 Apr 2004 19:54:29 -0000	1.2
+++ mipict.h	10 Jun 2004 19:42:07 -0000	1.3
@@ -23,6 +23,9 @@
  * Author:  Keith Packard, SuSE, Inc.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 #ifndef _MIPICT_H_
 #define _MIPICT_H_
 

Index: mirect.c
===================================================================
RCS file: /cvs/xserver/debrix/render/mirect.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- mirect.c	23 Apr 2004 19:54:29 -0000	1.2
+++ mirect.c	10 Jun 2004 19:42:07 -0000	1.3
@@ -22,6 +22,9 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 #include "scrnintstr.h"
 #include "gcstruct.h"
 #include "pixmapstr.h"

Index: mitrap.c
===================================================================
RCS file: /cvs/xserver/debrix/render/mitrap.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- mitrap.c	23 Apr 2004 19:54:29 -0000	1.2
+++ mitrap.c	10 Jun 2004 19:42:07 -0000	1.3
@@ -22,6 +22,9 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 #include "scrnintstr.h"
 #include "gcstruct.h"
 #include "pixmapstr.h"

Index: mitri.c
===================================================================
RCS file: /cvs/xserver/debrix/render/mitri.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- mitri.c	23 Apr 2004 19:54:29 -0000	1.2
+++ mitri.c	10 Jun 2004 19:42:07 -0000	1.3
@@ -22,6 +22,9 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 #include "scrnintstr.h"
 #include "gcstruct.h"
 #include "pixmapstr.h"

Index: picture.c
===================================================================
RCS file: /cvs/xserver/debrix/render/picture.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- picture.c	23 Apr 2004 19:54:29 -0000	1.2
+++ picture.c	10 Jun 2004 19:42:07 -0000	1.3
@@ -1,5 +1,5 @@
 /*
- * $XFree86: xc/programs/Xserver/render/picture.c,v 1.29 2002/11/23 02:38:15 keithp Exp $
+ * $Id$
  *
  * Copyright © 2000 SuSE, Inc.
  *
@@ -23,6 +23,9 @@
  * Author:  Keith Packard, SuSE, Inc.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 #include "misc.h"
 #include "scrnintstr.h"
 #include "os.h"
@@ -367,7 +370,7 @@
 	case PICT_TYPE_COLOR:
 	case PICT_TYPE_GRAY:
 	    pFormats[f].type = PictTypeIndexed;
-	    pFormats[f].index.pVisual = &pScreen->visuals[PICT_FORMAT_VIS(format)];
+	    pFormats[f].index.vid = pScreen->visuals[PICT_FORMAT_VIS(format)].vid;
 	    break;
 	}
     }
@@ -375,6 +378,21 @@
     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)
 {
@@ -390,13 +408,16 @@
     {
 	if (format->type == PictTypeIndexed && !format->index.pColormap)
 	{
-	    if (format->index.pVisual->vid == pScreen->rootVisual)
+	    if (format->index.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,
-				    format->index.pVisual,
+				    pVisual,
 				    &format->index.pColormap, AllocNone,
 				    0) != Success)
 		{
@@ -480,16 +501,16 @@
 	{
 	    if (type == PictTypeIndexed)
 	    {
-		if (format->index.pVisual == pVisual)
+		if (format->index.vid == pVisual->vid)
 		    return format;
 	    }
 	    else
 	    {
-		if (format->direct.redMask << format->direct.red == 
+		if ((unsigned long) format->direct.redMask << format->direct.red == 
 		    pVisual->redMask &&
-		    format->direct.greenMask << format->direct.green == 
+		    (unsigned long) format->direct.greenMask << format->direct.green == 
 		    pVisual->greenMask &&
-		    format->direct.blueMask << format->direct.blue == 
+		    (unsigned long) format->direct.blueMask << format->direct.blue == 
 		    pVisual->blueMask)
 		{
 		    return format;
@@ -561,7 +582,7 @@
 	    return FALSE;
 	PictureWindowPrivateIndex = AllocateWindowPrivateIndex();
 	PictureGeneration = serverGeneration;
-#ifdef XResExtension
+#ifdef RES
 	RegisterResourceName (PictureType, "PICTURE");
 	RegisterResourceName (PictFormatType, "PICTFORMAT");
 	RegisterResourceName (GlyphSetType, "GLYPHSET");
@@ -585,7 +606,8 @@
 	}
 	if (formats[n].type == PictTypeIndexed)
 	{
-	    if ((formats[n].index.pVisual->class | DynamicClass) == PseudoColor)
+	    VisualPtr	pVisual = PictureFindVisual (pScreen, formats[n].index.vid);
+	    if ((pVisual->class | DynamicClass) == PseudoColor)
 		type = PICT_TYPE_COLOR;
 	    else
 		type = PICT_TYPE_GRAY;
@@ -1009,7 +1031,6 @@
     PictureScreenPtr	ps = GetPictureScreen(pScreen);
     RegionPtr		clientClip;
     int			result;
-
     clientClip = RECTS_TO_REGION(pScreen,
 				 nRect, rects, CT_UNSORTED);
     if (!clientClip)
@@ -1027,6 +1048,50 @@
 }
 
 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)
 {

Index: picture.h
===================================================================
RCS file: /cvs/xserver/debrix/render/picture.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- picture.h	23 Apr 2004 19:54:29 -0000	1.2
+++ picture.h	10 Jun 2004 19:42:07 -0000	1.3
@@ -23,6 +23,9 @@
  * Author:  Keith Packard, SuSE, Inc.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 #ifndef _PICTURE_H_
 #define _PICTURE_H_
 

Index: render.c
===================================================================
RCS file: /cvs/xserver/debrix/render/render.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- render.c	23 Apr 2004 19:54:29 -0000	1.2
+++ render.c	10 Jun 2004 19:42:07 -0000	1.3
@@ -24,10 +24,13 @@
  * Author:  Keith Packard, SuSE, Inc.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 #define NEED_REPLIES
 #define NEED_EVENTS
-#include "X.h"
-#include "Xproto.h"
+#include <X11/X.h>
+#include <X11/Xproto.h>
 #include "misc.h"
 #include "os.h"
 #include "dixstruct.h"
@@ -38,11 +41,11 @@
 #include "colormapst.h"
 #include "extnsionst.h"
 #include "servermd.h"
-#include "render.h"
-#include "renderproto.h"
+#include <X11/extensions/render.h>
+#include <X11/extensions/renderproto.h>
 #include "picturestr.h"
 #include "glyphstr.h"
-#include "Xfuncproto.h"
+#include <X11/Xfuncproto.h>
 #include "cursorstr.h"
 #ifdef EXTMODULE
 #include "xf86_ansic.h"




More information about the xserver-commit mailing list