Commit 0803918e authored by Adam Jackson's avatar Adam Jackson

fb: Remove 24bpp support (v3)

v2:
- Require power-of-two bpp in ScreenInit
- Eliminate fbCreatePixmapBpp

v3
- Squash in the exa and glamor changes so we can remove pRotatedPixmap
  in the same stroke.
Reviewed-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
parent e33be78e
......@@ -505,29 +505,14 @@ exaValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
ExaScreenPriv(pScreen);
ExaGCPriv(pGC);
PixmapPtr pTile = NULL;
Bool finish_current_tile = FALSE;
/* Either of these conditions is enough to trigger access to a tile pixmap. */
/* With pGC->tileIsPixel == 1, you run the risk of dereferencing an invalid tile pixmap pointer. */
/* Either of these conditions is enough to trigger access to a tile pixmap.
* With pGC->tileIsPixel == 1, you run the risk of dereferencing an invalid
* tile pixmap pointer.
*/
if (pGC->fillStyle == FillTiled ||
((changes & GCTile) && !pGC->tileIsPixel)) {
pTile = pGC->tile.pixmap;
/* Sometimes tile pixmaps are swapped, you need access to:
* - The current tile if it depth matches.
* - Or the rotated tile if that one matches depth and !(changes & GCTile).
* - Or the current tile pixmap and a newly created one.
*/
if (pTile && pTile->drawable.depth != pDrawable->depth &&
!(changes & GCTile)) {
PixmapPtr pRotatedTile = fbGetRotatedPixmap(pGC);
if (pRotatedTile &&
pRotatedTile->drawable.depth == pDrawable->depth)
pTile = pRotatedTile;
else
finish_current_tile = TRUE; /* CreatePixmap will be called. */
}
}
if (pGC->stipple)
......@@ -544,8 +529,6 @@ exaValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
if (pTile)
exaFinishAccess(&pTile->drawable, EXA_PREPARE_SRC);
if (finish_current_tile && pGC->tile.pixmap)
exaFinishAccess(&pGC->tile.pixmap->drawable, EXA_PREPARE_AUX_DEST);
if (pGC->stipple)
exaFinishAccess(&pGC->stipple->drawable, EXA_PREPARE_MASK);
}
......
......@@ -14,8 +14,6 @@ libwfb_la_LIBADD = $(PIXMAN_LIBS)
libfb_la_SOURCES = \
fb.h \
fb24_32.c \
fb24_32.h \
fballpriv.c \
fbarc.c \
fbbits.c \
......
......@@ -89,9 +89,6 @@
#if GLYPHPADBYTES != 4
#error "GLYPHPADBYTES must be 4"
#endif
/* for driver compat - intel UXA needs the second one at least */
#define FB_24BIT
#define FB_24_32BIT
#define FB_STIP_SHIFT LOG2_BITMAP_PAD
#define FB_STIP_UNIT (1 << FB_STIP_SHIFT)
#define FB_STIP_MASK (FB_STIP_UNIT - 1)
......@@ -331,32 +328,6 @@ extern _X_EXPORT void fbSetBits(FbStip * bits, int stride, FbStip data);
#define FbLaneCase(n,a) FbLaneCase4(n,(CARD8 *) (a),0)
/* Rotate a filled pixel value to the specified alignement */
#define FbRot24(p,b) (FbScrRight(p,b) | FbScrLeft(p,24-(b)))
#define FbRot24Stip(p,b) (FbStipRight(p,b) | FbStipLeft(p,24-(b)))
/* step a filled pixel value to the next/previous FB_UNIT alignment */
#define FbNext24Pix(p) (FbRot24(p,(24-FB_UNIT%24)))
#define FbPrev24Pix(p) (FbRot24(p,FB_UNIT%24))
#define FbNext24Stip(p) (FbRot24(p,(24-FB_STIP_UNIT%24)))
#define FbPrev24Stip(p) (FbRot24(p,FB_STIP_UNIT%24))
/* step a rotation value to the next/previous rotation value */
#define FbNext24Rot(r) ((r) == 0 ? 16 : (r) - 8)
#define FbPrev24Rot(r) ((r) == 16 ? 0 : (r) + 8)
#if IMAGE_BYTE_ORDER == MSBFirst
#define FbFirst24Rot(x) (((x) + 16) % 24)
#else
#define FbFirst24Rot(x) ((x) % 24)
#endif
#define FbNext24RotStip(r) ((r) == 0 ? 16 : (r) - 8)
#define FbPrev24RotStip(r) ((r) == 16 ? 0 : (r) + 8)
/* Whether 24-bit specific code is needed for this filled pixel value */
#define FbCheck24Pix(p) ((p) == FbNext24Pix(p))
/* Macros for dealing with dashing */
#define FbDashDeclare \
......@@ -433,8 +404,6 @@ fbGetScreenPrivateKey(void);
/* private field of a screen */
typedef struct {
unsigned char win32bpp; /* window bpp for 32-bpp images */
unsigned char pix32bpp; /* pixmap bpp for 32-bpp images */
#ifdef FB_ACCESS_WRAPPER
SetupWrapProcPtr setupWrap; /* driver hook to set pixmap access wrapping */
FinishWrapProcPtr finishWrap; /* driver hook to clean up pixmap access wrapping */
......@@ -452,7 +421,6 @@ typedef struct {
FbBits bgand, bgxor; /* for stipples */
FbBits fg, bg, pm; /* expanded and filled */
unsigned int dashLength; /* total of all dash elements */
unsigned char bpp; /* current drawable bpp */
} FbGCPrivRec, *FbGCPrivPtr;
#define fbGetGCPrivateKey(pGC) (&fbGetScreenPrivate((pGC)->pScreen)->gcPrivateKeyRec)
......@@ -462,7 +430,6 @@ typedef struct {
#define fbGetCompositeClip(pGC) ((pGC)->pCompositeClip)
#define fbGetExpose(pGC) ((pGC)->fExpose)
#define fbGetRotatedPixmap(pGC) ((pGC)->pRotatedPixmap)
#define fbGetScreenPixmap(s) ((PixmapPtr) (s)->devPrivate)
......@@ -539,64 +506,6 @@ typedef struct {
*/
#define FbEvenTile(w) ((w) <= FB_UNIT && FbPowerOfTwo(w))
/*
* fb24_32.c
*/
extern _X_EXPORT void
fb24_32GetSpans(DrawablePtr pDrawable,
int wMax,
DDXPointPtr ppt, int *pwidth, int nspans, char *pchardstStart);
extern _X_EXPORT void
fb24_32SetSpans(DrawablePtr pDrawable,
GCPtr pGC,
char *src,
DDXPointPtr ppt, int *pwidth, int nspans, int fSorted);
extern _X_EXPORT void
fb24_32PutZImage(DrawablePtr pDrawable,
RegionPtr pClip,
int alu,
FbBits pm,
int x,
int y, int width, int height, CARD8 *src, FbStride srcStride);
extern _X_EXPORT void
fb24_32GetImage(DrawablePtr pDrawable,
int x,
int y,
int w,
int h, unsigned int format, unsigned long planeMask, char *d);
extern _X_EXPORT void
fb24_32CopyMtoN(DrawablePtr pSrcDrawable,
DrawablePtr pDstDrawable,
GCPtr pGC,
BoxPtr pbox,
int nbox,
int dx,
int dy,
Bool reverse, Bool upsidedown, Pixel bitplane, void *closure);
extern _X_EXPORT PixmapPtr
fb24_32ReformatTile(PixmapPtr pOldTile, int bitsPerPixel);
extern _X_EXPORT Bool
fb24_32CreateScreenResources(ScreenPtr pScreen);
extern _X_EXPORT Bool
fb24_32ModifyPixmapHeader(PixmapPtr pPixmap,
int width,
int height,
int depth,
int bitsPerPixel, int devKind, void *pPixData);
/*
* fballpriv.c
*/
......@@ -711,47 +620,6 @@ extern _X_EXPORT void
extern _X_EXPORT void
fbBresSolid24(DrawablePtr pDrawable,
GCPtr pGC,
int dashOffset,
int signdx,
int signdy,
int axis, int x, int y, int e, int e1, int e3, int len);
extern _X_EXPORT void
fbBresDash24(DrawablePtr pDrawable,
GCPtr pGC,
int dashOffset,
int signdx,
int signdy,
int axis, int x, int y, int e, int e1, int e3, int len);
extern _X_EXPORT void
fbDots24(FbBits * dst,
FbStride dstStride,
int dstBpp,
BoxPtr pBox,
xPoint * pts,
int npt,
int xorg, int yorg, int xoff, int yoff, FbBits and, FbBits xor);
extern _X_EXPORT void
fbArc24(FbBits * dst,
FbStride dstStride,
int dstBpp, xArc * arc, int dx, int dy, FbBits and, FbBits xor);
extern _X_EXPORT void
fbPolyline24(DrawablePtr pDrawable,
GCPtr pGC, int mode, int npt, DDXPointPtr ptsOrig);
extern _X_EXPORT void
fbPolySegment24(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pseg);
extern _X_EXPORT void
fbBresSolid32(DrawablePtr pDrawable,
GCPtr pGC,
int dashOffset,
......@@ -811,17 +679,6 @@ fbBlt(FbBits * src,
int width,
int height, int alu, FbBits pm, int bpp, Bool reverse, Bool upsidedown);
extern _X_EXPORT void
fbBlt24(FbBits * srcLine,
FbStride srcStride,
int srcX,
FbBits * dstLine,
FbStride dstStride,
int dstX,
int width,
int height, int alu, FbBits pm, Bool reverse, Bool upsidedown);
extern _X_EXPORT void
fbBltStip(FbStip * src, FbStride srcStride, /* in FbStip units, not FbBits units */
int srcX, FbStip * dst, FbStride dstStride, /* in FbStip units, not FbBits units */
......@@ -842,17 +699,6 @@ fbBltOne(FbStip * src,
int width,
int height, FbBits fgand, FbBits fbxor, FbBits bgand, FbBits bgxor);
extern _X_EXPORT void
fbBltOne24(FbStip * src, FbStride srcStride, /* FbStip units per scanline */
int srcX, /* bit position of source */
FbBits * dst, FbStride dstStride, /* FbBits units per scanline */
int dstX, /* bit position of dest */
int dstBpp, /* bits per destination unit */
int width, /* width in bits of destination */
int height, /* height in scanlines */
FbBits fgand, /* rrop values */
FbBits fgxor, FbBits bgand, FbBits bgxor);
extern _X_EXPORT void
fbBltPlane(FbBits * src,
......@@ -1114,12 +960,6 @@ fbDestroyGlyphCache(void);
*/
extern _X_EXPORT PixmapPtr
fbCreatePixmapBpp(ScreenPtr pScreen, int width, int height, int depth, int bpp,
unsigned usage_hint);
extern _X_EXPORT PixmapPtr
fbCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
unsigned usage_hint);
......@@ -1257,12 +1097,6 @@ fbSolid(FbBits * dst,
FbStride dstStride,
int dstX, int bpp, int width, int height, FbBits and, FbBits xor);
extern _X_EXPORT void
fbSolid24(FbBits * dst,
FbStride dstStride,
int dstX, int width, int height, FbBits and, FbBits xor);
/*
* fbutil.c
*/
......
This diff is collapsed.
/*
* Copyright © 2000 SuSE, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of SuSE not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. SuSE makes no representations about the
* suitability of this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
* SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Author: Keith Packard, SuSE, Inc.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#ifndef _FB24_32_H_
#define _FB24_32_H_
Bool
fb24_32FinishScreenInit(ScreenPtr pScreen,
void *pbits,
int xsize,
int ysize, int dpix, int dpiy, int width, int bpp);
Bool
fb24_32ScreenInit(ScreenPtr pScreen,
void *pbits,
int xsize, int ysize, int dpix, int dpiy, int width, int bpp);
#endif
......@@ -48,9 +48,6 @@ fbPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc * parcs)
case 16:
arc = fbArc16;
break;
case 24:
arc = fbArc24;
break;
case 32:
arc = fbArc32;
break;
......
......@@ -83,64 +83,6 @@
#undef BITS
#undef BITS2
#define BRESSOLID fbBresSolid24
#define BRESDASH fbBresDash24
#define DOTS fbDots24
#define ARC fbArc24
#define POLYLINE fbPolyline24
#define POLYSEGMENT fbPolySegment24
#define BITS CARD32
#define BITSUNIT BYTE
#define BITSMUL 3
#define FbDoTypeStore(b,t,x,s) WRITE(((t *) (b)), (x) >> (s))
#define FbDoTypeRRop(b,t,a,x,s) WRITE((t *) (b), FbDoRRop(READ((t *) (b)),\
(a) >> (s), \
(x) >> (s)))
#define FbDoTypeMaskRRop(b,t,a,x,m,s) WRITE((t *) (b), FbDoMaskRRop(READ((t *) (b)),\
(a) >> (s), \
(x) >> (s), \
(m) >> (s)))
#if BITMAP_BIT_ORDER == LSBFirst
#define BITSSTORE(b,x) ((unsigned long) (b) & 1 ? \
(FbDoTypeStore (b, CARD8, x, 0), \
FbDoTypeStore ((b) + 1, CARD16, x, 8)) : \
(FbDoTypeStore (b, CARD16, x, 0), \
FbDoTypeStore ((b) + 2, CARD8, x, 16)))
#define BITSRROP(b,a,x) ((unsigned long) (b) & 1 ? \
(FbDoTypeRRop(b,CARD8,a,x,0), \
FbDoTypeRRop((b)+1,CARD16,a,x,8)) : \
(FbDoTypeRRop(b,CARD16,a,x,0), \
FbDoTypeRRop((b)+2,CARD8,a,x,16)))
#else
#define BITSSTORE(b,x) ((unsigned long) (b) & 1 ? \
(FbDoTypeStore (b, CARD8, x, 16), \
FbDoTypeStore ((b) + 1, CARD16, x, 0)) : \
(FbDoTypeStore (b, CARD16, x, 8), \
FbDoTypeStore ((b) + 2, CARD8, x, 0)))
#define BITSRROP(b,a,x) ((unsigned long) (b) & 1 ? \
(FbDoTypeRRop (b, CARD8, a, x, 16), \
FbDoTypeRRop ((b) + 1, CARD16, a, x, 0)) : \
(FbDoTypeRRop (b, CARD16, a, x, 8), \
FbDoTypeRRop ((b) + 2, CARD8, a, x, 0)))
#endif
#include "fbbits.h"
#undef BITSSTORE
#undef BITSRROP
#undef BITSMUL
#undef BITSUNIT
#undef BITS
#undef BRESSOLID
#undef BRESDASH
#undef DOTS
#undef ARC
#undef POLYLINE
#undef POLYSEGMENT
#define BRESSOLID fbBresSolid32
#define BRESDASH fbBresDash32
#define DOTS fbDots32
......
This diff is collapsed.
......@@ -92,12 +92,6 @@ fbBlt(FbBits * srcLine,
}
}
if (bpp == 24 && !FbCheck24Pix(pm)) {
fbBlt24(srcLine, srcStride, srcX, dstLine, dstStride, dstX,
width, height, alu, pm, reverse, upsidedown);
return;
}
FbInitializeMergeRop(alu, pm);
destInvarient = FbDestInvarientMergeRop();
if (upsidedown) {
......@@ -298,228 +292,6 @@ fbBlt(FbBits * srcLine,
}
}
#undef DEBUG_BLT24
#ifdef DEBUG_BLT24
static unsigned long
getPixel(char *src, int x)
{
unsigned long l;
l = 0;
memcpy(&l, src + x * 3, 3);
return l;
}
#endif
static void
fbBlt24Line(FbBits * src,
int srcX,
FbBits * dst, int dstX, int width, int alu, FbBits pm, Bool reverse)
{
#ifdef DEBUG_BLT24
char *origDst = (char *) dst;
FbBits *origLine = dst + ((dstX >> FB_SHIFT) - 1);
int origNlw = ((width + FB_MASK) >> FB_SHIFT) + 3;
int origX = dstX / 24;
#endif
int leftShift, rightShift;
FbBits startmask, endmask;
int n;
FbBits bits, bits1;
FbBits mask;
int rot;
FbDeclareMergeRop();
FbInitializeMergeRop(alu, FB_ALLONES);
FbMaskBits(dstX, width, startmask, n, endmask);
#ifdef DEBUG_BLT24
ErrorF("dstX %d width %d reverse %d\n", dstX, width, reverse);
#endif
if (reverse) {
src += ((srcX + width - 1) >> FB_SHIFT) + 1;
dst += ((dstX + width - 1) >> FB_SHIFT) + 1;
rot = FbFirst24Rot(((dstX + width - 8) & FB_MASK));
rot = FbPrev24Rot(rot);
#ifdef DEBUG_BLT24
ErrorF("dstX + width - 8: %d rot: %d\n", (dstX + width - 8) & FB_MASK,
rot);
#endif
srcX = (srcX + width - 1) & FB_MASK;
dstX = (dstX + width - 1) & FB_MASK;
}
else {
src += srcX >> FB_SHIFT;
dst += dstX >> FB_SHIFT;
srcX &= FB_MASK;
dstX &= FB_MASK;
rot = FbFirst24Rot(dstX);
#ifdef DEBUG_BLT24
ErrorF("dstX: %d rot: %d\n", dstX, rot);
#endif
}
mask = FbRot24(pm, rot);
#ifdef DEBUG_BLT24
ErrorF("pm 0x%x mask 0x%x\n", pm, mask);
#endif
if (srcX == dstX) {
if (reverse) {
if (endmask) {
bits = READ(--src);
--dst;
WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask & endmask));
mask = FbPrev24Pix(mask);
}
while (n--) {
bits = READ(--src);
--dst;
WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask));
mask = FbPrev24Pix(mask);
}
if (startmask) {
bits = READ(--src);
--dst;
WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask & startmask));
}
}
else {
if (startmask) {
bits = READ(src++);
WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask & startmask));
dst++;
mask = FbNext24Pix(mask);
}
while (n--) {
bits = READ(src++);
WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask));
dst++;
mask = FbNext24Pix(mask);
}
if (endmask) {
bits = READ(src);
WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask & endmask));
}
}
}
else {
if (srcX > dstX) {
leftShift = srcX - dstX;
rightShift = FB_UNIT - leftShift;
}
else {
rightShift = dstX - srcX;
leftShift = FB_UNIT - rightShift;
}
bits1 = 0;
if (reverse) {
if (srcX < dstX)
bits1 = READ(--src);
if (endmask) {
bits = FbScrRight(bits1, rightShift);
if (FbScrRight(endmask, leftShift)) {
bits1 = READ(--src);
bits |= FbScrLeft(bits1, leftShift);
}
--dst;
WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask & endmask));
mask = FbPrev24Pix(mask);
}
while (n--) {
bits = FbScrRight(bits1, rightShift);
bits1 = READ(--src);
bits |= FbScrLeft(bits1, leftShift);
--dst;
WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask));
mask = FbPrev24Pix(mask);
}
if (startmask) {
bits = FbScrRight(bits1, rightShift);
if (FbScrRight(startmask, leftShift)) {
bits1 = READ(--src);
bits |= FbScrLeft(bits1, leftShift);
}
--dst;
WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask & startmask));
}
}
else {
if (srcX > dstX)
bits1 = READ(src++);
if (startmask) {
bits = FbScrLeft(bits1, leftShift);
bits1 = READ(src++);
bits |= FbScrRight(bits1, rightShift);
WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask & startmask));
dst++;
mask = FbNext24Pix(mask);
}
while (n--) {
bits = FbScrLeft(bits1, leftShift);
bits1 = READ(src++);
bits |= FbScrRight(bits1, rightShift);
WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask));
dst++;
mask = FbNext24Pix(mask);
}
if (endmask) {
bits = FbScrLeft(bits1, leftShift);
if (FbScrLeft(endmask, rightShift)) {
bits1 = READ(src);
bits |= FbScrRight(bits1, rightShift);
}
WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask & endmask));
}
}
}
#ifdef DEBUG_BLT24
{
int firstx, lastx, x;
firstx = origX;
if (firstx)
firstx--;
lastx = origX + width / 24 + 1;
for (x = firstx; x <= lastx; x++)
ErrorF("%06x ", getPixel(origDst, x));
ErrorF("\n");
while (origNlw--)
ErrorF("%08x ", *origLine++);
ErrorF("\n");
}
#endif
}
void
fbBlt24(FbBits * srcLine,
FbStride srcStride,
int srcX,
FbBits * dstLine,
FbStride dstStride,
int dstX,
int width,
int height, int alu, FbBits pm, Bool reverse, Bool upsidedown)
{
if (upsidedown) {
srcLine += (height - 1) * srcStride;
dstLine += (height - 1) * dstStride;
srcStride = -srcStride;
dstStride = -dstStride;
}
while (height--) {
fbBlt24Line(srcLine, srcX, dstLine, dstX, width, alu, pm, reverse);
srcLine += srcStride;
dstLine += dstStride;
}
#ifdef DEBUG_BLT24
ErrorF("\n");
#endif
}
void
fbBltStip(FbStip * src, FbStride srcStride, /* in FbStip units, not FbBits units */
int srcX, FbStip * dst, FbStride dstStride, /* in FbStip units, not FbBits units */
......
This diff is collapsed.
......@@ -241,14 +241,8 @@ fbCopyArea(DrawablePtr pSrcDrawable,
GCPtr pGC,
int xIn, int yIn, int widthSrc, int heightSrc, int xOut, int yOut)
{
miCopyProc copy;
if (pSrcDrawable->bitsPerPixel != pDstDrawable->bitsPerPixel)
copy = fb24_32CopyMtoN;
else
copy = fbCopyNtoN;
return miDoCopy(pSrcDrawable, pDstDrawable, pGC, xIn, yIn,
widthSrc, heightSrc, xOut, yOut, copy, 0, 0);
widthSrc, heightSrc, xOut, yOut, fbCopyNtoN, 0, 0);
}
RegionPtr
......
......@@ -71,7 +71,6 @@ fbCreateGC(GCPtr pGC)
pGC->miTranslate = 1;
pGC->fExpose = 1;
fbGetGCPrivate(pGC)->bpp = BitsPerPixel(pGC->depth);
return TRUE;
}
......@@ -129,35 +128,6 @@ fbValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
miComputeCompositeClip(pGC, pDrawable);
}
if (pPriv->bpp != pDrawable->bitsPerPixel) {
changes |= GCStipple | GCForeground | GCBackground | GCPlaneMask;
pPriv->bpp = pDrawable->bitsPerPixel;
}
if ((changes & GCTile) && fbGetRotatedPixmap(pGC)) {
(*pGC->pScreen->DestroyPixmap) (fbGetRotatedPixmap(pGC));
fbGetRotatedPixmap(pGC) = 0;
}
if (pGC->fillStyle == FillTiled) {
PixmapPtr pOldTile, pNewTile;
pOldTile = pGC->tile.pixmap;
if (pOldTile->drawable.bitsPerPixel != pDrawable->bitsPerPixel) {
pNewTile = fbGetRotatedPixmap(pGC);
if (!pNewTile ||
pNewTile->drawable.bitsPerPixel != pDrawable->bitsPerPixel) {
if (pNewTile)
(*pGC->pScreen->DestroyPixmap) (pNewTile);
pNewTile =
fb24_32ReformatTile(pOldTile, pDrawable->bitsPerPixel);
}
if (pNewTile) {
fbGetRotatedPixmap(pGC) = pOldTile;
pGC->tile.pixmap = pNewTile;
changes |= GCTile;
}
}
}
if (changes & GCTile) {
if (!pGC->tileIsPixel &&
FbEvenTile(pGC->tile.pixmap->drawable.width *
......
......@@ -44,11 +44,6 @@ fbGetSpans(DrawablePtr pDrawable,
if (!fbDrawableEnabled(pDrawable))
return;
if (pDrawable->bitsPerPixel != BitsPerPixel(pDrawable->depth)) {
fb24_32GetSpans(pDrawable, wMax, ppt, pwidth, nspans, pchardstStart);
return;
}
fbGetDrawable(pDrawable, src, srcStride, srcBpp, srcXoff, srcYoff);
while (nspans--) {
......
......@@ -53,185 +53,6 @@ fbGlyphIn(RegionPtr pRegion, int x, int y, int width, int height)
return RegionContainsRect(pRegion, &box) == rgnIN;
}
#define WRITE1(d,n,fg) WRITE((d) + (n), (CARD8) fg)
#define WRITE2(d,n,fg) WRITE((CARD16 *) &(d[n]), (CARD16) fg)
#define WRITE4(d,n,fg) WRITE((CARD32 *) &(d[n]), (CARD32) fg)
#define WRITE8(d) WRITE4(d,0,_ABCA), WRITE4(d,4,_BCAB)
/*
* This is a bit tricky, but it's brief. Write 12 bytes worth
* of dest, which is four pixels, at a time. This gives constant
* code for each pattern as they're always aligned the same
*
* a b c d a b c d a b c d bytes