If a window background is a 1x1 pixmap, read the value out and go to

exaFillRegionSolid rather than sending piles and piles of Copies to the
    hardware.
This commit is contained in:
Eric Anholt 2005-10-12 07:35:20 +00:00
parent fce11fdf03
commit 55efb41f6c
6 changed files with 162 additions and 0 deletions

View File

@ -1220,6 +1220,33 @@ exaFillRegionTiled (DrawablePtr pDrawable,
goto fallback;
}
/* If we're filling with a solid color, grab it out and go to
* FillRegionSolid, saving numerous copies.
*/
if (pDrawable->width == 1 && pDrawable->height == 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);
return;
}
pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff);
if (!pPixmap)
goto fallback;

View File

@ -1220,6 +1220,33 @@ exaFillRegionTiled (DrawablePtr pDrawable,
goto fallback;
}
/* If we're filling with a solid color, grab it out and go to
* FillRegionSolid, saving numerous copies.
*/
if (pDrawable->width == 1 && pDrawable->height == 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);
return;
}
pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff);
if (!pPixmap)
goto fallback;

View File

@ -1220,6 +1220,33 @@ exaFillRegionTiled (DrawablePtr pDrawable,
goto fallback;
}
/* If we're filling with a solid color, grab it out and go to
* FillRegionSolid, saving numerous copies.
*/
if (pDrawable->width == 1 && pDrawable->height == 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);
return;
}
pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff);
if (!pPixmap)
goto fallback;

View File

@ -1220,6 +1220,33 @@ exaFillRegionTiled (DrawablePtr pDrawable,
goto fallback;
}
/* If we're filling with a solid color, grab it out and go to
* FillRegionSolid, saving numerous copies.
*/
if (pDrawable->width == 1 && pDrawable->height == 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);
return;
}
pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff);
if (!pPixmap)
goto fallback;

View File

@ -1220,6 +1220,33 @@ exaFillRegionTiled (DrawablePtr pDrawable,
goto fallback;
}
/* If we're filling with a solid color, grab it out and go to
* FillRegionSolid, saving numerous copies.
*/
if (pDrawable->width == 1 && pDrawable->height == 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);
return;
}
pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff);
if (!pPixmap)
goto fallback;

View File

@ -1220,6 +1220,33 @@ exaFillRegionTiled (DrawablePtr pDrawable,
goto fallback;
}
/* If we're filling with a solid color, grab it out and go to
* FillRegionSolid, saving numerous copies.
*/
if (pDrawable->width == 1 && pDrawable->height == 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);
return;
}
pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff);
if (!pPixmap)
goto fallback;