2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
#ifdef HAVE_XORG_CONFIG_H
|
|
|
|
#include <xorg-config.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "misc.h"
|
|
|
|
#include "xf86.h"
|
|
|
|
#include "xf86_OSproc.h"
|
|
|
|
|
|
|
|
#include <X11/X.h>
|
|
|
|
#include "scrnintstr.h"
|
|
|
|
#include "windowstr.h"
|
|
|
|
#include "xf86str.h"
|
|
|
|
#include "xaa.h"
|
|
|
|
#include "xaalocal.h"
|
|
|
|
#include "gcstruct.h"
|
|
|
|
#include "pixmapstr.h"
|
|
|
|
#include "xaawrap.h"
|
|
|
|
|
|
|
|
/*
|
|
|
|
Written by Harm Hanemaayer (H.Hanemaayer@inter.nl.net).
|
|
|
|
*/
|
|
|
|
|
2010-07-27 13:02:24 -06:00
|
|
|
void
|
2006-11-26 11:13:41 -07:00
|
|
|
XAACopyWindow(
|
|
|
|
WindowPtr pWin,
|
|
|
|
DDXPointRec ptOldOrg,
|
|
|
|
RegionPtr prgnSrc )
|
|
|
|
{
|
|
|
|
DDXPointPtr pptSrc, ppt;
|
|
|
|
RegionRec rgnDst;
|
|
|
|
BoxPtr pbox;
|
|
|
|
int dx, dy, nbox;
|
|
|
|
WindowPtr pwinRoot;
|
|
|
|
ScreenPtr pScreen = pWin->drawable.pScreen;
|
|
|
|
XAAInfoRecPtr infoRec =
|
|
|
|
GET_XAAINFORECPTR_FROM_DRAWABLE((&pWin->drawable));
|
|
|
|
|
|
|
|
if (!infoRec->pScrn->vtSema || !infoRec->ScreenToScreenBitBlt) {
|
|
|
|
XAA_SCREEN_PROLOGUE (pScreen, CopyWindow);
|
|
|
|
if(infoRec->pScrn->vtSema && infoRec->NeedToSync) {
|
|
|
|
(*infoRec->Sync)(infoRec->pScrn);
|
|
|
|
infoRec->NeedToSync = FALSE;
|
|
|
|
}
|
|
|
|
(*pScreen->CopyWindow) (pWin, ptOldOrg, prgnSrc);
|
|
|
|
XAA_SCREEN_EPILOGUE (pScreen, CopyWindow, XAACopyWindow);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2010-12-05 08:36:02 -07:00
|
|
|
pwinRoot = pScreen->root;
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2010-12-05 08:36:02 -07:00
|
|
|
RegionNull(&rgnDst);
|
2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
dx = ptOldOrg.x - pWin->drawable.x;
|
|
|
|
dy = ptOldOrg.y - pWin->drawable.y;
|
2010-12-05 08:36:02 -07:00
|
|
|
RegionTranslate(prgnSrc, -dx, -dy);
|
|
|
|
RegionIntersect(&rgnDst, &pWin->borderClip, prgnSrc);
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2010-12-05 08:36:02 -07:00
|
|
|
pbox = RegionRects(&rgnDst);
|
|
|
|
nbox = RegionNumRects(&rgnDst);
|
2006-11-26 11:13:41 -07:00
|
|
|
if(!nbox ||
|
2010-12-05 08:36:02 -07:00
|
|
|
!(pptSrc = (DDXPointPtr )malloc(nbox * sizeof(DDXPointRec)))) {
|
|
|
|
RegionUninit(&rgnDst);
|
2006-11-26 11:13:41 -07:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
ppt = pptSrc;
|
|
|
|
|
|
|
|
while(nbox--) {
|
|
|
|
ppt->x = pbox->x1 + dx;
|
|
|
|
ppt->y = pbox->y1 + dy;
|
|
|
|
ppt++; pbox++;
|
|
|
|
}
|
|
|
|
|
|
|
|
infoRec->ScratchGC.planemask = ~0L;
|
|
|
|
infoRec->ScratchGC.alu = GXcopy;
|
|
|
|
|
|
|
|
XAADoBitBlt((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot,
|
|
|
|
&(infoRec->ScratchGC), &rgnDst, pptSrc);
|
|
|
|
|
2010-12-05 08:36:02 -07:00
|
|
|
free(pptSrc);
|
|
|
|
RegionUninit(&rgnDst);
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|