Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 385669
Collapse All | Expand All

(-)a/fb/fbpict.c (-1 / +1 lines)
Lines 364-370 Link Here
364
    ps->Glyphs = miGlyphs;
364
    ps->Glyphs = miGlyphs;
365
    ps->CompositeRects = miCompositeRects;
365
    ps->CompositeRects = miCompositeRects;
366
    ps->RasterizeTrapezoid = fbRasterizeTrapezoid;
366
    ps->RasterizeTrapezoid = fbRasterizeTrapezoid;
367
    ps->Trapezoids = fbTrapezoids;
367
    ps->Trapezoids = miTrapezoids;
368
    ps->AddTraps = fbAddTraps;
368
    ps->AddTraps = fbAddTraps;
369
    ps->AddTriangles = fbAddTriangles;
369
    ps->AddTriangles = fbAddTriangles;
370
    ps->Triangles = fbTriangles;
370
    ps->Triangles = fbTriangles;
(-)a/render/mipict.c (-1 / +62 lines)
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 */
(-)a/render/mipict.h (+17 lines)
Lines 129-134 Link Here
129
extern _X_EXPORT PicturePtr
130
miCreateAlphaPicture (ScreenPtr	    pScreen,
131
		      PicturePtr    pDst,
132
		      PictFormatPtr pPictFormat,
133
		      CARD16	    width,
134
		      CARD16	    height);
135
136
extern _X_EXPORT void
137
miTrapezoids (CARD8	    op,
138
	      PicturePtr    pSrc,
139
	      PicturePtr    pDst,
140
	      PictFormatPtr maskFormat,
141
	      INT16	    xSrc,
142
	      INT16	    ySrc,
143
	      int	    ntrap,
144
	      xTrapezoid    *traps);
145
129
extern _X_EXPORT Bool
146
extern _X_EXPORT Bool
130
miIsSolidAlpha (PicturePtr pSrc);
147
miIsSolidAlpha (PicturePtr pSrc);
(-)a/render/mitrap.c (+49 lines)
Lines 34-39 Link Here
34
#include "picturestr.h"
34
#include "picturestr.h"
35
#include "mipict.h"
35
#include "mipict.h"
36
PicturePtr
37
miCreateAlphaPicture (ScreenPtr	    pScreen,
38
		      PicturePtr    pDst,
39
		      PictFormatPtr pPictFormat,
40
		      CARD16	    width,
41
		      CARD16	    height)
42
{
43
    PixmapPtr	    pPixmap;
44
    PicturePtr	    pPicture;
45
    GCPtr	    pGC;
46
    int		    error;
47
    xRectangle	    rect;
48
49
    if (width > 32767 || height > 32767)
50
	return 0;
51
52
    if (!pPictFormat)
53
    {
54
	if (pDst->polyEdge == PolyEdgeSharp)
55
	    pPictFormat = PictureMatchFormat (pScreen, 1, PICT_a1);
56
	else
57
	    pPictFormat = PictureMatchFormat (pScreen, 8, PICT_a8);
58
	if (!pPictFormat)
59
	    return 0;
60
    }
61
62
    pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height,
63
					pPictFormat->depth, 0);
64
    if (!pPixmap)
65
	return 0;
66
    pGC = GetScratchGC (pPixmap->drawable.depth, pScreen);
67
    if (!pGC)
68
    {
69
	(*pScreen->DestroyPixmap) (pPixmap);
70
	return 0;
71
    }
72
    ValidateGC (&pPixmap->drawable, pGC);
73
    rect.x = 0;
74
    rect.y = 0;
75
    rect.width = width;
76
    rect.height = height;
77
    (*pGC->ops->PolyFillRect)(&pPixmap->drawable, pGC, 1, &rect);
78
    FreeScratchGC (pGC);
79
    pPicture = CreatePicture (0, &pPixmap->drawable, pPictFormat,
80
			      0, 0, serverClient, &error);
81
    (*pScreen->DestroyPixmap) (pPixmap);
82
    return pPicture;
83
}
84
36
static xFixed
85
static xFixed
37
miLineFixedX (xLineFixed *l, xFixed y, Bool ceil)
86
miLineFixedX (xLineFixed *l, xFixed y, Bool ceil)
38
{
87
{

Return to bug 385669