[PATCH] Pass filter kernel size through transforms

Keith Packard keithp at keithp.com
Fri Nov 14 14:12:36 PST 2008


---
 randr/randrstr.h |    2 ++
 randr/rrcrtc.c   |   28 ++++++++++++++++++----------
 2 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/randr/randrstr.h b/randr/randrstr.h
index cdaebe9..17d0a8b 100644
--- a/randr/randrstr.h
+++ b/randr/randrstr.h
@@ -111,6 +111,8 @@ struct _rrTransform {
     PictFilterPtr   filter;
     xFixed	    *params;
     int		    nparams;
+    int		    width;
+    int		    height;
 };
 
 struct _rrCrtc {
diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index bae17c5..b715884 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -62,7 +62,9 @@ static Bool
 RRTransformSetFilter (RRTransformPtr	dst,
 		      PictFilterPtr	filter,
 		      xFixed		*params,
-		      int		nparams)
+		      int		nparams,
+		      int		width,
+		      int		height)
 {
     xFixed  *new_params;
 
@@ -80,6 +82,8 @@ RRTransformSetFilter (RRTransformPtr	dst,
     dst->filter = filter;
     dst->params = new_params;
     dst->nparams = nparams;
+    dst->width = width;
+    dst->height = height;
     return TRUE;
 }
 
@@ -87,7 +91,7 @@ static Bool
 RRTransformCopy (RRTransformPtr dst, RRTransformPtr src)
 {
     if (!RRTransformSetFilter (dst, src->filter,
-			       src->params, src->nparams))
+			       src->params, src->nparams, src->width, src->height))
 	return FALSE;
     dst->transform = src->transform;
     dst->inverse = src->inverse;
@@ -602,6 +606,7 @@ RRCrtcTransformSet (RRCrtcPtr		crtc,
 		    int			nparams)
 {
     PictFilterPtr   filter = NULL;
+    int		    width = 0, height = 0;
 
     if (!PictureTransformIsInverse (transform, inverse))
 	return BadMatch;
@@ -615,9 +620,13 @@ RRCrtcTransformSet (RRCrtcPtr		crtc,
 	if (filter->ValidateParams)
 	{
 	    if (!filter->ValidateParams (crtc->pScreen, filter->id,
-					 params, nparams))
+					 params, nparams, &width, &height))
 		return BadMatch;
 	}
+	else {
+	    width = filter->width;
+	    height = filter->height;
+	}
     }
     else
     {
@@ -625,7 +634,7 @@ RRCrtcTransformSet (RRCrtcPtr		crtc,
 	    return BadMatch;
     }
     if (!RRTransformSetFilter (&crtc->client_pending_transform,
-			       filter, params, nparams))
+			       filter, params, nparams, width, height))
 	return BadAlloc;
 
     crtc->client_pending_transform.transform = *transform;
@@ -1037,12 +1046,11 @@ ProcRRSetCrtcConfig (ClientPtr client)
 	    int	source_height;
 	    PictTransform transform, inverse;
 
-	    if (!RRComputeTransform (mode, stuff->rotation,
-				     stuff->x, stuff->y,
-				     &crtc->client_pending_transform.transform,
-				     &crtc->client_pending_transform.inverse,
-				     &transform, &inverse))
-		return BadMatch;
+	    RRComputeTransform (mode, stuff->rotation,
+				stuff->x, stuff->y,
+				&crtc->client_pending_transform.transform,
+				&crtc->client_pending_transform.inverse,
+				&transform, &inverse);
 
 	    RRModeGetScanoutSize (mode, &transform, &source_width, &source_height);
 	    if (stuff->x + source_width > pScreen->width)
-- 
1.5.6.5




More information about the xorg mailing list