aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/fb/fbline.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-03-23 10:05:55 +0100
committermarha <marha@users.sourceforge.net>2012-03-23 10:05:55 +0100
commit0f834b91a4768673833ab4917e87d86c237bb1a6 (patch)
tree363489504ed4b2d360259b8de4c9e392918e5d02 /xorg-server/fb/fbline.c
parentfc72edebf875378459368c5383d9023730cbca54 (diff)
downloadvcxsrv-0f834b91a4768673833ab4917e87d86c237bb1a6.tar.gz
vcxsrv-0f834b91a4768673833ab4917e87d86c237bb1a6.tar.bz2
vcxsrv-0f834b91a4768673833ab4917e87d86c237bb1a6.zip
libX11 xserver fontconfig mesa pixman xkbcomp xkeyboard-config git update
23 Mar 2012
Diffstat (limited to 'xorg-server/fb/fbline.c')
-rw-r--r--xorg-server/fb/fbline.c184
1 files changed, 86 insertions, 98 deletions
diff --git a/xorg-server/fb/fbline.c b/xorg-server/fb/fbline.c
index e290bf886..80dc89dde 100644
--- a/xorg-server/fb/fbline.c
+++ b/xorg-server/fb/fbline.c
@@ -27,141 +27,129 @@
#include "fb.h"
void
-fbZeroLine (DrawablePtr pDrawable,
- GCPtr pGC,
- int mode,
- int npt,
- DDXPointPtr ppt)
+fbZeroLine(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, DDXPointPtr ppt)
{
- int x1, y1, x2, y2;
- int x, y;
- int dashOffset;
+ int x1, y1, x2, y2;
+ int x, y;
+ int dashOffset;
x = pDrawable->x;
y = pDrawable->y;
x1 = ppt->x;
y1 = ppt->y;
dashOffset = pGC->dashOffset;
- while (--npt)
- {
- ++ppt;
- x2 = ppt->x;
- y2 = ppt->y;
- if (mode == CoordModePrevious)
- {
- x2 += x1;
- y2 += y1;
- }
- fbSegment (pDrawable, pGC, x1 + x, y1 + y,
- x2 + x, y2 + y,
- npt == 1 && pGC->capStyle != CapNotLast,
- &dashOffset);
- x1 = x2;
- y1 = y2;
+ while (--npt) {
+ ++ppt;
+ x2 = ppt->x;
+ y2 = ppt->y;
+ if (mode == CoordModePrevious) {
+ x2 += x1;
+ y2 += y1;
+ }
+ fbSegment(pDrawable, pGC, x1 + x, y1 + y,
+ x2 + x, y2 + y,
+ npt == 1 && pGC->capStyle != CapNotLast, &dashOffset);
+ x1 = x2;
+ y1 = y2;
}
}
void
-fbZeroSegment (DrawablePtr pDrawable,
- GCPtr pGC,
- int nseg,
- xSegment *pSegs)
+fbZeroSegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pSegs)
{
- int dashOffset;
- int x, y;
- Bool drawLast = pGC->capStyle != CapNotLast;
-
+ int dashOffset;
+ int x, y;
+ Bool drawLast = pGC->capStyle != CapNotLast;
+
x = pDrawable->x;
y = pDrawable->y;
- while (nseg--)
- {
- dashOffset = pGC->dashOffset;
- fbSegment (pDrawable, pGC,
- pSegs->x1 + x, pSegs->y1 + y,
- pSegs->x2 + x, pSegs->y2 + y,
- drawLast,
- &dashOffset);
- pSegs++;
+ while (nseg--) {
+ dashOffset = pGC->dashOffset;
+ fbSegment(pDrawable, pGC,
+ pSegs->x1 + x, pSegs->y1 + y,
+ pSegs->x2 + x, pSegs->y2 + y, drawLast, &dashOffset);
+ pSegs++;
}
}
void
-fbFixCoordModePrevious (int npt,
- DDXPointPtr ppt)
+fbFixCoordModePrevious(int npt, DDXPointPtr ppt)
{
- int x, y;
+ int x, y;
x = ppt->x;
y = ppt->y;
npt--;
- while (npt--)
- {
- ppt++;
- x = (ppt->x += x);
- y = (ppt->y += y);
+ while (npt--) {
+ ppt++;
+ x = (ppt->x += x);
+ y = (ppt->y += y);
}
}
void
-fbPolyLine (DrawablePtr pDrawable,
- GCPtr pGC,
- int mode,
- int npt,
- DDXPointPtr ppt)
+fbPolyLine(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, DDXPointPtr ppt)
{
- void (*line) (DrawablePtr, GCPtr, int mode, int npt, DDXPointPtr ppt);
-
- if (pGC->lineWidth == 0)
- {
- line = fbZeroLine;
- if (pGC->fillStyle == FillSolid &&
- pGC->lineStyle == LineSolid &&
- RegionNumRects (fbGetCompositeClip(pGC)) == 1)
- {
- switch (pDrawable->bitsPerPixel) {
- case 8: line = fbPolyline8; break;
- case 16: line = fbPolyline16; break;
- case 24: line = fbPolyline24; break;
- case 32: line = fbPolyline32; break;
- }
- }
+ void (*line) (DrawablePtr, GCPtr, int mode, int npt, DDXPointPtr ppt);
+
+ if (pGC->lineWidth == 0) {
+ line = fbZeroLine;
+ if (pGC->fillStyle == FillSolid &&
+ pGC->lineStyle == LineSolid &&
+ RegionNumRects(fbGetCompositeClip(pGC)) == 1) {
+ switch (pDrawable->bitsPerPixel) {
+ case 8:
+ line = fbPolyline8;
+ break;
+ case 16:
+ line = fbPolyline16;
+ break;
+ case 24:
+ line = fbPolyline24;
+ break;
+ case 32:
+ line = fbPolyline32;
+ break;
+ }
+ }
}
- else
- {
- if (pGC->lineStyle != LineSolid)
- line = miWideDash;
- else
- line = miWideLine;
+ else {
+ if (pGC->lineStyle != LineSolid)
+ line = miWideDash;
+ else
+ line = miWideLine;
}
(*line) (pDrawable, pGC, mode, npt, ppt);
}
void
-fbPolySegment (DrawablePtr pDrawable,
- GCPtr pGC,
- int nseg,
- xSegment *pseg)
+fbPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pseg)
{
- void (*seg) (DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment *pseg);
+ void (*seg) (DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pseg);
- if (pGC->lineWidth == 0)
- {
- seg = fbZeroSegment;
- if (pGC->fillStyle == FillSolid &&
- pGC->lineStyle == LineSolid &&
- RegionNumRects (fbGetCompositeClip(pGC)) == 1)
- {
- switch (pDrawable->bitsPerPixel) {
- case 8: seg = fbPolySegment8; break;
- case 16: seg = fbPolySegment16; break;
- case 24: seg = fbPolySegment24; break;
- case 32: seg = fbPolySegment32; break;
- }
- }
+ if (pGC->lineWidth == 0) {
+ seg = fbZeroSegment;
+ if (pGC->fillStyle == FillSolid &&
+ pGC->lineStyle == LineSolid &&
+ RegionNumRects(fbGetCompositeClip(pGC)) == 1) {
+ switch (pDrawable->bitsPerPixel) {
+ case 8:
+ seg = fbPolySegment8;
+ break;
+ case 16:
+ seg = fbPolySegment16;
+ break;
+ case 24:
+ seg = fbPolySegment24;
+ break;
+ case 32:
+ seg = fbPolySegment32;
+ break;
+ }
+ }
}
- else
- {
- seg = miPolySegment;
+ else {
+ seg = miPolySegment;
}
(*seg) (pDrawable, pGC, nseg, pseg);
}