summaryrefslogtreecommitdiff
path: root/cfb/cfbzerarc.c
diff options
context:
space:
mode:
authorKaleb Keithley <kaleb@freedesktop.org>2003-11-14 16:49:22 +0000
committerKaleb Keithley <kaleb@freedesktop.org>2003-11-14 16:49:22 +0000
commitd568221710959cf7d783e6ff0fb80fb43a231124 (patch)
tree8d6f039393294c6ffac8533639afdebe5d68bfc1 /cfb/cfbzerarc.c
parent9508a382f8a9f241dab097d921b6d290c1c3a776 (diff)
XFree86 4.3.0.1
Diffstat (limited to 'cfb/cfbzerarc.c')
-rw-r--r--cfb/cfbzerarc.c99
1 files changed, 99 insertions, 0 deletions
diff --git a/cfb/cfbzerarc.c b/cfb/cfbzerarc.c
index 37b7023d5..c13e37739 100644
--- a/cfb/cfbzerarc.c
+++ b/cfb/cfbzerarc.c
@@ -1,3 +1,4 @@
+/* $XFree86: xc/programs/Xserver/cfb/cfbzerarc.c,v 3.3 2001/12/14 19:59:25 dawes Exp $ */
/************************************************************
Copyright 1989, 1998 The Open Group
@@ -57,6 +58,10 @@ RROP_NAME(cfbZeroArcSS8) (pDraw, pGC, arc)
register int x;
PixelType *addrp;
register PixelType *yorgp, *yorgop;
+#if PSZ == 24
+ int xorg, xorg3, xorgo, xorgo3;
+ register int xtmp;
+#endif
RROP_DECLARE
register int yoffset;
int npwidth, dyoffset;
@@ -71,16 +76,31 @@ RROP_NAME(cfbZeroArcSS8) (pDraw, pGC, arc)
yorgop = addrp + ((info.yorgo + pDraw->y) * npwidth);
info.xorg += pDraw->x;
info.xorgo += pDraw->x;
+#if PSZ == 24
+ xorg = info.xorg;
+ xorg3 = xorg * 3;
+ info.xorg = (info.xorg * 3) >> 2;
+ xorgo = info.xorgo;
+ xorgo3 = xorgo * 3;
+ info.xorgo = (info.xorgo * 3) >> 2;
+#endif
MIARCSETUP();
yoffset = y ? npwidth : 0;
dyoffset = 0;
mask = info.initialMask;
if (!(arc->width & 1))
{
+#if PSZ == 24
+ if (mask & 2)
+ RROP_SOLID24((yorgp + info.xorgo), xorgo);
+ if (mask & 8)
+ RROP_SOLID24((yorgop + info.xorgo), xorgo);
+#else
if (mask & 2)
RROP_SOLID((yorgp + info.xorgo));
if (mask & 8)
RROP_SOLID((yorgop + info.xorgo));
+#endif /* PSZ == 24 */
}
if (!info.end.x || !info.end.y)
{
@@ -90,6 +110,34 @@ RROP_NAME(cfbZeroArcSS8) (pDraw, pGC, arc)
if (do360 && (arc->width == arc->height) && !(arc->width & 1))
{
register int xoffset = npwidth;
+#if PSZ == 24
+ PixelType *yorghb = yorgp + (info.h * npwidth);
+ register int tmp1, tmp2, tmp1_3, tmp2_3;
+
+ tmp1 = xorg + info.h;
+ tmp1_3 = tmp1 * 3;
+ tmp2 = xorg - info.h;
+ tmp2_3 = tmp2 * 3;
+ while (1)
+ {
+ xtmp = (xorg3 + x * 3) >> 2;
+ RROP_SOLID24(yorgp + yoffset + xtmp, xorg + x);
+ RROP_SOLID24(yorgop - yoffset + xtmp, xorg + x);
+ xtmp = (xorg3 - x * 3) >> 2;
+ RROP_SOLID24(yorgp + yoffset + xtmp, xorg - x);
+ RROP_SOLID24(yorgop - yoffset + xtmp, xorg - x);
+ if (a < 0)
+ break;
+ xtmp = (tmp1_3 - y * 3) >> 2;
+ RROP_SOLID24(yorghb - xoffset + xtmp, tmp1 - y);
+ RROP_SOLID24(yorghb + xoffset + xtmp, tmp1 - y);
+ xtmp = (tmp2_3 + y * 3) >> 2;
+ RROP_SOLID24(yorghb - xoffset + xtmp, tmp2 + y);
+ RROP_SOLID24(yorghb + xoffset + xtmp, tmp2 + y);
+ xoffset += npwidth;
+ MIARCCIRCLESTEP(yoffset += npwidth;);
+ }
+#else
PixelType *yorghb = yorgp + (info.h * npwidth) + info.xorg;
PixelType *yorgohb = yorghb - info.h;
@@ -113,6 +161,7 @@ RROP_NAME(cfbZeroArcSS8) (pDraw, pGC, arc)
}
yorgp -= info.xorg;
yorgop -= info.xorg;
+#endif /* PSZ == 24 */
x = info.w;
yoffset = info.h * npwidth;
}
@@ -121,10 +170,19 @@ RROP_NAME(cfbZeroArcSS8) (pDraw, pGC, arc)
while (y < info.h || x < info.w)
{
MIARCOCTANTSHIFT(dyoffset = npwidth;);
+#if PSZ == 24
+ xtmp = (xorg3 + x * 3) >> 2;
+ RROP_SOLID24(yorgp + yoffset + xtmp, xorg + x);
+ RROP_SOLID24(yorgop - yoffset + xtmp, xorg + x);
+ xtmp = (xorgo3 - x * 3) >> 2;
+ RROP_SOLID24(yorgp + yoffset + xtmp, xorgo - x);
+ RROP_SOLID24(yorgop - yoffset + xtmp, xorgo - x);
+#else
RROP_SOLID(yorgp + yoffset + info.xorg + x);
RROP_SOLID(yorgp + yoffset + info.xorgo - x);
RROP_SOLID(yorgop - yoffset + info.xorgo - x);
RROP_SOLID(yorgop - yoffset + info.xorg + x);
+#endif
MIARCSTEP(yoffset += dyoffset;, yoffset += npwidth;);
}
}
@@ -138,6 +196,24 @@ RROP_NAME(cfbZeroArcSS8) (pDraw, pGC, arc)
mask = info.start.mask;
info.start = info.altstart;
}
+#if PSZ == 24
+ if (mask & 1){
+ xtmp = (xorg3 + x * 3) >> 2;
+ RROP_SOLID24(yorgp + yoffset + xtmp, xorg + x);
+ }
+ if (mask & 2){
+ xtmp = (xorgo3 - x * 3) >> 2;
+ RROP_SOLID24(yorgp + yoffset + xtmp, xorgo - x);
+ }
+ if (mask & 4){
+ xtmp = (xorgo3 - x * 3) >> 2;
+ RROP_SOLID24(yorgop - yoffset + xtmp, xorgo - x);
+ }
+ if (mask & 8){
+ xtmp = (xorg3 + x * 3) >> 2;
+ RROP_SOLID24(yorgop - yoffset + xtmp, xorg + x);
+ }
+#else
if (mask & 1)
RROP_SOLID(yorgp + yoffset + info.xorg + x);
if (mask & 2)
@@ -146,6 +222,7 @@ RROP_NAME(cfbZeroArcSS8) (pDraw, pGC, arc)
RROP_SOLID(yorgop - yoffset + info.xorgo - x);
if (mask & 8)
RROP_SOLID(yorgop - yoffset + info.xorg + x);
+#endif /* PSZ == 24 */
if ((x == info.end.x) || (y == info.end.y))
{
mask = info.end.mask;
@@ -156,16 +233,38 @@ RROP_NAME(cfbZeroArcSS8) (pDraw, pGC, arc)
}
if ((x == info.start.x) || (y == info.start.y))
mask = info.start.mask;
+#if PSZ == 24
+ if (mask & 1){
+ xtmp = (xorg3 + x * 3) >> 2;
+ RROP_SOLID24(yorgp + yoffset + xtmp, xorg + x);
+ }
+ if (mask & 4){
+ xtmp = (xorgo3 - x * 3) >> 2;
+ RROP_SOLID24(yorgop - yoffset + xtmp, xorgo - x);
+ }
+#else
if (mask & 1)
RROP_SOLID(yorgp + yoffset + info.xorg + x);
if (mask & 4)
RROP_SOLID(yorgop - yoffset + info.xorgo - x);
+#endif /* PSZ == 24 */
if (arc->height & 1)
{
+#if PSZ == 24
+ if (mask & 2){
+ xtmp = (xorgo3 - x * 3) >> 2;
+ RROP_SOLID24(yorgp + yoffset + xtmp, xorgo - x);
+ }
+ if (mask & 8){
+ xtmp = (xorg3 + x * 3) >> 2;
+ RROP_SOLID24(yorgop - yoffset + xtmp, xorg + x);
+ }
+#else
if (mask & 2)
RROP_SOLID(yorgp + yoffset + info.xorgo - x);
if (mask & 8)
RROP_SOLID(yorgop - yoffset + info.xorg + x);
+#endif /* PSZ == 24 */
}
}