Move xglCreateSolidAlphaPicture

This commit is contained in:
Alan Hourihane 2007-10-23 09:05:50 +01:00
parent 16b9d28c55
commit 57d8fd992f
2 changed files with 44 additions and 47 deletions

View file

@ -474,50 +474,3 @@ xglCloseScreen (int index,
return (*pScreen->CloseScreen) (index, pScreen);
}
#ifdef RENDER
void
xglCreateSolidAlphaPicture (ScreenPtr pScreen)
{
static xRenderColor solidWhite = { 0xffff, 0xffff, 0xffff, 0xffff };
static xRectangle one = { 0, 0, 1, 1 };
PixmapPtr pPixmap;
PictFormatPtr pFormat;
int error;
Pixel pixel;
GCPtr pGC;
XID tmpval[2];
XGL_SCREEN_PRIV (pScreen);
pFormat = PictureMatchFormat (pScreen, 32, PICT_a8r8g8b8);
if (!pFormat)
return;
pGC = GetScratchGC (pFormat->depth, pScreen);
if (!pGC)
return;
pPixmap = (*pScreen->CreatePixmap) (pScreen, 1, 1, pFormat->depth);
if (!pPixmap)
return;
miRenderColorToPixel (pFormat, &solidWhite, &pixel);
tmpval[0] = GXcopy;
tmpval[1] = pixel;
ChangeGC (pGC, GCFunction | GCForeground, tmpval);
ValidateGC (&pPixmap->drawable, pGC);
(*pGC->ops->PolyFillRect) (&pPixmap->drawable, pGC, 1, &one);
FreeScratchGC (pGC);
tmpval[0] = xTrue;
pScreenPriv->pSolidAlpha = CreatePicture (0, &pPixmap->drawable, pFormat,
CPRepeat, tmpval, 0, &error);
(*pScreen->DestroyPixmap) (pPixmap);
if (pScreenPriv->pSolidAlpha)
ValidatePicture (pScreenPriv->pSolidAlpha);
}
#endif

View file

@ -784,4 +784,48 @@ xglPictureClipExtents (PicturePtr pPicture,
}
}
void
xglCreateSolidAlphaPicture (ScreenPtr pScreen)
{
static xRenderColor solidWhite = { 0xffff, 0xffff, 0xffff, 0xffff };
static xRectangle one = { 0, 0, 1, 1 };
PixmapPtr pPixmap;
PictFormatPtr pFormat;
int error;
Pixel pixel;
GCPtr pGC;
XID tmpval[2];
XGL_SCREEN_PRIV (pScreen);
pFormat = PictureMatchFormat (pScreen, 32, PICT_a8r8g8b8);
if (!pFormat)
return;
pGC = GetScratchGC (pFormat->depth, pScreen);
if (!pGC)
return;
pPixmap = (*pScreen->CreatePixmap) (pScreen, 1, 1, pFormat->depth);
if (!pPixmap)
return;
miRenderColorToPixel (pFormat, &solidWhite, &pixel);
tmpval[0] = GXcopy;
tmpval[1] = pixel;
ChangeGC (pGC, GCFunction | GCForeground, tmpval);
ValidateGC (&pPixmap->drawable, pGC);
(*pGC->ops->PolyFillRect) (&pPixmap->drawable, pGC, 1, &one);
FreeScratchGC (pGC);
tmpval[0] = xTrue;
pScreenPriv->pSolidAlpha = CreatePicture (0, &pPixmap->drawable, pFormat,
CPRepeat, tmpval, 0, &error);
(*pScreen->DestroyPixmap) (pPixmap);
if (pScreenPriv->pSolidAlpha)
ValidatePicture (pScreenPriv->pSolidAlpha);
}
#endif