Lines 573-578
Link Here
|
573 |
} |
573 |
} |
574 |
} |
574 |
} |
|
|
575 |
void |
576 |
miTrapezoids (CARD8 op, |
577 |
PicturePtr pSrc, |
578 |
PicturePtr pDst, |
579 |
PictFormatPtr maskFormat, |
580 |
INT16 xSrc, |
581 |
INT16 ySrc, |
582 |
int ntrap, |
583 |
xTrapezoid *traps) |
584 |
{ |
585 |
ScreenPtr pScreen = pDst->pDrawable->pScreen; |
586 |
PictureScreenPtr ps = GetPictureScreen(pScreen); |
587 |
|
588 |
/* |
589 |
* Check for solid alpha add |
590 |
*/ |
591 |
if (op == PictOpAdd && miIsSolidAlpha (pSrc)) |
592 |
{ |
593 |
for (; ntrap; ntrap--, traps++) |
594 |
(*ps->RasterizeTrapezoid) (pDst, traps, 0, 0); |
595 |
} |
596 |
else if (maskFormat) |
597 |
{ |
598 |
PicturePtr pPicture; |
599 |
BoxRec bounds; |
600 |
INT16 xDst, yDst; |
601 |
INT16 xRel, yRel; |
602 |
|
603 |
xDst = traps[0].left.p1.x >> 16; |
604 |
yDst = traps[0].left.p1.y >> 16; |
605 |
|
606 |
miTrapezoidBounds (ntrap, traps, &bounds); |
607 |
if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2) |
608 |
return; |
609 |
pPicture = miCreateAlphaPicture (pScreen, pDst, maskFormat, |
610 |
bounds.x2 - bounds.x1, |
611 |
bounds.y2 - bounds.y1); |
612 |
if (!pPicture) |
613 |
return; |
614 |
for (; ntrap; ntrap--, traps++) |
615 |
(*ps->RasterizeTrapezoid) (pPicture, traps, |
616 |
-bounds.x1, -bounds.y1); |
617 |
xRel = bounds.x1 + xSrc - xDst; |
618 |
yRel = bounds.y1 + ySrc - yDst; |
619 |
CompositePicture (op, pSrc, pPicture, pDst, |
620 |
xRel, yRel, 0, 0, bounds.x1, bounds.y1, |
621 |
bounds.x2 - bounds.x1, |
622 |
bounds.y2 - bounds.y1); |
623 |
FreePicture (pPicture, 0); |
624 |
} |
625 |
else |
626 |
{ |
627 |
if (pDst->polyEdge == PolyEdgeSharp) |
628 |
maskFormat = PictureMatchFormat (pScreen, 1, PICT_a1); |
629 |
else |
630 |
maskFormat = PictureMatchFormat (pScreen, 8, PICT_a8); |
631 |
for (; ntrap; ntrap--, traps++) |
632 |
miTrapezoids (op, pSrc, pDst, maskFormat, xSrc, ySrc, 1, traps); |
633 |
} |
634 |
} |
635 |
|
575 |
Bool |
636 |
Bool |
576 |
miPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats) |
637 |
miPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats) |
577 |
{ |
638 |
{ |
Lines 599-605
Link Here
|
599 |
ps->Composite = 0; /* requires DDX support */ |
660 |
ps->Composite = 0; /* requires DDX support */ |
600 |
ps->Glyphs = miGlyphs; |
661 |
ps->Glyphs = miGlyphs; |
601 |
ps->CompositeRects = miCompositeRects; |
662 |
ps->CompositeRects = miCompositeRects; |
602 |
ps->Trapezoids = 0; |
663 |
ps->Trapezoids = miTrapezoids; |
603 |
ps->Triangles = 0; |
664 |
ps->Triangles = 0; |
604 |
ps->RasterizeTrapezoid = 0; /* requires DDX support */ |
665 |
ps->RasterizeTrapezoid = 0; /* requires DDX support */ |