diff options
author | Søren Sandmann Pedersen <sandmann@redhat.com> | 2007-06-11 13:26:24 -0400 |
---|---|---|
committer | Søren Sandmann Pedersen <sandmann@redhat.com> | 2007-06-11 14:10:33 -0400 |
commit | d4a034370c8ae71b2cc4fe824ceee58b19624f35 (patch) | |
tree | cd5243644c2ec938ac84f6d88821b7376d29979e /fb | |
parent | 3210902a7334f3d8d6c18a34a3cb3f55803b0043 (diff) |
Split fbSolidFillmmx() into a new FbFillmmx() function. Call that from fbFill().
Diffstat (limited to 'fb')
-rw-r--r-- | fb/fbfill.c | 5 | ||||
-rw-r--r-- | fb/fbmmx.c | 48 | ||||
-rw-r--r-- | fb/fbmmx.h | 8 |
3 files changed, 43 insertions, 18 deletions
diff --git a/fb/fbfill.c b/fb/fbfill.c index 7ef3a70f9..35e4427c6 100644 --- a/fb/fbfill.c +++ b/fb/fbfill.c @@ -49,10 +49,13 @@ fbFill (DrawablePtr pDrawable, case FillSolid: #ifdef USE_MMX if (!pPriv->and && fbHaveMMX()) - if (fbSolidFillmmx (pDrawable, x, y, width, height, pPriv->xor)) { + { + if (fbFillmmx (dst, dstStride, dstBpp, x + dstXoff, y + dstYoff, width, height, pPriv->xor)) + { fbFinishAccess (pDrawable); return; } + } #endif fbSolid (dst + (y + dstYoff) * dstStride, dstStride, diff --git a/fb/fbmmx.c b/fb/fbmmx.c index 7fb4b15d5..6a593ff4a 100644 --- a/fb/fbmmx.c +++ b/fb/fbmmx.c @@ -74,29 +74,23 @@ typedef __m64 mmxdatafield; #endif Bool -fbSolidFillmmx (DrawablePtr pDraw, - int x, - int y, - int width, - int height, - FbBits xor) -{ - FbStride stride; - int bpp; +fbFillmmx (FbBits *bits, + FbStride stride, + int bpp, + int x, + int y, + int width, + int height, + FbBits xor) +{ ullong fill; __m64 vfill; CARD32 byte_width; CARD8 *byte_line; - FbBits *bits; - int xoff, yoff; #ifdef __GNUC__ __m64 v1, v2, v3, v4, v5, v6, v7; #endif - CHECKPOINT(); - - fbGetDrawable(pDraw, bits, stride, bpp, xoff, yoff); - if (bpp == 16 && (xor >> 16 != (xor & 0xffff))) return FALSE; @@ -106,14 +100,14 @@ fbSolidFillmmx (DrawablePtr pDraw, if (bpp == 16) { stride = stride * sizeof (FbBits) / 2; - byte_line = (CARD8 *)(((CARD16 *)bits) + stride * (y + yoff) + (x + xoff)); + byte_line = (CARD8 *)(((CARD16 *)bits) + stride * y + x); byte_width = 2 * width; stride *= 2; } else { stride = stride * sizeof (FbBits) / 4; - byte_line = (CARD8 *)(((CARD32 *)bits) + stride * (y + yoff) + (x + xoff)); + byte_line = (CARD8 *)(((CARD32 *)bits) + stride * y + x); byte_width = 4 * width; stride *= 4; } @@ -208,6 +202,26 @@ fbSolidFillmmx (DrawablePtr pDraw, } Bool +fbSolidFillmmx (DrawablePtr pDraw, + int x, + int y, + int width, + int height, + FbBits xor) +{ + FbStride stride; + int bpp; + FbBits *bits; + int xoff, yoff; + + CHECKPOINT(); + + fbGetDrawable(pDraw, bits, stride, bpp, xoff, yoff); + + return fbFillmmx (bits, stride, bpp, x + xoff, y + yoff, width, height, xor); +} + +Bool fbBltmmx (FbBits *src_bits, FbBits *dst_bits, FbStride src_stride, diff --git a/fb/fbmmx.h b/fb/fbmmx.h index a529526c5..dda395a9a 100644 --- a/fb/fbmmx.h +++ b/fb/fbmmx.h @@ -61,6 +61,14 @@ Bool fbCopyAreammx (DrawablePtr pSrc, int dst_y, int width, int height); +Bool fbFillmmx (FbBits *bits, + FbStride stride, + int bpp, + int x, + int y, + int width, + int height, + FbBits xor); Bool fbSolidFillmmx (DrawablePtr pDraw, int x, int y, |