xserver/render filter.c, 1.5, 1.6 picture.c, 1.38, 1.39 render.c,
1.32, 1.33
Keith Packard
xserver-commit at pdx.freedesktop.org
Tue Feb 8 14:32:27 PST 2005
Committed by: keithp
Update of /cvs/xserver/xserver/render
In directory gabe:/tmp/cvs-serv17674/render
Modified Files:
filter.c picture.c render.c
Log Message:
2005-02-08 Keith Packard <keithp at keithp.com>
* render/filter.c: (SetPictureFilter):
* render/picture.c: (SetPictureTransform):
* render/render.c: (PanoramiXRenderSetPictureTransform),
(PanoramiXRenderSetPictureFilter), (PanoramiXRenderTrapezoids),
(PanoramiXRenderTriangles), (PanoramiXRenderTriStrip),
(PanoramiXRenderTriFan), (PanoramiXRenderAddTraps),
(PanoramiXRenderInit):
Change picture serial number on filter and transform change.
Provide Xinerama wrappers for remaining Render drawing requests.
Index: filter.c
===================================================================
RCS file: /cvs/xserver/xserver/render/filter.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- filter.c 26 Jan 2005 10:20:16 -0000 1.5
+++ filter.c 8 Feb 2005 22:32:25 -0000 1.6
@@ -280,7 +280,7 @@
for (i = 0; i < nparams; i++)
pPicture->filter_params[i] = params[i];
pPicture->filter = pFilter->id;
-
+ pPicture->serialNumber |= GC_CHANGE_SERIAL_BIT;
result = (*ps->ChangePictureFilter) (pPicture, pPicture->filter,
params, nparams);
return result;
Index: picture.c
===================================================================
RCS file: /cvs/xserver/xserver/render/picture.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- picture.c 26 Jan 2005 00:20:27 -0000 1.38
+++ picture.c 8 Feb 2005 22:32:25 -0000 1.39
@@ -1128,6 +1128,7 @@
pPicture->transform = 0;
}
}
+ pPicture->serialNumber |= GC_CHANGE_SERIAL_BIT;
result = (*ps->ChangePictureTransform) (pPicture, transform);
return result;
}
Index: render.c
===================================================================
RCS file: /cvs/xserver/xserver/render/render.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- render.c 3 Aug 2004 04:25:31 -0000 1.32
+++ render.c 8 Feb 2005 22:32:25 -0000 1.33
@@ -2434,6 +2434,48 @@
}
static int
+PanoramiXRenderSetPictureTransform (ClientPtr client)
+{
+ REQUEST(xRenderSetPictureTransformReq);
+ int result = Success, j;
+ PanoramiXRes *pict;
+
+ REQUEST_AT_LEAST_SIZE(xRenderSetPictureTransformReq);
+
+ VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityWriteAccess,
+ RenderErrBase + BadPicture);
+
+ FOR_NSCREENS_BACKWARD(j) {
+ stuff->picture = pict->info[j].id;
+ result = (*PanoramiXSaveRenderVector[X_RenderSetPictureTransform]) (client);
+ if(result != Success) break;
+ }
+
+ return (result);
+}
+
+static int
+PanoramiXRenderSetPictureFilter (ClientPtr client)
+{
+ REQUEST(xRenderSetPictureFilterReq);
+ int result = Success, j;
+ PanoramiXRes *pict;
+
+ REQUEST_AT_LEAST_SIZE(xRenderSetPictureFilterReq);
+
+ VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityWriteAccess,
+ RenderErrBase + BadPicture);
+
+ FOR_NSCREENS_BACKWARD(j) {
+ stuff->picture = pict->info[j].id;
+ result = (*PanoramiXSaveRenderVector[X_RenderSetPictureFilter]) (client);
+ if(result != Success) break;
+ }
+
+ return (result);
+}
+
+static int
PanoramiXRenderFreePicture (ClientPtr client)
{
PanoramiXRes *pict;
@@ -2598,6 +2640,234 @@
}
static int
+PanoramiXRenderTrapezoids(ClientPtr client)
+{
+ PanoramiXRes *src, *dst;
+ int result = Success, j;
+ REQUEST(xRenderTrapezoidsReq);
+ char *extra;
+ int extra_len;
+
+ REQUEST_AT_LEAST_SIZE (xRenderTrapezoidsReq);
+
+ VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess,
+ RenderErrBase + BadPicture);
+ VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess,
+ RenderErrBase + BadPicture);
+
+ extra_len = (client->req_len << 2) - sizeof (xRenderTrapezoidsReq);
+
+ if (extra_len &&
+ (extra = (char *) ALLOCATE_LOCAL (extra_len))) {
+ memcpy (extra, stuff + 1, extra_len);
+
+ FOR_NSCREENS_FORWARD(j) {
+ if (j) memcpy (stuff + 1, extra, extra_len);
+ if (dst->u.pict.root) {
+ int x_off = panoramiXdataPtr[j].x;
+ int y_off = panoramiXdataPtr[j].y;
+
+ if(x_off || y_off) {
+ xTrapezoid *trap = (xTrapezoid *) (stuff + 1);
+ int i = extra_len / sizeof (xTrapezoid);
+
+ while (i--) {
+ trap->top -= y_off;
+ trap->bottom -= y_off;
+ trap->left.p1.x -= x_off;
+ trap->left.p1.y -= y_off;
+ trap->left.p2.x -= x_off;
+ trap->left.p2.y -= y_off;
+ trap->right.p1.x -= x_off;
+ trap->right.p1.y -= y_off;
+ trap->right.p2.x -= x_off;
+ trap->right.p2.y -= y_off;
+ trap++;
+ }
+ }
+ }
+
+ stuff->src = src->info[j].id;
+ stuff->dst = dst->info[j].id;
+ result =
+ (*PanoramiXSaveRenderVector[X_RenderTrapezoids]) (client);
+
+ if(result != Success) break;
+ }
+
+ DEALLOCATE_LOCAL(extra);
+ }
+
+ return result;
+}
+
+static int
+PanoramiXRenderTriangles(ClientPtr client)
+{
+ PanoramiXRes *src, *dst;
+ int result = Success, j;
+ REQUEST(xRenderTrianglesReq);
+ char *extra;
+ int extra_len;
+
+ REQUEST_AT_LEAST_SIZE (xRenderTrianglesReq);
+
+ VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess,
+ RenderErrBase + BadPicture);
+ VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess,
+ RenderErrBase + BadPicture);
+
+ extra_len = (client->req_len << 2) - sizeof (xRenderTrianglesReq);
+
+ if (extra_len &&
+ (extra = (char *) ALLOCATE_LOCAL (extra_len))) {
+ memcpy (extra, stuff + 1, extra_len);
+
+ FOR_NSCREENS_FORWARD(j) {
+ if (j) memcpy (stuff + 1, extra, extra_len);
+ if (dst->u.pict.root) {
+ int x_off = panoramiXdataPtr[j].x;
+ int y_off = panoramiXdataPtr[j].y;
+
+ if(x_off || y_off) {
+ xTriangle *tri = (xTriangle *) (stuff + 1);
+ int i = extra_len / sizeof (xTriangle);
+
+ while (i--) {
+ tri->p1.x -= x_off;
+ tri->p1.y -= y_off;
+ tri->p2.x -= x_off;
+ tri->p2.y -= y_off;
+ tri->p3.x -= x_off;
+ tri->p3.y -= y_off;
+ tri++;
+ }
+ }
+ }
+
+ stuff->src = src->info[j].id;
+ stuff->dst = dst->info[j].id;
+ result =
+ (*PanoramiXSaveRenderVector[X_RenderTriangles]) (client);
+
+ if(result != Success) break;
+ }
+
+ DEALLOCATE_LOCAL(extra);
+ }
+
+ return result;
+}
+
+static int
+PanoramiXRenderTriStrip(ClientPtr client)
+{
+ PanoramiXRes *src, *dst;
+ int result = Success, j;
+ REQUEST(xRenderTriStripReq);
+ char *extra;
+ int extra_len;
+
+ REQUEST_AT_LEAST_SIZE (xRenderTriStripReq);
+
+ VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess,
+ RenderErrBase + BadPicture);
+ VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess,
+ RenderErrBase + BadPicture);
+
+ extra_len = (client->req_len << 2) - sizeof (xRenderTriStripReq);
+
+ if (extra_len &&
+ (extra = (char *) ALLOCATE_LOCAL (extra_len))) {
+ memcpy (extra, stuff + 1, extra_len);
+
+ FOR_NSCREENS_FORWARD(j) {
+ if (j) memcpy (stuff + 1, extra, extra_len);
+ if (dst->u.pict.root) {
+ int x_off = panoramiXdataPtr[j].x;
+ int y_off = panoramiXdataPtr[j].y;
+
+ if(x_off || y_off) {
+ xPointFixed *fixed = (xPointFixed *) (stuff + 1);
+ int i = extra_len / sizeof (xPointFixed);
+
+ while (i--) {
+ fixed->x -= x_off;
+ fixed->y -= y_off;
+ fixed++;
+ }
+ }
+ }
+
+ stuff->src = src->info[j].id;
+ stuff->dst = dst->info[j].id;
+ result =
+ (*PanoramiXSaveRenderVector[X_RenderTriStrip]) (client);
+
+ if(result != Success) break;
+ }
+
+ DEALLOCATE_LOCAL(extra);
+ }
+
+ return result;
+}
+
+static int
+PanoramiXRenderTriFan(ClientPtr client)
+{
+ PanoramiXRes *src, *dst;
+ int result = Success, j;
+ REQUEST(xRenderTriFanReq);
+ char *extra;
+ int extra_len;
+
+ REQUEST_AT_LEAST_SIZE (xRenderTriFanReq);
+
+ VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess,
+ RenderErrBase + BadPicture);
+ VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess,
+ RenderErrBase + BadPicture);
+
+ extra_len = (client->req_len << 2) - sizeof (xRenderTriFanReq);
+
+ if (extra_len &&
+ (extra = (char *) ALLOCATE_LOCAL (extra_len))) {
+ memcpy (extra, stuff + 1, extra_len);
+
+ FOR_NSCREENS_FORWARD(j) {
+ if (j) memcpy (stuff + 1, extra, extra_len);
+ if (dst->u.pict.root) {
+ int x_off = panoramiXdataPtr[j].x;
+ int y_off = panoramiXdataPtr[j].y;
+
+ if(x_off || y_off) {
+ xPointFixed *fixed = (xPointFixed *) (stuff + 1);
+ int i = extra_len / sizeof (xPointFixed);
+
+ while (i--) {
+ fixed->x -= x_off;
+ fixed->y -= y_off;
+ fixed++;
+ }
+ }
+ }
+
+ stuff->src = src->info[j].id;
+ stuff->dst = dst->info[j].id;
+ result =
+ (*PanoramiXSaveRenderVector[X_RenderTriFan]) (client);
+
+ if(result != Success) break;
+ }
+
+ DEALLOCATE_LOCAL(extra);
+ }
+
+ return result;
+}
+
+static int
PanoramiXRenderAddTraps (ClientPtr client)
{
PanoramiXRes *picture;
@@ -2615,8 +2885,8 @@
(extra = (char *) ALLOCATE_LOCAL (extra_len)))
{
memcpy (extra, stuff + 1, extra_len);
- x_off = stuff->x_off;
- y_off = stuff->y_off;
+ x_off = stuff->xOff;
+ y_off = stuff->yOff;
FOR_NSCREENS_FORWARD(j) {
if (j) memcpy (stuff + 1, extra, extra_len);
stuff->picture = picture->info[j].id;
@@ -2648,6 +2918,8 @@
*/
ProcRenderVector[X_RenderCreatePicture] = PanoramiXRenderCreatePicture;
ProcRenderVector[X_RenderChangePicture] = PanoramiXRenderChangePicture;
+ ProcRenderVector[X_RenderSetPictureTransform] = PanoramiXRenderSetPictureTransform;
+ ProcRenderVector[X_RenderSetPictureFilter] = PanoramiXRenderSetPictureFilter;
ProcRenderVector[X_RenderSetPictureClipRectangles] = PanoramiXRenderSetPictureClipRectangles;
ProcRenderVector[X_RenderFreePicture] = PanoramiXRenderFreePicture;
ProcRenderVector[X_RenderComposite] = PanoramiXRenderComposite;
@@ -2655,6 +2927,10 @@
ProcRenderVector[X_RenderCompositeGlyphs16] = PanoramiXRenderCompositeGlyphs;
ProcRenderVector[X_RenderCompositeGlyphs32] = PanoramiXRenderCompositeGlyphs;
ProcRenderVector[X_RenderFillRectangles] = PanoramiXRenderFillRectangles;
+ ProcRenderVector[X_RenderTrapezoids] = PanoramiXRenderTrapezoids;
+ ProcRenderVector[X_RenderTriangles] = PanoramiXRenderTriangles;
+ ProcRenderVector[X_RenderTriStrip] = PanoramiXRenderTriStrip;
+ ProcRenderVector[X_RenderTriFan] = PanoramiXRenderTriFan;
ProcRenderVector[X_RenderAddTraps] = PanoramiXRenderAddTraps;
}
More information about the xserver-commit
mailing list