[xserver-commit] xserver/fb fbpict.c,1.19,1.20
Jaymz Julian
xserver-commit@pdx.freedesktop.org
Thu, 18 Dec 2003 09:12:41 -0800
Committed by: jaymz
Update of /cvs/xserver/xserver/fb
In directory pdx:/tmp/cvs-serv20980/fb
Modified Files:
fbpict.c
Log Message:
(attempt #3 - hopefully this time cvs won't hang on me :)
Make fbCompositeSrcSrc_nxn() know about repeating sources, and start
a whitelist check for functions that know this so they can be
incrementally implented.
Index: fbpict.c
===================================================================
RCS file: /cvs/xserver/xserver/fb/fbpict.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- fbpict.c 18 Dec 2003 13:24:35 -0000 1.19
+++ fbpict.c 18 Dec 2003 17:12:38 -0000 1.20
@@ -1314,29 +1314,80 @@
int dstXoff, dstYoff;
int srcBpp;
int dstBpp;
+ // these need to be signed now!
+ int iwidth=width;
+ int iheight=height;
Bool reverse = FALSE;
Bool upsidedown = FALSE;
-
- fbGetDrawable(pSrc->pDrawable,src,srcStride,srcBpp,srcXoff,srcYoff);
- fbGetDrawable(pDst->pDrawable,dst,dstStride,dstBpp,dstXoff,dstYoff);
+ int initialWidth=width;
+ int initialX=xDst;
- fbBlt (src + (ySrc + srcYoff) * srcStride,
- srcStride,
- (xSrc + srcXoff) * srcBpp,
+ // FIXME: this is possibly the worst piece of code I've ever written.
+ // My main objection to it, is that it is incrfedibly slow in a few cases, due to the
+ // call-per-repeat structure of it - the *correct* solution is to implement
+ // repeat into fbBlt(), but that's a nontrivial job, and it's far more
+ // important to get the "requireRepeat" stuff implented functionally
+ // first, *then* make it fast.
+ // -- jj
+ Bool srcRepeat=pSrc->repeat;
+ CARD32 srcHeight=pSrc->pDrawable->height;
+ CARD32 srcWidth=pSrc->pDrawable->width;
- dst + (yDst + dstYoff) * dstStride,
- dstStride,
- (xDst + dstXoff) * dstBpp,
+ fbGetDrawable(pSrc->pDrawable,src,srcStride,srcBpp,srcXoff,srcYoff);
+ fbGetDrawable(pDst->pDrawable,dst,dstStride,dstBpp,dstXoff,dstYoff);
- (width) * dstBpp,
- (height),
+ if(srcRepeat)
+ {
+ xSrc%=srcWidth;
+ ySrc%=srcHeight;
+ }
+
+ while(iheight>0)
+ {
+ int wheight=iheight;
+ if(wheight>(srcHeight-ySrc))
+ wheight=(srcHeight-ySrc);
+ iwidth=initialWidth;
+ xDst=initialX;
+ while(iwidth>0)
+ {
+ int wwidth=iwidth;
+ if(wwidth>(srcWidth-xSrc))
+ wwidth=(srcWidth-xSrc);
- GXcopy,
- FB_ALLONES,
- dstBpp,
+ fbBlt (src + (ySrc + srcYoff) * srcStride,
+ srcStride,
+ (xSrc + srcXoff) * srcBpp,
- reverse,
- upsidedown);
+ dst + (yDst + dstYoff) * dstStride,
+ dstStride,
+ (xDst + dstXoff) * dstBpp,
+
+ (wwidth) * dstBpp,
+ (wheight),
+
+ GXcopy,
+ FB_ALLONES,
+ dstBpp,
+
+ reverse,
+ upsidedown);
+ if(!srcRepeat)
+ iwidth=0;
+ else
+ {
+ xDst+=wwidth;
+ iwidth-=wwidth;
+ }
+ }
+ if(!srcRepeat)
+ iheight=0;
+ else
+ {
+ yDst+=wheight;
+ iheight-=wheight;
+ }
+ }
}
/*
@@ -1603,6 +1654,13 @@
}
n = REGION_NUM_RECTS (®ion);
pbox = REGION_RECTS (®ion);
+ // FIXME: this is bascially a "white list" of composites that work
+ // with repeat until they are all implented. Once that's done, we
+ // remove the checks below entirely
+ if(func==fbCompositeSrcSrc_nxn)
+ {
+ srcRepeat=maskRepeat=FALSE;
+ }
while (n--)
{
h = pbox->y2 - pbox->y1;