diff options
author | Jamey Sharp <jamey@minilop.net> | 2010-05-23 10:11:47 -0700 |
---|---|---|
committer | Jamey Sharp <jamey@minilop.net> | 2010-06-03 14:03:23 -0700 |
commit | a83cff9f4d622b069c96a68b4e87a669bf1f6446 (patch) | |
tree | b29de5e363feb6b7546ce69dfa0685316bf0b234 /Xext/panoramiX.c | |
parent | 217ccaa5a341018457f468a774c035c0df47d918 (diff) |
Move each screen's x/y origin into ScreenRec.
Many references to the dixScreenOrigins array already had the
corresponding screen pointer handy, which meant they usually looked like
"dixScreenOrigins[pScreen->myNum]". Adding a field to ScreenRec instead
of keeping this information in a parallel array simplifies those
expressions, and eliminates a MAXSCREENS-sized array.
Since dix declared the dixScreenOrigins array, I figure allocating a
screen private for these values is overkill.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (i686 GNU/Linux)
Diffstat (limited to 'Xext/panoramiX.c')
-rw-r--r-- | Xext/panoramiX.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c index 5f0e97efc..b87da247d 100644 --- a/Xext/panoramiX.c +++ b/Xext/panoramiX.c @@ -198,8 +198,8 @@ XineramaValidateGC( if((pDraw->type == DRAWABLE_WINDOW) && !(((WindowPtr)pDraw)->parent)) { /* the root window */ - int x_off = dixScreenOrigins[pGC->pScreen->myNum].x; - int y_off = dixScreenOrigins[pGC->pScreen->myNum].y; + int x_off = pGC->pScreen->x; + int y_off = pGC->pScreen->y; int new_val; new_val = pGCPriv->clipOrg.x - x_off; @@ -395,9 +395,9 @@ static void XineramaInitData(ScreenPtr pScreen) pScreen = screenInfo.screens[i]; - TheBox.x1 = dixScreenOrigins[i].x; + TheBox.x1 = pScreen->x; TheBox.x2 = TheBox.x1 + pScreen->width; - TheBox.y1 = dixScreenOrigins[i].y; + TheBox.y1 = pScreen->y; TheBox.y2 = TheBox.y1 + pScreen->height; REGION_INIT(pScreen, &XineramaScreenRegions[i], &TheBox, 1); @@ -405,13 +405,13 @@ static void XineramaInitData(ScreenPtr pScreen) &XineramaScreenRegions[i]); } - PanoramiXPixWidth = dixScreenOrigins[0].x + screenInfo.screens[0]->width; - PanoramiXPixHeight = dixScreenOrigins[0].y + screenInfo.screens[0]->height; + PanoramiXPixWidth = screenInfo.screens[0]->x + screenInfo.screens[0]->width; + PanoramiXPixHeight = screenInfo.screens[0]->y + screenInfo.screens[0]->height; for (i = 1; i < PanoramiXNumScreens; i++) { pScreen = screenInfo.screens[i]; - w = dixScreenOrigins[i].x + pScreen->width; - h = dixScreenOrigins[i].y + pScreen->height; + w = pScreen->x + pScreen->width; + h = pScreen->y + pScreen->height; if (PanoramiXPixWidth < w) PanoramiXPixWidth = w; @@ -1060,8 +1060,8 @@ ProcXineramaQueryScreens(ClientPtr client) int i; for(i = 0; i < PanoramiXNumScreens; i++) { - scratch.x_org = dixScreenOrigins[i].x; - scratch.y_org = dixScreenOrigins[i].y; + scratch.x_org = screenInfo.screens[i]->x; + scratch.y_org = screenInfo.screens[i]->y; scratch.width = screenInfo.screens[i]->width; scratch.height = screenInfo.screens[i]->height; @@ -1153,8 +1153,8 @@ XineramaGetImageData( SrcBox.x1 = left; SrcBox.y1 = top; if(!isRoot) { - SrcBox.x1 += pDraw->x + dixScreenOrigins[0].x; - SrcBox.y1 += pDraw->y + dixScreenOrigins[0].y; + SrcBox.x1 += pDraw->x + screenInfo.screens[0]->x; + SrcBox.y1 += pDraw->y + screenInfo.screens[0]->y; } SrcBox.x2 = SrcBox.x1 + width; SrcBox.y2 = SrcBox.y1 + height; @@ -1171,8 +1171,8 @@ XineramaGetImageData( if(inOut == rgnIN) { (*pDraw->pScreen->GetImage)(pDraw, - SrcBox.x1 - pDraw->x - dixScreenOrigins[i].x, - SrcBox.y1 - pDraw->y - dixScreenOrigins[i].y, + SrcBox.x1 - pDraw->x - screenInfo.screens[i]->x, + SrcBox.y1 - pDraw->y - screenInfo.screens[i]->y, width, height, format, planemask, data); break; } else if (inOut == rgnOUT) @@ -1203,8 +1203,8 @@ XineramaGetImageData( } } - x = pbox->x1 - pDraw->x - dixScreenOrigins[i].x; - y = pbox->y1 - pDraw->y - dixScreenOrigins[i].y; + x = pbox->x1 - pDraw->x - screenInfo.screens[i]->x; + y = pbox->y1 - pDraw->y - screenInfo.screens[i]->y; (*pDraw->pScreen->GetImage)(pDraw, x, y, w, h, format, planemask, ScratchMem); |