Add fbCompositeRect() as another special case in the switch of doom in fbpict.c
This is phase one of getting the two region walkers in fbcompose.c and fbpict.c merged together.
This commit is contained in:
parent
c1e1d6b98a
commit
e0959adcd8
|
@ -4027,7 +4027,7 @@ static void fbStoreExternalAlpha(PicturePtr pict, int x, int y, int width, CARD3
|
||||||
typedef void (*scanStoreProc)(PicturePtr , int , int , int , CARD32 *);
|
typedef void (*scanStoreProc)(PicturePtr , int , int , int , CARD32 *);
|
||||||
typedef void (*scanFetchProc)(PicturePtr , int , int , int , CARD32 * , CARD32 *, CARD32);
|
typedef void (*scanFetchProc)(PicturePtr , int , int , int , CARD32 * , CARD32 *, CARD32);
|
||||||
|
|
||||||
static void
|
void
|
||||||
fbCompositeRect (const FbComposeData *data, CARD32 *scanline_buffer)
|
fbCompositeRect (const FbComposeData *data, CARD32 *scanline_buffer)
|
||||||
{
|
{
|
||||||
CARD32 *src_buffer = scanline_buffer;
|
CARD32 *src_buffer = scanline_buffer;
|
||||||
|
|
66
fb/fbpict.c
66
fb/fbpict.c
|
@ -1018,14 +1018,6 @@ fbCompositeSolidMask_nx1xn (CARD8 op,
|
||||||
FbBits src;
|
FbBits src;
|
||||||
|
|
||||||
fbComposeGetSolid(pSrc, src, pDst->format);
|
fbComposeGetSolid(pSrc, src, pDst->format);
|
||||||
|
|
||||||
if ((src & 0xff000000) != 0xff000000)
|
|
||||||
{
|
|
||||||
fbCompositeGeneral (op, pSrc, pMask, pDst,
|
|
||||||
xSrc, ySrc, xMask, yMask, xDst, yDst,
|
|
||||||
width, height);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
fbGetStipDrawable (pMask->pDrawable, maskBits, maskStride, maskBpp, maskXoff, maskYoff);
|
fbGetStipDrawable (pMask->pDrawable, maskBits, maskStride, maskBpp, maskXoff, maskYoff);
|
||||||
fbGetDrawable (pDst->pDrawable, dstBits, dstStride, dstBpp, dstXoff, dstYoff);
|
fbGetDrawable (pDst->pDrawable, dstBits, dstStride, dstBpp, dstXoff, dstYoff);
|
||||||
|
|
||||||
|
@ -1443,6 +1435,48 @@ fbCompositeSolidSrc_nxn (CARD8 op,
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define SCANLINE_BUFFER_LENGTH 2048
|
||||||
|
|
||||||
|
static void
|
||||||
|
fbCompositeRectWrapper (CARD8 op,
|
||||||
|
PicturePtr pSrc,
|
||||||
|
PicturePtr pMask,
|
||||||
|
PicturePtr pDst,
|
||||||
|
INT16 xSrc,
|
||||||
|
INT16 ySrc,
|
||||||
|
INT16 xMask,
|
||||||
|
INT16 yMask,
|
||||||
|
INT16 xDst,
|
||||||
|
INT16 yDst,
|
||||||
|
CARD16 width,
|
||||||
|
CARD16 height)
|
||||||
|
{
|
||||||
|
CARD32 _scanline_buffer[SCANLINE_BUFFER_LENGTH * 3];
|
||||||
|
CARD32 *scanline_buffer = _scanline_buffer;
|
||||||
|
FbComposeData data;
|
||||||
|
|
||||||
|
data.op = op;
|
||||||
|
data.src = pSrc;
|
||||||
|
data.mask = pMask;
|
||||||
|
data.dest = pDst;
|
||||||
|
data.xSrc = xSrc;
|
||||||
|
data.ySrc = ySrc;
|
||||||
|
data.xMask = xMask;
|
||||||
|
data.yMask = yMask;
|
||||||
|
data.xDest = xDst;
|
||||||
|
data.yDest = yDst;
|
||||||
|
data.width = width;
|
||||||
|
data.height = height;
|
||||||
|
|
||||||
|
if (width > SCANLINE_BUFFER_LENGTH)
|
||||||
|
scanline_buffer = (CARD32 *) malloc(width * 3 * sizeof(CARD32));
|
||||||
|
|
||||||
|
fbCompositeRect (&data, scanline_buffer);
|
||||||
|
|
||||||
|
if (scanline_buffer != _scanline_buffer)
|
||||||
|
free(scanline_buffer);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
fbComposite (CARD8 op,
|
fbComposite (CARD8 op,
|
||||||
PicturePtr pSrc,
|
PicturePtr pSrc,
|
||||||
|
@ -1632,8 +1666,14 @@ fbComposite (CARD8 op,
|
||||||
case PICT_x8r8g8b8:
|
case PICT_x8r8g8b8:
|
||||||
case PICT_a8b8g8r8:
|
case PICT_a8b8g8r8:
|
||||||
case PICT_x8b8g8r8:
|
case PICT_x8b8g8r8:
|
||||||
func = fbCompositeSolidMask_nx1xn;
|
{
|
||||||
|
FbBits src;
|
||||||
|
|
||||||
|
fbComposeGetSolid(pSrc, src, pDst->format);
|
||||||
|
if ((src & 0xff000000) == 0xff000000)
|
||||||
|
func = fbCompositeSolidMask_nx1xn;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1642,7 +1682,7 @@ fbComposite (CARD8 op,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (func != fbCompositeGeneral)
|
if (func)
|
||||||
srcRepeat = FALSE;
|
srcRepeat = FALSE;
|
||||||
}
|
}
|
||||||
else if (!srcRepeat) /* has mask and non-repeating source */
|
else if (!srcRepeat) /* has mask and non-repeating source */
|
||||||
|
@ -1755,7 +1795,7 @@ fbComposite (CARD8 op,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (func != fbCompositeGeneral)
|
if (func)
|
||||||
maskRepeat = FALSE;
|
maskRepeat = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2043,9 +2083,7 @@ fbComposite (CARD8 op,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!func) {
|
if (!func) {
|
||||||
/* no fast path, use the general code */
|
func = fbCompositeRectWrapper;
|
||||||
fbCompositeGeneral(op, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst, yDst, width, height);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if we are transforming, we handle repeats in fbFetchTransformed */
|
/* if we are transforming, we handle repeats in fbFetchTransformed */
|
||||||
|
|
|
@ -383,6 +383,9 @@ typedef struct _FbComposeData {
|
||||||
CARD16 height;
|
CARD16 height;
|
||||||
} FbComposeData;
|
} FbComposeData;
|
||||||
|
|
||||||
|
void
|
||||||
|
fbCompositeRect (const FbComposeData *data, CARD32 *scanline_buffer);
|
||||||
|
|
||||||
typedef FASTCALL void (*CombineMaskU) (CARD32 *src, const CARD32 *mask, int width);
|
typedef FASTCALL void (*CombineMaskU) (CARD32 *src, const CARD32 *mask, int width);
|
||||||
typedef FASTCALL void (*CombineFuncU) (CARD32 *dest, const CARD32 *src, int width);
|
typedef FASTCALL void (*CombineFuncU) (CARD32 *dest, const CARD32 *src, int width);
|
||||||
typedef FASTCALL void (*CombineFuncC) (CARD32 *dest, CARD32 *src, CARD32 *mask, int width);
|
typedef FASTCALL void (*CombineFuncC) (CARD32 *dest, CARD32 *src, CARD32 *mask, int width);
|
||||||
|
|
Loading…
Reference in New Issue