diff options
author | marha <marha@users.sourceforge.net> | 2011-03-15 21:35:41 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-03-15 21:35:41 +0000 |
commit | 5e633abcca598289d0423d89bb400b41e6417259 (patch) | |
tree | 74258f0d1f9f5f2b171d16fd9654a13803216c6f /xorg-server/render/picture.c | |
parent | b5d1fd89898edb34f73679b542c754d837d44cf8 (diff) | |
download | vcxsrv-5e633abcca598289d0423d89bb400b41e6417259.tar.gz vcxsrv-5e633abcca598289d0423d89bb400b41e6417259.tar.bz2 vcxsrv-5e633abcca598289d0423d89bb400b41e6417259.zip |
xserver libX11 libxcb mesa git update 15 Mar 2011
Diffstat (limited to 'xorg-server/render/picture.c')
-rw-r--r-- | xorg-server/render/picture.c | 45 |
1 files changed, 37 insertions, 8 deletions
diff --git a/xorg-server/render/picture.c b/xorg-server/render/picture.c index d31b77466..ed7a1d8f1 100644 --- a/xorg-server/render/picture.c +++ b/xorg-server/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
@@ -1790,11 +1804,26 @@ CompositeTriFan (CARD8 op, int npoints,
xPointFixed *points)
{
- PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen);
+ ScreenPtr pScreen = pDst->pDrawable->pScreen;
+ xTriangle *tris, *tri;
+ xPointFixed *first;
+ int ntri;
- ValidatePicture (pSrc);
- ValidatePicture (pDst);
- (*ps->TriFan) (op, pSrc, pDst, maskFormat, xSrc, ySrc, npoints, points);
+ if (npoints < 3)
+ return;
+ ntri = npoints - 2;
+ tris = malloc(ntri * sizeof (xTriangle));
+ if (!tris)
+ return;
+ first = points++;
+ for (tri = tris; npoints >= 3; npoints--, points++, tri++)
+ {
+ tri->p1 = *first;
+ tri->p2 = points[0];
+ tri->p3 = points[1];
+ }
+ CompositeTriangles (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris);
+ free(tris);
}
void
|