summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorEric Anholt <anholt@freebsd.org>2004-01-09 08:40:32 +0000
committerEric Anholt <anholt@freebsd.org>2004-01-09 08:40:32 +0000
commit5d51dfc69cb245f6a1c7b106954a3365524741e2 (patch)
tree41bc0f0cb165d86f3342e9b4a14c3f4bbd21e9d5 /hw
parent6d8001f4688e2149fcdd480401c46c7540680576 (diff)
Use the scratch area for Composite when one of src or dst is in memory.
Diffstat (limited to 'hw')
-rw-r--r--hw/kdrive/src/kaapict.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/hw/kdrive/src/kaapict.c b/hw/kdrive/src/kaapict.c
index d8badbd08..cca0d466e 100644
--- a/hw/kdrive/src/kaapict.c
+++ b/hw/kdrive/src/kaapict.c
@@ -408,6 +408,7 @@ kaaTryDriverComposite(CARD8 op,
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 @@ kaaTryDriverComposite(CARD8 op,
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, &region);
+ 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, &region);
return 0;
}