[xserver-commit] xserver/hw/kdrive/src kaapict.c,1.7,1.8
Eric Anholt
xserver-commit@pdx.freedesktop.org
Fri, 09 Jan 2004 00:40:55 -0800
Committed by: anholt
Update of /cvs/xserver/xserver/hw/kdrive/src
In directory pdx:/home/anholt/xserver/hw/kdrive/src
Modified Files:
kaapict.c
Log Message:
Use the scratch area for Composite when one of src or dst is
in memory.
Index: kaapict.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/kdrive/src/kaapict.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- kaapict.c 8 Jan 2004 08:16:24 -0000 1.7
+++ kaapict.c 9 Jan 2004 08:40:32 -0000 1.8
@@ -408,6 +408,7 @@
int nbox;
int src_off_x, src_off_y, mask_off_x, mask_off_y, dst_off_x, dst_off_y;
PixmapPtr pSrcPix, pMaskPix = NULL, pDstPix;
+ struct _Pixmap scratch;
xDst += pDst->pDrawable->x;
yDst += pDst->pDrawable->y;
@@ -438,7 +439,23 @@
pMaskPix = kaaGetOffscreenPixmap (pMask->pDrawable, &mask_off_x,
&mask_off_y);
pDstPix = kaaGetOffscreenPixmap (pDst->pDrawable, &dst_off_x, &dst_off_y);
- if (!pSrcPix || (pMask && !pMaskPix) || !pDstPix) {
+
+ if (!pDstPix) {
+ REGION_UNINIT(pDst->pDrawable->pScreen, ®ion);
+ return 0;
+ }
+
+ if (!pSrcPix && (!pMask || pMaskPix) && pKaaScr->info->UploadToScratch) {
+ if ((*pKaaScr->info->UploadToScratch) ((PixmapPtr) pSrc->pDrawable,
+ &scratch))
+ pSrcPix = &scratch;
+ } else if (pSrcPix && pMask && !pMaskPix && pKaaScr->info->UploadToScratch) {
+ if ((*pKaaScr->info->UploadToScratch) ((PixmapPtr) pMask->pDrawable,
+ &scratch))
+ pMaskPix = &scratch;
+ }
+
+ if (!pSrcPix || (pMask && !pMaskPix)) {
REGION_UNINIT(pDst->pDrawable->pScreen, ®ion);
return 0;
}