diff options
author | Søren Sandmann Pedersen <ssp@redhat.com> | 2011-01-11 10:33:57 -0500 |
---|---|---|
committer | Søren Sandmann Pedersen <ssp@l3000.localdomain> | 2011-02-26 13:58:54 -0500 |
commit | 566f1931ee2916269e164e114bffaf2da1d039d1 (patch) | |
tree | b8457dd813e156b98594c477c1ccba823f2d591a /render | |
parent | 788ccb9a8bcf6a4fb4054c507111eec3338fb969 (diff) |
Move miTriangles to fb as fbTriangles()
The fb version simply calls the new pixman_composite_triangles(). This
allows us to get rid of miCreateAlphaPicture().
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Søren Sandmann <ssp@redhat.com>
Diffstat (limited to 'render')
-rw-r--r-- | render/mipict.c | 2 | ||||
-rw-r--r-- | render/mipict.h | 17 | ||||
-rw-r--r-- | render/mitrap.c | 49 | ||||
-rw-r--r-- | render/mitri.c | 59 |
4 files changed, 1 insertions, 126 deletions
diff --git a/render/mipict.c b/render/mipict.c index 46b45b56a..3b7388879 100644 --- a/render/mipict.c +++ b/render/mipict.c @@ -632,7 +632,7 @@ miPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats) ps->Glyphs = miGlyphs; ps->CompositeRects = miCompositeRects; ps->Trapezoids = 0; - ps->Triangles = miTriangles; + ps->Triangles = 0; ps->TriStrip = miTriStrip; ps->TriFan = miTriFan; diff --git a/render/mipict.h b/render/mipict.h index be7b20b82..d1495891e 100644 --- a/render/mipict.h +++ b/render/mipict.h @@ -152,16 +152,6 @@ extern _X_EXPORT void miTriangleBounds (int ntri, xTriangle *tris, BoxPtr bounds); extern _X_EXPORT void -miTriangles (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int ntri, - xTriangle *tris); - -extern _X_EXPORT void miTriStrip (CARD8 op, PicturePtr pSrc, PicturePtr pDst, @@ -181,13 +171,6 @@ miTriFan (CARD8 op, int npoint, xPointFixed *points); -extern _X_EXPORT PicturePtr -miCreateAlphaPicture (ScreenPtr pScreen, - PicturePtr pDst, - PictFormatPtr pPictFormat, - CARD16 width, - CARD16 height); - extern _X_EXPORT Bool miInitIndexed (ScreenPtr pScreen, PictFormatPtr pFormat); diff --git a/render/mitrap.c b/render/mitrap.c index 1f09a1eb9..445f23630 100644 --- a/render/mitrap.c +++ b/render/mitrap.c @@ -34,55 +34,6 @@ #include "picturestr.h" #include "mipict.h" -PicturePtr -miCreateAlphaPicture (ScreenPtr pScreen, - PicturePtr pDst, - PictFormatPtr pPictFormat, - CARD16 width, - CARD16 height) -{ - PixmapPtr pPixmap; - PicturePtr pPicture; - GCPtr pGC; - int error; - xRectangle rect; - - if (width > 32767 || height > 32767) - return 0; - - if (!pPictFormat) - { - if (pDst->polyEdge == PolyEdgeSharp) - pPictFormat = PictureMatchFormat (pScreen, 1, PICT_a1); - else - pPictFormat = PictureMatchFormat (pScreen, 8, PICT_a8); - if (!pPictFormat) - return 0; - } - - pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, - pPictFormat->depth, 0); - if (!pPixmap) - return 0; - pGC = GetScratchGC (pPixmap->drawable.depth, pScreen); - if (!pGC) - { - (*pScreen->DestroyPixmap) (pPixmap); - return 0; - } - ValidateGC (&pPixmap->drawable, pGC); - rect.x = 0; - rect.y = 0; - rect.width = width; - rect.height = height; - (*pGC->ops->PolyFillRect)(&pPixmap->drawable, pGC, 1, &rect); - FreeScratchGC (pGC); - pPicture = CreatePicture (0, &pPixmap->drawable, pPictFormat, - 0, 0, serverClient, &error); - (*pScreen->DestroyPixmap) (pPixmap); - return pPicture; -} - static xFixed miLineFixedX (xLineFixed *l, xFixed y, Bool ceil) { diff --git a/render/mitri.c b/render/mitri.c index a805a717c..b258c2156 100644 --- a/render/mitri.c +++ b/render/mitri.c @@ -68,65 +68,6 @@ miTriangleBounds (int ntri, xTriangle *tris, BoxPtr bounds) } void -miTriangles (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int ntri, - xTriangle *tris) -{ - ScreenPtr pScreen = pDst->pDrawable->pScreen; - PictureScreenPtr ps = GetPictureScreen(pScreen); - - /* - * Check for solid alpha add - */ - if (op == PictOpAdd && miIsSolidAlpha (pSrc)) - { - (*ps->AddTriangles) (pDst, 0, 0, ntri, tris); - } - else if (maskFormat) - { - BoxRec bounds; - PicturePtr pPicture; - INT16 xDst, yDst; - INT16 xRel, yRel; - - xDst = tris[0].p1.x >> 16; - yDst = tris[0].p1.y >> 16; - - miTriangleBounds (ntri, tris, &bounds); - if (bounds.x2 <= bounds.x1 || bounds.y2 <= bounds.y1) - return; - pPicture = miCreateAlphaPicture (pScreen, pDst, maskFormat, - bounds.x2 - bounds.x1, - bounds.y2 - bounds.y1); - if (!pPicture) - return; - (*ps->AddTriangles) (pPicture, -bounds.x1, -bounds.y1, ntri, tris); - - xRel = bounds.x1 + xSrc - xDst; - yRel = bounds.y1 + ySrc - yDst; - CompositePicture (op, pSrc, pPicture, pDst, - xRel, yRel, 0, 0, bounds.x1, bounds.y1, - bounds.x2 - bounds.x1, bounds.y2 - bounds.y1); - FreePicture (pPicture, 0); - } - else - { - if (pDst->polyEdge == PolyEdgeSharp) - maskFormat = PictureMatchFormat (pScreen, 1, PICT_a1); - else - maskFormat = PictureMatchFormat (pScreen, 8, PICT_a8); - - for (; ntri; ntri--, tris++) - miTriangles (op, pSrc, pDst, maskFormat, xSrc, ySrc, 1, tris); - } -} - -void miTriStrip (CARD8 op, PicturePtr pSrc, PicturePtr pDst, |