summaryrefslogtreecommitdiff
path: root/Xext/panoramiXprocs.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2011-03-09 15:11:42 +1000
committerDave Airlie <airlied@redhat.com>2011-03-10 09:08:56 +1000
commitc48c530e541e201ea1afe2512d85967659ceef84 (patch)
tree612e8e39dc237f3d64dd05aecde16b934c1159e6 /Xext/panoramiXprocs.c
parent628d16a92a7fa556fbb70bf4a4adf57ec05c190b (diff)
panoramiX: macro checking if drawable is root (v2)
this code appears in quite a few places, consolidate it into a macro in a header. v2: align braces with macro just above it, and with lines removed Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'Xext/panoramiXprocs.c')
-rw-r--r--Xext/panoramiXprocs.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c
index d84316895..4ad5489a4 100644
--- a/Xext/panoramiXprocs.c
+++ b/Xext/panoramiXprocs.c
@@ -1334,7 +1334,7 @@ int PanoramiXPolyLine(ClientPtr client)
if (result != Success)
return result;
- isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+ isRoot = IS_ROOT_DRAWABLE(draw);
npoint = bytes_to_int32((client->req_len << 2) - sizeof(xPolyLineReq));
if (npoint > 0){
origPts = malloc(npoint * sizeof(xPoint));
@@ -1394,7 +1394,7 @@ int PanoramiXPolySegment(ClientPtr client)
if (result != Success)
return result;
- isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+ isRoot = IS_ROOT_DRAWABLE(draw);
nsegs = (client->req_len << 2) - sizeof(xPolySegmentReq);
if(nsegs & 4) return BadLength;
@@ -1457,7 +1457,7 @@ int PanoramiXPolyRectangle(ClientPtr client)
if (result != Success)
return result;
- isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+ isRoot = IS_ROOT_DRAWABLE(draw);
nrects = (client->req_len << 2) - sizeof(xPolyRectangleReq);
if(nrects & 4) return BadLength;
@@ -1519,7 +1519,7 @@ int PanoramiXPolyArc(ClientPtr client)
if (result != Success)
return result;
- isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+ isRoot = IS_ROOT_DRAWABLE(draw);
narcs = (client->req_len << 2) - sizeof(xPolyArcReq);
if(narcs % sizeof(xArc)) return BadLength;
@@ -1579,7 +1579,7 @@ int PanoramiXFillPoly(ClientPtr client)
if (result != Success)
return result;
- isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+ isRoot = IS_ROOT_DRAWABLE(draw);
count = bytes_to_int32((client->req_len << 2) - sizeof(xFillPolyReq));
if (count > 0){
@@ -1640,7 +1640,7 @@ int PanoramiXPolyFillRectangle(ClientPtr client)
if (result != Success)
return result;
- isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+ isRoot = IS_ROOT_DRAWABLE(draw);
things = (client->req_len << 2) - sizeof(xPolyFillRectangleReq);
if(things & 4) return BadLength;
@@ -1701,7 +1701,7 @@ int PanoramiXPolyFillArc(ClientPtr client)
if (result != Success)
return result;
- isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+ isRoot = IS_ROOT_DRAWABLE(draw);
narcs = (client->req_len << 2) - sizeof(xPolyFillArcReq);
if (narcs % sizeof(xArc)) return BadLength;
@@ -1761,7 +1761,7 @@ int PanoramiXPutImage(ClientPtr client)
if (result != Success)
return result;
- isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+ isRoot = IS_ROOT_DRAWABLE(draw);
orig_x = stuff->dstX;
orig_y = stuff->dstY;
@@ -1824,7 +1824,7 @@ int PanoramiXGetImage(ClientPtr client)
format = stuff->format;
planemask = stuff->planeMask;
- isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+ isRoot = IS_ROOT_DRAWABLE(draw);
if(isRoot) {
if( /* check for being onscreen */
@@ -1962,7 +1962,7 @@ PanoramiXPolyText8(ClientPtr client)
if (result != Success)
return result;
- isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+ isRoot = IS_ROOT_DRAWABLE(draw);
orig_x = stuff->x;
orig_y = stuff->y;
@@ -2003,7 +2003,7 @@ PanoramiXPolyText16(ClientPtr client)
if (result != Success)
return result;
- isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+ isRoot = IS_ROOT_DRAWABLE(draw);
orig_x = stuff->x;
orig_y = stuff->y;
@@ -2044,7 +2044,7 @@ int PanoramiXImageText8(ClientPtr client)
if (result != Success)
return result;
- isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+ isRoot = IS_ROOT_DRAWABLE(draw);
orig_x = stuff->x;
orig_y = stuff->y;
@@ -2085,7 +2085,7 @@ int PanoramiXImageText16(ClientPtr client)
if (result != Success)
return result;
- isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+ isRoot = IS_ROOT_DRAWABLE(draw);
orig_x = stuff->x;
orig_y = stuff->y;