summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/vivante_accel.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/src/vivante_accel.c b/src/vivante_accel.c
index f1ff49c..2f5d101 100644
--- a/src/vivante_accel.c
+++ b/src/vivante_accel.c
@@ -789,15 +789,25 @@ Bool vivante_accel_PolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode,
if (!pBox)
return FALSE;
- for (i = 0; i < npt; i++) {
- pBox[i].x1 = ppt[i].x + pDrawable->x;
- pBox[i].y1 = ppt[i].y + pDrawable->y;
- if (i > 0 && mode == CoordModePrevious) {
- pBox[i].x1 += ppt[i - 1].x;
- pBox[i].y1 += ppt[i - 1].y;
+ if (mode == CoordModePrevious) {
+ int x, y;
+
+ x = y = 0;
+ for (i = 0; i < npt; i++) {
+ x += ppt[i].x;
+ y += ppt[i].y;
+ pBox[i].x1 = x + pDrawable->x;
+ pBox[i].y1 = y + pDrawable->y;
+ pBox[i].x2 = pBox[i].x1 + 1;
+ pBox[i].y2 = pBox[i].y1 + 1;
+ }
+ } else {
+ for (i = 0; i < npt; i++) {
+ pBox[i].x1 = ppt[i].x + pDrawable->x;
+ pBox[i].y1 = ppt[i].y + pDrawable->y;
+ pBox[i].x2 = pBox[i].x1 + 1;
+ pBox[i].y2 = pBox[i].y1 + 1;
}
- pBox[i].x2 = pBox[i].x1 + 1;
- pBox[i].y2 = pBox[i].y1 + 1;
}
/* Convert the boxes to a region */