diff options
author | marha <marha@users.sourceforge.net> | 2011-10-27 08:37:52 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-10-27 08:37:52 +0200 |
commit | 2a9be4af293f20fa33cc34fbc3b72e2235d91090 (patch) | |
tree | d41608bda1d56be1aa96857dee20e988b53760a3 /xorg-server/render/mipict.c | |
parent | 9d53da0fbb9ae6df9a38ad40df4f53cd28287235 (diff) | |
parent | d662d461634660f5c0f3998b5eb7d7ed3bd5a25f (diff) | |
download | vcxsrv-2a9be4af293f20fa33cc34fbc3b72e2235d91090.tar.gz vcxsrv-2a9be4af293f20fa33cc34fbc3b72e2235d91090.tar.bz2 vcxsrv-2a9be4af293f20fa33cc34fbc3b72e2235d91090.zip |
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'xorg-server/render/mipict.c')
-rw-r--r-- | xorg-server/render/mipict.c | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/xorg-server/render/mipict.c b/xorg-server/render/mipict.c index 61b368472..caa76e396 100644 --- a/xorg-server/render/mipict.c +++ b/xorg-server/render/mipict.c @@ -569,6 +569,64 @@ miRenderPixelToColor (PictFormatPtr format, } } +void +miTriStrip (CARD8 op, + PicturePtr pSrc, + PicturePtr pDst, + PictFormatPtr maskFormat, + INT16 xSrc, + INT16 ySrc, + int npoints, + xPointFixed *points) +{ + xTriangle *tris, *tri; + int ntri; + + 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 +miTriFan (CARD8 op, + PicturePtr pSrc, + PicturePtr pDst, + PictFormatPtr maskFormat, + INT16 xSrc, + INT16 ySrc, + int npoints, + xPointFixed *points) +{ + xTriangle *tris, *tri; + xPointFixed *first; + int ntri; + + 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); +} + Bool miPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats) { @@ -602,5 +660,8 @@ miPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats) ps->AddTraps = 0; /* requires DDX support */ ps->AddTriangles = 0; /* requires DDX support */ + ps->TriStrip = miTriStrip; /* converts call to CompositeTriangles */ + ps->TriFan = miTriFan; + return TRUE; } |