diff options
Diffstat (limited to 'xorg-server/dbe/midbe.c')
-rw-r--r-- | xorg-server/dbe/midbe.c | 68 |
1 files changed, 31 insertions, 37 deletions
diff --git a/xorg-server/dbe/midbe.c b/xorg-server/dbe/midbe.c index cba386c0b..15ae85b36 100644 --- a/xorg-server/dbe/midbe.c +++ b/xorg-server/dbe/midbe.c @@ -58,14 +58,8 @@ #include <stdio.h>
-static int miDbeWindowPrivPrivKeyIndex;
-static DevPrivateKey miDbeWindowPrivPrivKey = &miDbeWindowPrivPrivKeyIndex;
-static RESTYPE dbeDrawableResType;
-static RESTYPE dbeWindowPrivResType;
-static int dbeScreenPrivKeyIndex;
-static DevPrivateKey dbeScreenPrivKey = &dbeScreenPrivKeyIndex;
-static int dbeWindowPrivKeyIndex;
-static DevPrivateKey dbeWindowPrivKey = &dbeWindowPrivKeyIndex;
+static DevPrivateKeyRec miDbeWindowPrivPrivKeyRec;
+#define miDbeWindowPrivPrivKey (&miDbeWindowPrivPrivKeyRec)
/******************************************************************************
@@ -102,7 +96,7 @@ miDbeGetVisualInfo(ScreenPtr pScreen, XdbeScreenVisualInfo *pScrVisInfo) /* Allocate an array of XdbeVisualInfo items. */
if (!(visInfo = (XdbeVisualInfo *)malloc(count * sizeof(XdbeVisualInfo))))
{
- return(FALSE); /* memory alloc failure */
+ return FALSE; /* memory alloc failure */
}
for (i = 0, k = 0; i < pScreen->numDepths; i++)
@@ -131,7 +125,7 @@ miDbeGetVisualInfo(ScreenPtr pScreen, XdbeScreenVisualInfo *pScrVisInfo) pScrVisInfo->count = count;
pScrVisInfo->visinfo = visInfo;
- return(TRUE); /* success */
+ return TRUE; /* success */
} /* miDbeGetVisualInfo() */
@@ -181,7 +175,7 @@ miDbeAllocBackBufferName(WindowPtr pWin, XID bufId, int swapAction) pDbeWindowPriv->height,
pWin->drawable.depth, 0)))
{
- return(BadAlloc);
+ return BadAlloc;
}
/* Get a back pixmap. */
@@ -191,7 +185,7 @@ miDbeAllocBackBufferName(WindowPtr pWin, XID bufId, int swapAction) pWin->drawable.depth, 0)))
{
(*pScreen->DestroyPixmap)(pDbeWindowPrivPriv->pFrontBuffer);
- return(BadAlloc);
+ return BadAlloc;
}
/* Security creation/labeling check. */
@@ -241,12 +235,12 @@ miDbeAllocBackBufferName(WindowPtr pWin, XID bufId, int swapAction) if (!AddResource(bufId, dbeDrawableResType,
(pointer)pDbeWindowPrivPriv->pBackBuffer))
{
- return(BadAlloc);
+ return BadAlloc;
}
}
- return(Success);
+ return Success;
} /* miDbeAllocBackBufferName() */
@@ -415,7 +409,7 @@ miDbeSwapBuffers(ClientPtr client, int *pNumWindows, DbeSwapInfoPtr swapInfo) FreeScratchGC(pGC);
- return(Success);
+ return Success;
} /* miSwapBuffers() */
@@ -577,13 +571,13 @@ miDbePositionWindow(WindowPtr pWin, int x, int y) if (!(pDbeWindowPriv = DBE_WINDOW_PRIV(pWin)))
{
- return(ret);
+ return ret;
}
if (pDbeWindowPriv->width == pWin->drawable.width &&
pDbeWindowPriv->height == pWin->drawable.height)
{
- return(ret);
+ return ret;
}
width = pWin->drawable.width;
@@ -684,7 +678,7 @@ miDbePositionWindow(WindowPtr pWin, int x, int y) }
FreeScratchGC(pGC);
- return(FALSE);
+ return FALSE;
}
else
@@ -695,25 +689,33 @@ miDbePositionWindow(WindowPtr pWin, int x, int y) pDbeWindowPrivPriv = MI_DBE_WINDOW_PRIV_PRIV(pDbeWindowPriv);
- ValidateGC((DrawablePtr)pFrontBuffer, pGC);
/* I suppose this could avoid quite a bit of work if
* it computed the minimal area required.
*/
+ ValidateGC(&pFrontBuffer->drawable, pGC);
if (clear)
{
(*pGC->ops->PolyFillRect)((DrawablePtr)pFrontBuffer, pGC, 1,
&clearRect);
- (*pGC->ops->PolyFillRect)((DrawablePtr)pBackBuffer , pGC, 1,
- &clearRect);
- }
-
- /* Copy the contents of the old DBE pixmaps to the new pixmaps. */
+ }
+ /* Copy the contents of the old front pixmap to the new one. */
if (pWin->bitGravity != ForgetGravity)
{
(*pGC->ops->CopyArea)((DrawablePtr)pDbeWindowPrivPriv->pFrontBuffer,
(DrawablePtr)pFrontBuffer, pGC, sourcex,
sourcey, savewidth, saveheight, destx, desty);
+ }
+
+ ValidateGC(&pBackBuffer->drawable, pGC);
+ if (clear)
+ {
+ (*pGC->ops->PolyFillRect)((DrawablePtr)pBackBuffer , pGC, 1,
+ &clearRect);
+ }
+ /* Copy the contents of the old back pixmap to the new one. */
+ if (pWin->bitGravity != ForgetGravity)
+ {
(*pGC->ops->CopyArea)((DrawablePtr)pDbeWindowPrivPriv->pBackBuffer,
(DrawablePtr)pBackBuffer, pGC, sourcex,
sourcey, savewidth, saveheight, destx, desty);
@@ -735,7 +737,7 @@ miDbePositionWindow(WindowPtr pWin, int x, int y) FreeScratchGC(pGC);
}
- return(ret);
+ return ret;
} /* miDbePositionWindow() */
@@ -779,17 +781,9 @@ miDbeResetProc(ScreenPtr pScreen) Bool
miDbeInit(ScreenPtr pScreen, DbeScreenPrivPtr pDbeScreenPriv)
{
- /* Copy resource types created by DIX */
- dbeDrawableResType = pDbeScreenPriv->dbeDrawableResType;
- dbeWindowPrivResType = pDbeScreenPriv->dbeWindowPrivResType;
-
- /* Copy private indices created by DIX */
- dbeScreenPrivKey = pDbeScreenPriv->dbeScreenPrivKey;
- dbeWindowPrivKey = pDbeScreenPriv->dbeWindowPrivKey;
-
- if (!dixRequestPrivate(miDbeWindowPrivPrivKey,
- sizeof(MiDbeWindowPrivPrivRec)))
- return(FALSE);
+ if (!dixRegisterPrivateKey(&miDbeWindowPrivPrivKeyRec, PRIVATE_DBE_WINDOW,
+ sizeof(MiDbeWindowPrivPrivRec)))
+ return FALSE;
/* Wrap functions. */
pDbeScreenPriv->PositionWindow = pScreen->PositionWindow;
@@ -804,6 +798,6 @@ miDbeInit(ScreenPtr pScreen, DbeScreenPrivPtr pDbeScreenPriv) pDbeScreenPriv->ResetProc = miDbeResetProc;
pDbeScreenPriv->WinPrivDelete = miDbeWinPrivDelete;
- return(TRUE);
+ return TRUE;
} /* miDbeInit() */
|