diff options
Diffstat (limited to 'xorg-server/render')
-rw-r--r-- | xorg-server/render/mipict.c | 64 | ||||
-rw-r--r-- | xorg-server/render/mipict.h | 27 | ||||
-rw-r--r-- | xorg-server/render/mitri.c | 64 | ||||
-rw-r--r-- | xorg-server/render/picture.c | 45 | ||||
-rw-r--r-- | xorg-server/render/picturestr.h | 2 |
5 files changed, 54 insertions, 148 deletions
diff --git a/xorg-server/render/mipict.c b/xorg-server/render/mipict.c index b5eeb443d..8445f5c6f 100644 --- a/xorg-server/render/mipict.c +++ b/xorg-server/render/mipict.c @@ -333,12 +333,8 @@ miClipPictureSrc (RegionPtr pRegion, return TRUE;
}
-void
-miCompositeSourceValidate (PicturePtr pPicture,
- INT16 x,
- INT16 y,
- CARD16 width,
- CARD16 height)
+static void
+SourceValidateOnePicture (PicturePtr pPicture)
{
DrawablePtr pDrawable = pPicture->pDrawable;
ScreenPtr pScreen;
@@ -347,50 +343,22 @@ miCompositeSourceValidate (PicturePtr pPicture, return;
pScreen = pDrawable->pScreen;
-
+
if (pScreen->SourceValidate)
{
- if (pPicture->transform)
- {
- xPoint points[4];
- int i;
- int xmin, ymin, xmax, ymax;
-
-#define VectorSet(i,_x,_y) { points[i].x = _x; points[i].y = _y; }
- VectorSet (0, x, y);
- VectorSet (1, x + width, y);
- VectorSet (2, x, y + height);
- VectorSet (3, x + width, y + height);
- xmin = ymin = 32767;
- xmax = ymax = -32737;
- for (i = 0; i < 4; i++)
- {
- PictVector t;
- t.vector[0] = IntToxFixed (points[i].x);
- t.vector[1] = IntToxFixed (points[i].y);
- t.vector[2] = xFixed1;
- if (pixman_transform_point (pPicture->transform, &t))
- {
- int tx = xFixedToInt (t.vector[0]);
- int ty = xFixedToInt (t.vector[1]);
- if (tx < xmin) xmin = tx;
- if (tx > xmax) xmax = tx;
- if (ty < ymin) ymin = ty;
- if (ty > ymax) ymax = ty;
- }
- }
- x = xmin;
- y = ymin;
- width = xmax - xmin;
- height = ymax - ymin;
- }
- x += pPicture->pDrawable->x;
- y += pPicture->pDrawable->y;
- (*pScreen->SourceValidate) (pDrawable, x, y, width, height,
- pPicture->subWindowMode);
+ pScreen->SourceValidate (
+ pDrawable, 0, 0, pDrawable->width, pDrawable->height, pPicture->subWindowMode);
}
}
+void
+miCompositeSourceValidate (PicturePtr pPicture)
+{
+ SourceValidateOnePicture (pPicture);
+ if (pPicture->alphaMap)
+ SourceValidateOnePicture (pPicture->alphaMap);
+}
+
/*
* returns FALSE if the final region is empty. Indistinguishable from
* an allocation failure, but rendering ignores those anyways.
@@ -480,9 +448,9 @@ miComputeCompositeRegion (RegionPtr pRegion, }
- miCompositeSourceValidate (pSrc, xSrc, ySrc, width, height);
+ miCompositeSourceValidate (pSrc);
if (pMask)
- miCompositeSourceValidate (pMask, xMask, yMask, width, height);
+ miCompositeSourceValidate (pMask);
return TRUE;
}
@@ -633,8 +601,6 @@ miPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats) ps->CompositeRects = miCompositeRects;
ps->Trapezoids = 0;
ps->Triangles = 0;
- ps->TriStrip = miTriStrip;
- ps->TriFan = miTriFan;
ps->RasterizeTrapezoid = 0; /* requires DDX support */
ps->AddTraps = 0; /* requires DDX support */
diff --git a/xorg-server/render/mipict.h b/xorg-server/render/mipict.h index 67d239ab7..f2df601e4 100644 --- a/xorg-server/render/mipict.h +++ b/xorg-server/render/mipict.h @@ -81,11 +81,8 @@ miChangePictureFilter (PicturePtr pPicture, int nparams);
extern _X_EXPORT void
-miCompositeSourceValidate (PicturePtr pPicture,
- INT16 x,
- INT16 y,
- CARD16 width,
- CARD16 height);
+miCompositeSourceValidate (PicturePtr pPicture);
+
extern _X_EXPORT Bool
miComputeCompositeRegion (RegionPtr pRegion,
PicturePtr pSrc,
@@ -151,26 +148,6 @@ miPointFixedBounds (int npoint, xPointFixed *points, BoxPtr bounds); extern _X_EXPORT void
miTriangleBounds (int ntri, xTriangle *tris, BoxPtr bounds);
-extern _X_EXPORT void
-miTriStrip (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc,
- INT16 ySrc,
- int npoint,
- xPointFixed *points);
-
-extern _X_EXPORT void
-miTriFan (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc,
- INT16 ySrc,
- int npoint,
- xPointFixed *points);
-
extern _X_EXPORT Bool
miInitIndexed (ScreenPtr pScreen,
PictFormatPtr pFormat);
diff --git a/xorg-server/render/mitri.c b/xorg-server/render/mitri.c index 3ebb1a693..8c5298e25 100644 --- a/xorg-server/render/mitri.c +++ b/xorg-server/render/mitri.c @@ -66,67 +66,3 @@ miTriangleBounds (int ntri, xTriangle *tris, BoxPtr bounds) {
miPointFixedBounds (ntri * 3, (xPointFixed *) tris, bounds);
}
-
-void
-miTriStrip (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc,
- INT16 ySrc,
- int npoint,
- xPointFixed *points)
-{
- ScreenPtr pScreen = pDst->pDrawable->pScreen;
- PictureScreenPtr ps = GetPictureScreen(pScreen);
- xTriangle *tris, *tri;
- int ntri;
-
- if (npoint < 3)
- return;
- ntri = npoint - 2;
- tris = malloc(ntri * sizeof (xTriangle));
- if (!tris)
- return;
- for (tri = tris; npoint >= 3; npoint--, points++, tri++)
- {
- tri->p1 = points[0];
- tri->p2 = points[1];
- tri->p3 = points[2];
- }
- (*ps->Triangles) (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 npoint,
- xPointFixed *points)
-{
- ScreenPtr pScreen = pDst->pDrawable->pScreen;
- PictureScreenPtr ps = GetPictureScreen(pScreen);
- xTriangle *tris, *tri;
- xPointFixed *first;
- int ntri;
-
- if (npoint < 3)
- return;
- ntri = npoint - 2;
- tris = malloc(ntri * sizeof (xTriangle));
- if (!tris)
- return;
- first = points++;
- for (tri = tris; npoint >= 3; npoint--, points++, tri++)
- {
- tri->p1 = *first;
- tri->p2 = points[0];
- tri->p3 = points[1];
- }
- (*ps->Triangles) (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris);
- free(tris);
-}
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
diff --git a/xorg-server/render/picturestr.h b/xorg-server/render/picturestr.h index ee62e6a17..f642bf0df 100644 --- a/xorg-server/render/picturestr.h +++ b/xorg-server/render/picturestr.h @@ -381,8 +381,6 @@ typedef struct _PictureScreen { TrapezoidsProcPtr Trapezoids;
TrianglesProcPtr Triangles;
- TriStripProcPtr TriStrip;
- TriFanProcPtr TriFan;
RasterizeTrapezoidProcPtr RasterizeTrapezoid;
|