diff options
Diffstat (limited to 'render/picture.c')
-rw-r--r-- | render/picture.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/render/picture.c b/render/picture.c index e16163ac7..015d63364 100644 --- a/render/picture.c +++ b/render/picture.c @@ -1773,11 +1773,25 @@ CompositeTriStrip (CARD8 op, int npoints, xPointFixed *points) { - PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen); + ScreenPtr pScreen = pDst->pDrawable->pScreen; + PictureScreenPtr ps = GetPictureScreen(pScreen); + xTriangle *tris, *tri; + int ntri; - ValidatePicture (pSrc); - ValidatePicture (pDst); - (*ps->TriStrip) (op, pSrc, pDst, maskFormat, xSrc, ySrc, npoints, points); + if (npoints < 3) + return; + ntri = npoints - 2; + tris = malloc(ntri * sizeof (xTriangle)); + if (!tris) + return; + for (tri = tris; npoints >= 3; npoints--, points++, tri++) + { + tri->p1 = points[0]; + tri->p2 = points[1]; + tri->p3 = points[2]; + } + CompositeTriangles (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris); + free(tris); } void |