Pull code for getting the (0,0) pixel from a pixmap out to a separate
function, since it gets repeated (with bad error handling, in one case).
This commit is contained in:
parent
01aa209f20
commit
d309054780
|
@ -1,3 +1,12 @@
|
|||
2006-03-14 Eric Anholt <anholt@FreeBSD.org>
|
||||
|
||||
* exa/exa_accel.c: (exaFillRegionTiled):
|
||||
* exa/exa_priv.h:
|
||||
* exa/exa_render.c: (exaTryDriverSolidFill):
|
||||
* exa/exa_unaccel.c: (exaGetPixmapFirstPixel):
|
||||
Pull code for getting the (0,0) pixel from a pixmap out to a separate
|
||||
function, since it gets repeated (with bad error handling, in one case).
|
||||
|
||||
2006-03-14 Kristian Høgsberg <krh@redhat.com>
|
||||
|
||||
* GL/glx/glxdri.c (__glXDRIscreenProbe): Bail out early if screen
|
||||
|
|
|
@ -782,26 +782,7 @@ exaFillRegionTiled (DrawablePtr pDrawable,
|
|||
* FillRegionSolid, saving numerous copies.
|
||||
*/
|
||||
if (tileWidth == 1 && tileHeight == 1) {
|
||||
CARD32 pixel;
|
||||
|
||||
exaDrawableUseMemory(&pTile->drawable);
|
||||
exaPrepareAccess(&pTile->drawable, EXA_PREPARE_SRC);
|
||||
switch (pTile->drawable.bitsPerPixel) {
|
||||
case 8:
|
||||
pixel = *(CARD8 *)(pTile->devPrivate.ptr);
|
||||
break;
|
||||
case 16:
|
||||
pixel = *(CARD16 *)(pTile->devPrivate.ptr);
|
||||
break;
|
||||
case 32:
|
||||
pixel = *(CARD32 *)(pTile->devPrivate.ptr);
|
||||
break;
|
||||
default:
|
||||
exaFinishAccess(&pTile->drawable, EXA_PREPARE_SRC);
|
||||
goto fallback;
|
||||
}
|
||||
exaFinishAccess(&pTile->drawable, EXA_PREPARE_SRC);
|
||||
exaFillRegionSolid(pDrawable, pRegion, pixel);
|
||||
exaFillRegionSolid(pDrawable, pRegion, exaGetPixmapFirstPixel (pTile));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -147,7 +147,7 @@ typedef struct {
|
|||
*/
|
||||
void exaDDXDriverInit (ScreenPtr pScreen);
|
||||
|
||||
/* exaasync.c */
|
||||
/* exa_unaccel.c */
|
||||
void
|
||||
ExaCheckFillSpans (DrawablePtr pDrawable, GCPtr pGC, int nspans,
|
||||
DDXPointPtr ppt, int *pwidth, int fSorted);
|
||||
|
@ -246,6 +246,9 @@ ExaCheckRestoreAreas (PixmapPtr pPixmap,
|
|||
void
|
||||
ExaCheckPaintWindow (WindowPtr pWin, RegionPtr pRegion, int what);
|
||||
|
||||
CARD32
|
||||
exaGetPixmapFirstPixel (PixmapPtr pPixmap);
|
||||
|
||||
/* exa_accel.c */
|
||||
void
|
||||
exaCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc);
|
||||
|
|
|
@ -243,7 +243,9 @@ exaTryDriverSolidFill(PicturePtr pSrc,
|
|||
width, height))
|
||||
return 1;
|
||||
|
||||
exaDrawableUseMemory(pSrc->pDrawable);
|
||||
pSrcPix = exaGetDrawablePixmap (pSrc->pDrawable);
|
||||
pixel = exaGetPixmapFirstPixel (pSrcPix);
|
||||
|
||||
exaDrawableUseScreen(pDst->pDrawable);
|
||||
|
||||
pDstPix = exaGetOffscreenPixmap (pDst->pDrawable, &dst_off_x, &dst_off_y);
|
||||
|
@ -252,27 +254,12 @@ exaTryDriverSolidFill(PicturePtr pSrc,
|
|||
return 0;
|
||||
}
|
||||
|
||||
pSrcPix = exaGetDrawablePixmap (pSrc->pDrawable);
|
||||
|
||||
exaPrepareAccess(&pSrcPix->drawable, EXA_PREPARE_SRC);
|
||||
switch (pSrcPix->drawable.bitsPerPixel) {
|
||||
case 32:
|
||||
pixel = *(CARD32 *)(pSrcPix->devPrivate.ptr);
|
||||
break;
|
||||
case 16:
|
||||
pixel = *(CARD16 *)(pSrcPix->devPrivate.ptr);
|
||||
break;
|
||||
default:
|
||||
pixel = *(CARD8 *)(pSrcPix->devPrivate.ptr);
|
||||
break;
|
||||
}
|
||||
if (!exaGetRGBAFromPixel(pixel, &red, &green, &blue, &alpha,
|
||||
pSrc->format))
|
||||
{
|
||||
REGION_UNINIT(pDst->pDrawable->pScreen, ®ion);
|
||||
return -1;
|
||||
}
|
||||
exaFinishAccess(&pSrcPix->drawable, EXA_PREPARE_SRC);
|
||||
|
||||
exaGetPixelFromRGBA(&pixel, red, green, blue, alpha,
|
||||
pDst->format);
|
||||
|
|
|
@ -326,6 +326,34 @@ ExaCheckComposite (CARD8 op,
|
|||
exaFinishAccess (pDst->pDrawable, EXA_PREPARE_DEST);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the 0,0 pixel of a pixmap. Used for doing solid fills of tiled pixmaps
|
||||
* that happen to be 1x1. Pixmap must be at least 8bpp.
|
||||
*/
|
||||
CARD32
|
||||
exaGetPixmapFirstPixel (PixmapPtr pPixmap)
|
||||
{
|
||||
CARD32 pixel;
|
||||
|
||||
exaDrawableUseMemory(&pPixmap->drawable);
|
||||
|
||||
exaPrepareAccess(&pPixmap->drawable, EXA_PREPARE_SRC);
|
||||
switch (pPixmap->drawable.bitsPerPixel) {
|
||||
case 32:
|
||||
pixel = *(CARD32 *)(pPixmap->devPrivate.ptr);
|
||||
break;
|
||||
case 16:
|
||||
pixel = *(CARD16 *)(pPixmap->devPrivate.ptr);
|
||||
break;
|
||||
default:
|
||||
pixel = *(CARD8 *)(pPixmap->devPrivate.ptr);
|
||||
break;
|
||||
}
|
||||
exaFinishAccess(&pPixmap->drawable, EXA_PREPARE_SRC);
|
||||
|
||||
return pixel;
|
||||
}
|
||||
|
||||
/*
|
||||
* Only need to stall for CopyArea/CopyPlane, but we want to have the chance to
|
||||
* do migration for CopyArea.
|
||||
|
|
Loading…
Reference in New Issue
Block a user