diff options
author | Adam Jackson <ajax@redhat.com> | 2013-12-17 14:46:38 -0500 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2014-10-27 15:45:38 -0400 |
commit | 7430fdb689678b98ac63f5a8dad13719bac777e0 (patch) | |
tree | 6fcb41598a91d672ea2650757da375400a4a3abd /fb/fbgc.c | |
parent | a1983736853814d34450c0a0de1c4f6ee308423d (diff) |
fb: Remove even/odd stipple slow-pathing
This is clearly meant to be a fast path, but it appears to be a net
loss at this point.
If you really wanted to ricer-tune here, note that the inner loop of
fbBltOne is a bit too complicated for gcc (at least 4.8.2), it doesn't
specialize the loop for the handful of legal values of bitsPerDst, which
means computing at runtime what could have been const-propped.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'fb/fbgc.c')
-rw-r--r-- | fb/fbgc.c | 83 |
1 files changed, 0 insertions, 83 deletions
@@ -110,80 +110,6 @@ fbPadPixmap(PixmapPtr pPixmap) fbFinishAccess(&pPixmap->drawable); } -/* - * Verify that 'bits' repeats every 'len' bits - */ -static Bool -fbBitsRepeat(FbBits bits, int len, int width) -{ - FbBits mask = FbBitsMask(0, len); - FbBits orig = bits & mask; - int i; - - if (width > FB_UNIT) - width = FB_UNIT; - for (i = 0; i < width / len; i++) { - if ((bits & mask) != orig) - return FALSE; - bits = FbScrLeft(bits, len); - } - return TRUE; -} - -/* - * Check whether an entire bitmap line is a repetition of - * the first 'len' bits - */ -static Bool -fbLineRepeat(FbBits * bits, int len, int width) -{ - FbBits first = bits[0]; - - if (!fbBitsRepeat(first, len, width)) - return FALSE; - width = (width + FB_UNIT - 1) >> FB_SHIFT; - bits++; - while (--width) - if (READ(bits) != first) - return FALSE; - return TRUE; -} - -/* - * The even stipple code wants the first FB_UNIT/bpp bits on - * each scanline to represent the entire stipple - */ -static Bool -fbCanEvenStipple(PixmapPtr pStipple, int bpp) -{ - int len = FB_UNIT / bpp; - FbBits *bits; - int stride; - int stip_bpp; - _X_UNUSED int stipXoff, stipYoff; - int h; - - /* can't even stipple 24bpp drawables */ - if ((bpp & (bpp - 1)) != 0) - return FALSE; - /* make sure the stipple width is a multiple of the even stipple width */ - if (pStipple->drawable.width % len != 0) - return FALSE; - fbGetDrawable(&pStipple->drawable, bits, stride, stip_bpp, stipXoff, - stipYoff); - h = pStipple->drawable.height; - /* check to see that the stipple repeats horizontally */ - while (h--) { - if (!fbLineRepeat(bits, len, pStipple->drawable.width)) { - fbFinishAccess(&pStipple->drawable); - return FALSE; - } - bits += stride; - } - fbFinishAccess(&pStipple->drawable); - return TRUE; -} - void fbValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable) { @@ -239,16 +165,7 @@ fbValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable) fbPadPixmap(pGC->tile.pixmap); } if (changes & GCStipple) { - pPriv->evenStipple = FALSE; - if (pGC->stipple) { - - /* can we do an even stipple ?? */ - if (FbEvenStip(pGC->stipple->drawable.width, - pDrawable->bitsPerPixel) && - (fbCanEvenStipple(pGC->stipple, pDrawable->bitsPerPixel))) - pPriv->evenStipple = TRUE; - if (pGC->stipple->drawable.width * pDrawable->bitsPerPixel < FB_UNIT) fbPadPixmap(pGC->stipple); |