diff options
author | Russell King <rmk@arm.linux.org.uk> | 2014-09-12 09:33:05 +0100 |
---|---|---|
committer | Russell King <rmk@arm.linux.org.uk> | 2014-09-12 11:01:47 +0100 |
commit | 2e9ef86fd1a03d6f0c54cf05022031e697c6ce81 (patch) | |
tree | 295a6bf51780736201995e2c8412f1aa117616c4 /src | |
parent | 259e827cb942e501a81ec0dcd047bb2bb8d37110 (diff) |
vivante: fix PolyPoint() CoordModePrevious
The PolyPoint() CoordModePrevious implementation was incorrect - it
only accounted for the previous point's relative position, not its
absolute position, leading to rendering errors.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
Diffstat (limited to 'src')
-rw-r--r-- | src/vivante_accel.c | 26 |
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 */ |