diff options
author | Eric Anholt <eric@anholt.net> | 2007-09-12 13:58:46 +0000 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2007-09-13 00:08:53 +0000 |
commit | e4d11e58ce349dfe6af2f73ff341317f9b39684c (patch) | |
tree | 05509150343f56d8ec6c88e8da338bf99e6ec03f /cfb | |
parent | 6da39c67905500ab2db00a45cda4a9f756cdde96 (diff) |
Remove the PaintWindow optimization.
This was an attempt to avoid scratch gc creation and validation for paintwin
because that was expensive. This is not the case in current servers, and the
danger of failure to implement it correctly (as seen in all previous
implementations) is high enough to justify removing it. No performance
difference detected with x11perf -create -move -resize -circulate on Xvfb.
Leave the screen hooks for PaintWindow* in for now to avoid ABI change.
Diffstat (limited to 'cfb')
-rw-r--r-- | cfb/Makefile.am.inc | 2 | ||||
-rw-r--r-- | cfb/cfb.h | 37 | ||||
-rw-r--r-- | cfb/cfballpriv.c | 18 | ||||
-rw-r--r-- | cfb/cfbmap.h | 6 | ||||
-rw-r--r-- | cfb/cfbpntwin.c | 768 | ||||
-rw-r--r-- | cfb/cfbscrinit.c | 4 | ||||
-rw-r--r-- | cfb/cfbtile32.c | 2 | ||||
-rw-r--r-- | cfb/cfbunmap.h | 3 | ||||
-rw-r--r-- | cfb/cfbwindow.c | 185 |
9 files changed, 11 insertions, 1014 deletions
diff --git a/cfb/Makefile.am.inc b/cfb/Makefile.am.inc index 5aa913aee..a2ee143aa 100644 --- a/cfb/Makefile.am.inc +++ b/cfb/Makefile.am.inc @@ -8,7 +8,7 @@ DISTCLEANFILES = $(libcfb_gen_sources) CFB_INCLUDES = -I$(top_srcdir)/mfb -I$(top_srcdir)/cfb libcfb_common_sources = $(top_srcdir)/cfb/cfbgc.c $(top_srcdir)/cfb/cfbrrop.c \ - $(top_srcdir)/cfb/cfbwindow.c $(top_srcdir)/cfb/cfbpntwin.c \ + $(top_srcdir)/cfb/cfbwindow.c \ $(top_srcdir)/cfb/cfbmskbits.c $(top_srcdir)/cfb/cfbpixmap.c \ $(top_srcdir)/cfb/cfbbitblt.c $(top_srcdir)/cfb/cfbfillsp.c \ $(top_srcdir)/cfb/cfbsetsp.c $(top_srcdir)/cfb/cfbscrinit.c \ @@ -56,7 +56,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. */ extern int cfbGCPrivateIndex; -extern int cfbWindowPrivateIndex; /* private field of GC */ typedef struct { @@ -81,20 +80,6 @@ typedef struct { CfbBits xor, and; } cfbRRopRec, *cfbRRopPtr; -/* private field of window */ -typedef struct { - unsigned char fastBorder; /* non-zero if border is 32 bits wide */ - unsigned char fastBackground; - unsigned short unused; /* pad for alignment with Sun compiler */ - DDXPointRec oldRotate; - PixmapPtr pRotatedBackground; - PixmapPtr pRotatedBorder; - } cfbPrivWin; - -#define cfbGetWindowPrivate(_pWin) ((cfbPrivWin *)\ - (_pWin)->devPrivates[cfbWindowPrivateIndex].ptr) - - /* cfb8bit.c */ extern int cfbSetStipple( @@ -313,7 +298,6 @@ extern int cfb8SegmentSS1RectXor( extern Bool cfbAllocatePrivates( ScreenPtr /*pScreen*/, - int * /*window_index*/, int * /*gc_index*/ ); /* cfbbitblt.c */ @@ -806,27 +790,6 @@ extern void cfbFillPoly1RectGeneral( int /*count*/, DDXPointPtr /*ptsIn*/ ); -/* cfbpntwin.c */ - -extern void cfbPaintWindow( - WindowPtr /*pWin*/, - RegionPtr /*pRegion*/, - int /*what*/ -); - -extern void cfbFillBoxSolid( - DrawablePtr /*pDrawable*/, - int /*nBox*/, - BoxPtr /*pBox*/, - unsigned long /*pixel*/ -); - -extern void cfbFillBoxTile32( - DrawablePtr /*pDrawable*/, - int /*nBox*/, - BoxPtr /*pBox*/, - PixmapPtr /*tile*/ -); /* cfbpolypnt.c */ extern void cfbPolyPoint( diff --git a/cfb/cfballpriv.c b/cfb/cfballpriv.c index e0ccdf4d0..858ff6061 100644 --- a/cfb/cfballpriv.c +++ b/cfb/cfballpriv.c @@ -45,7 +45,6 @@ in this Software without prior written authorization from The Open Group. #include "mibstore.h" #if 1 || PSZ==8 -int cfbWindowPrivateIndex = -1; int cfbGCPrivateIndex = -1; #endif #ifdef CFB_NEED_SCREEN_PRIVATE @@ -55,29 +54,20 @@ static unsigned long cfbGeneration = 0; Bool -cfbAllocatePrivates(pScreen, window_index, gc_index) - ScreenPtr pScreen; - int *window_index, *gc_index; +cfbAllocatePrivates(ScreenPtr pScreen, int *gc_index) { - if (!window_index || !gc_index || - (*window_index == -1 && *gc_index == -1)) + if (!gc_index || *gc_index == -1) { - if (!mfbAllocatePrivates(pScreen, - &cfbWindowPrivateIndex, &cfbGCPrivateIndex)) + if (!mfbAllocatePrivates(pScreen, &cfbGCPrivateIndex)) return FALSE; - if (window_index) - *window_index = cfbWindowPrivateIndex; if (gc_index) *gc_index = cfbGCPrivateIndex; } else { - cfbWindowPrivateIndex = *window_index; cfbGCPrivateIndex = *gc_index; } - if (!AllocateWindowPrivate(pScreen, cfbWindowPrivateIndex, - sizeof(cfbPrivWin)) || - !AllocateGCPrivate(pScreen, cfbGCPrivateIndex, sizeof(cfbPrivGC))) + if (!AllocateGCPrivate(pScreen, cfbGCPrivateIndex, sizeof(cfbPrivGC))) return FALSE; #ifdef CFB_NEED_SCREEN_PRIVATE if (cfbGeneration != serverGeneration) diff --git a/cfb/cfbmap.h b/cfb/cfbmap.h index 1d6a3f850..2e709b19d 100644 --- a/cfb/cfbmap.h +++ b/cfb/cfbmap.h @@ -71,8 +71,6 @@ in this Software without prior written authorization from The Open Group. #undef cfbDoBitbltGeneral #undef cfbDoBitbltOr #undef cfbDoBitbltXor -#undef cfbFillBoxSolid -#undef cfbFillBoxTile32 #undef cfbFillBoxTile32sCopy #undef cfbFillBoxTile32sGeneral #undef cfbFillBoxTileOdd @@ -108,7 +106,6 @@ in this Software without prior written authorization from The Open Group. #undef cfbNonTEOps #undef cfbNonTEOps1Rect #undef cfbPadPixmap -#undef cfbPaintWindow #undef cfbPolyFillArcSolidCopy #undef cfbPolyFillArcSolidGeneral #undef cfbPolyFillRect @@ -250,8 +247,6 @@ cfb can not hack PSZ yet #define cfbDoBitbltOr CFBNAME(DoBitbltOr) #define cfbDoBitbltXor CFBNAME(DoBitbltXor) #define cfbExpandDirectColors CFBNAME(cfbExpandDirectColors) -#define cfbFillBoxSolid CFBNAME(FillBoxSolid) -#define cfbFillBoxTile32 CFBNAME(FillBoxTile32) #define cfbFillBoxTile32sCopy CFBNAME(FillBoxTile32sCopy) #define cfbFillBoxTile32sGeneral CFBNAME(FillBoxTile32sGeneral) #define cfbFillBoxTileOdd CFBNAME(FillBoxTileOdd) @@ -288,7 +283,6 @@ cfb can not hack PSZ yet #define cfbNonTEOps CFBNAME(NonTEOps) #define cfbNonTEOps1Rect CFBNAME(NonTEOps1Rect) #define cfbPadPixmap CFBNAME(PadPixmap) -#define cfbPaintWindow CFBNAME(PaintWindow) #define cfbPolyFillArcSolidCopy CFBNAME(PolyFillArcSolidCopy) #define cfbPolyFillArcSolidGeneral CFBNAME(PolyFillArcSolidGeneral) #define cfbPolyFillRect CFBNAME(PolyFillRect) diff --git a/cfb/cfbpntwin.c b/cfb/cfbpntwin.c deleted file mode 100644 index 32f011e23..000000000 --- a/cfb/cfbpntwin.c +++ /dev/null @@ -1,768 +0,0 @@ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -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. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -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 Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL 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. - -******************************************************************/ - -#ifdef HAVE_DIX_CONFIG_H -#include <dix-config.h> -#endif - -#include <X11/X.h> - -#include "windowstr.h" -#include "regionstr.h" -#include "pixmapstr.h" -#include "scrnintstr.h" - -#include "cfb.h" -#include "cfbmskbits.h" -#include "mi.h" - -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" -#endif - -void -cfbPaintWindow(pWin, pRegion, what) - WindowPtr pWin; - RegionPtr pRegion; - int what; -{ - register cfbPrivWin *pPrivWin; - WindowPtr pBgWin; - - pPrivWin = cfbGetWindowPrivate(pWin); - - - switch (what) { - case PW_BACKGROUND: - switch (pWin->backgroundState) { - case None: - break; - case ParentRelative: - do { - pWin = pWin->parent; - } while (pWin->backgroundState == ParentRelative); - (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, pRegion, - what); - break; - case BackgroundPixmap: - if (pPrivWin->fastBackground) - { - cfbFillBoxTile32 ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pPrivWin->pRotatedBackground); - } - else - { - int xorg = pWin->drawable.x; - int yorg = pWin->drawable.y; -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - int index = pWin->drawable.pScreen->myNum; - if(WindowTable[index] == pWin) { - xorg -= panoramiXdataPtr[index].x; - yorg -= panoramiXdataPtr[index].y; - } - } -#endif - cfbFillBoxTileOdd ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pWin->background.pixmap, - xorg, yorg); - } - break; - case BackgroundPixel: - cfbFillBoxSolid ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pWin->background.pixel); - break; - } - break; - case PW_BORDER: - if (pWin->borderIsPixel) - { - cfbFillBoxSolid ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pWin->border.pixel); - } - else if (pPrivWin->fastBorder) - { - cfbFillBoxTile32 ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pPrivWin->pRotatedBorder); - } - else - { - int xorg, yorg; - - for (pBgWin = pWin; - pBgWin->backgroundState == ParentRelative; - pBgWin = pBgWin->parent); - - xorg = pBgWin->drawable.x; - yorg = pBgWin->drawable.y; - -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - int index = pWin->drawable.pScreen->myNum; - if(WindowTable[index] == pBgWin) { - xorg -= panoramiXdataPtr[index].x; - yorg -= panoramiXdataPtr[index].y; - } - } -#endif - - cfbFillBoxTileOdd ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pWin->border.pixmap, - xorg, yorg); - } - break; - } -} - -/* - * Use the RROP macros in copy mode - */ - -#define RROP GXcopy -#include "cfbrrop.h" - -#ifdef RROP_UNROLL -# define Expand(left,right,leftAdjust) {\ - int part = nmiddle & RROP_UNROLL_MASK; \ - int widthStep; \ - widthStep = widthDst - nmiddle - leftAdjust; \ - nmiddle >>= RROP_UNROLL_SHIFT; \ - while (h--) { \ - left \ - pdst += part; \ - switch (part) { \ - RROP_UNROLL_CASE(pdst) \ - } \ - m = nmiddle; \ - while (m) { \ - pdst += RROP_UNROLL; \ - RROP_UNROLL_LOOP(pdst) \ - m--; \ - } \ - right \ - pdst += widthStep; \ - } \ -} - -#else -# define Expand(left, right, leftAdjust) { \ - int widthStep; \ - widthStep = widthDst - nmiddle - leftAdjust; \ - while (h--) { \ - left \ - m = nmiddle; \ - while (m--) {\ - RROP_SOLID(pdst); \ - pdst++; \ - } \ - right \ - pdst += widthStep; \ - } \ -} -#endif - -void -cfbFillBoxSolid (pDrawable, nBox, pBox, pixel) - DrawablePtr pDrawable; - int nBox; - BoxPtr pBox; - unsigned long pixel; -{ - CfbBits *pdstBase; - int widthDst; - register int h; - register CfbBits *pdst; - int nmiddle; - int w; -#if PSZ == 24 - int leftIndex, rightIndex; - CfbBits piQxelArray[3], *pdstULC; /*upper left corner*/ - - piQxelArray[0] = (pixel&0xFFFFFF) | ((pixel&0xFF)<<24); - piQxelArray[1] = ((pixel&0xFFFF00)>>8) | ((pixel&0xFFFF)<<16); - piQxelArray[2] = ((pixel&0xFFFFFF)<<8) | ((pixel&0xFF0000)>>16); -#else - register CfbBits rrop_xor; - register CfbBits leftMask, rightMask; - register int m; -#endif - - cfbGetLongWidthAndPointer(pDrawable, widthDst, pdstBase); - -#if PSZ != 24 - rrop_xor = PFILL(pixel); -#endif - for (; nBox; nBox--, pBox++) - { - pdst = pdstBase + pBox->y1 * widthDst; - h = pBox->y2 - pBox->y1; - w = pBox->x2 - pBox->x1; -#if PSZ == 8 - if (w == 1) - { - register char *pdstb = ((char *) pdst) + pBox->x1; - int incr = widthDst * PGSZB; - - while (h--) - { - *pdstb = rrop_xor; - pdstb += incr; - } - } - else - { -#endif -#if PSZ == 24 -/* _Box has x1, y1, x2, y2*/ - leftIndex = pBox->x1 & 3; - rightIndex = ((leftIndex+w)<5)?0:(pBox->x2 &3); - nmiddle = w - rightIndex; - if(leftIndex){ - nmiddle -= (4 - leftIndex); - } - nmiddle >>= 2; - if(nmiddle < 0) - nmiddle = 0; - - pdst = pdstBase + pBox->y1 * widthDst + ((pBox->x1*3) >> 2); - - switch(leftIndex+w){ - case 4: - switch(leftIndex){ - case 0: - while(h--){ - *pdst++ = piQxelArray[0]; - *pdst++ = piQxelArray[1]; - *pdst = piQxelArray[2]; - pdst -=2; - pdst += widthDst; - } - break; - case 1: - while(h--){ - *pdst = ((*pdst) & 0xFFFFFF) | (piQxelArray[0] & 0xFF000000); - pdst++; - *pdst++ = piQxelArray[1]; - *pdst = piQxelArray[2]; - pdst -=2; - pdst += widthDst; - } - break; - case 2: - while(h--){ - *pdst = ((*pdst) & 0xFFFF) | (piQxelArray[1] & 0xFFFF0000); - pdst++; - *pdst-- = piQxelArray[2]; - pdst += widthDst; - } - break; - case 3: - while(h--){ - *pdst = ((*pdst) & 0xFF) | (piQxelArray[2] & 0xFFFFFF00); - pdst += widthDst; - } - break; - } - break; - case 3: - switch(leftIndex){ - case 0: - while(h--){ - *pdst++ = piQxelArray[0]; - *pdst++ = piQxelArray[1]; - *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelArray[2] & 0xFF); - pdst--; - pdst--; - pdst += widthDst; - } - break; - case 1: - while(h--){ - *pdst = ((*pdst) & 0xFFFFFF) | (piQxelArray[0] & 0xFF000000); - pdst++; - *pdst++ = piQxelArray[1]; - *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelArray[2] & 0xFF); - pdst--; - pdst--; - pdst += widthDst; - } - break; - case 2: - while(h--){ - *pdst = ((*pdst) & 0xFFFF) | (piQxelArray[1] & 0xFFFF0000); - pdst++; - *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelArray[2] & 0xFF); - pdst--; - pdst += widthDst; - } - break; - } - break; - case 2: - while(h--){ - if(leftIndex){ - *pdst = ((*pdst) & 0xFFFFFF) | (piQxelArray[0] & 0xFF000000); - pdst++; - } - else{ - *pdst++ = piQxelArray[0]; - } - *pdst = ((*pdst) & 0xFFFF0000) | (piQxelArray[1] & 0xFFFF); - pdst--; - pdst += widthDst; - } - break; - case 1: /*only if leftIndex = 0 and w = 1*/ - while(h--){ - *pdst = ((*pdst) & 0xFF000000) | (piQxelArray[0] & 0xFFFFFF); - pdst += widthDst; - } - break; - case 0: /*never*/ - break; - default: - { - w = nmiddle; - pdstULC = pdst; -/* maskbits (pBox->x1, w, leftMask, rightMask, nmiddle);*/ - while(h--){ - nmiddle = w; - pdst = pdstULC; - switch(leftIndex){ - case 0: - break; - case 1: - *pdst = ((*pdst) & 0xFFFFFF) | (piQxelArray[0] & 0xFF000000); - pdst++; - *pdst++ = piQxelArray[1]; - *pdst++ = piQxelArray[2]; - break; - case 2: - *pdst = ((*pdst) & 0xFFFF) | (piQxelArray[1] & 0xFFFF0000); - pdst++; - *pdst++ = piQxelArray[2]; - break; - case 3: - *pdst = ((*pdst) & 0xFF) | (piQxelArray[2] & 0xFFFFFF00); - pdst++; - break; - } - while(nmiddle--){ - *pdst++ = piQxelArray[0]; - *pdst++ = piQxelArray[1]; - *pdst++ = piQxelArray[2]; - } - switch(rightIndex){ - case 0: - break; - case 1: - *pdst = ((*pdst) & 0xFF000000) | (piQxelArray[0] & 0xFFFFFF); - break; - case 2: - *pdst++ = piQxelArray[0]; - *pdst = ((*pdst) & 0xFFFF0000) | (piQxelArray[1] & 0xFFFF); - break; - case 3: - *pdst++ = piQxelArray[0]; - *pdst++ = piQxelArray[1]; - *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelArray[2] & 0xFF); - break; - } - pdstULC += widthDst; - } - - } - } -#else - pdst += (pBox->x1 >> PWSH); - if ((pBox->x1 & PIM) + w <= PPW) - { - maskpartialbits(pBox->x1, w, leftMask); - while (h--) { - *pdst = (*pdst & ~leftMask) | (rrop_xor & leftMask); - pdst += widthDst; - } - } - else - { - maskbits (pBox->x1, w, leftMask, rightMask, nmiddle); - if (leftMask) - { - if (rightMask) - { - Expand (RROP_SOLID_MASK (pdst, leftMask); pdst++; , - RROP_SOLID_MASK (pdst, rightMask); , - 1) - } - else - { - Expand (RROP_SOLID_MASK (pdst, leftMask); pdst++;, - ;, - 1) - } - } - else - { - if (rightMask) - { - Expand (;, - RROP_SOLID_MASK (pdst, rightMask);, - 0) - } - else - { - Expand (;, - ;, - 0) - } - } - } -#endif -#if PSZ == 8 - } -#endif - } -} - -void -cfbFillBoxTile32 (pDrawable, nBox, pBox, tile) - DrawablePtr pDrawable; - int nBox; /* number of boxes to fill */ - BoxPtr pBox; /* pointer to list of boxes to fill */ - PixmapPtr tile; /* rotated, expanded tile */ -{ - register CfbBits *pdst; - CfbBits *psrc; - int tileHeight; - - int widthDst; - int w; - int h; - int nmiddle; - int y; - int srcy; - - CfbBits *pdstBase; -#if PSZ == 24 - int leftIndex, rightIndex; - CfbBits piQxelArray[3], *pdstULC; -#else - register CfbBits rrop_xor; - register CfbBits leftMask; - register CfbBits rightMask; - register int m; -#endif - - tileHeight = tile->drawable.height; - psrc = (CfbBits *)tile->devPrivate.ptr; - - cfbGetLongWidthAndPointer (pDrawable, widthDst, pdstBase); - - while (nBox--) - { -#if PSZ == 24 - w = pBox->x2 - pBox->x1; - h = pBox->y2 - pBox->y1; - y = pBox->y1; - leftIndex = pBox->x1 & 3; -/* rightIndex = ((leftIndex+w)<5)?0:pBox->x2 &3;*/ - rightIndex = pBox->x2 &3; - nmiddle = w - rightIndex; - if(leftIndex){ - nmiddle -= (4 - leftIndex); - } - nmiddle >>= 2; - if(nmiddle < 0) - nmiddle = 0; - - pdst = pdstBase + ((pBox->x1 *3)>> 2) + pBox->y1 * widthDst; - srcy = y % tileHeight; - -#define StepTile piQxelArray[0] = (psrc[srcy] & 0xFFFFFF) | ((psrc[srcy] & 0xFF)<<24); \ - piQxelArray[1] = (psrc[srcy] & 0xFFFF00) | ((psrc[srcy] & 0xFFFF)<<16); \ - piQxelArray[2] = ((psrc[srcy] & 0xFF0000)>>16) | \ - ((psrc[srcy] & 0xFFFFFF)<<8); \ - /*rrop_xor = psrc[srcy];*/ \ - ++srcy; \ - if (srcy == tileHeight) \ - srcy = 0; - - switch(leftIndex+w){ - case 4: - switch(leftIndex){ - case 0: - while(h--){ - StepTile - *pdst++ = piQxelArray[0]; - *pdst++ = piQxelArray[1]; - *pdst = piQxelArray[2]; - pdst-=2; - pdst += widthDst; - } - break; - case 1: - while(h--){ - StepTile - *pdst = ((*pdst) & 0xFFFFFF) | (piQxelArray[0] & 0xFF000000); - pdst++; - *pdst++ = piQxelArray[1]; - *pdst = piQxelArray[2]; - pdst-=2; - pdst += widthDst; - } - break; - case 2: - while(h--){ - StepTile - *pdst = ((*pdst) & 0xFFFF) | (piQxelArray[1] & 0xFFFF0000); - pdst++; - *pdst-- = piQxelArray[2]; - pdst += widthDst; - } - break; - case 3: - while(h--){ - StepTile - *pdst = ((*pdst) & 0xFF) | (piQxelArray[2] & 0xFFFFFF00); - pdst += widthDst; - } - break; - } - break; - case 3: - switch(leftIndex){ - case 0: - while(h--){ - StepTile - *pdst++ = piQxelArray[0]; - *pdst++ = piQxelArray[1]; - *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelArray[2] & 0xFF); - pdst--; - pdst--; - pdst += widthDst; - } - break; - case 1: - while(h--){ - StepTile - *pdst = ((*pdst) & 0xFFFFFF) | (piQxelArray[0] & 0xFF000000); - pdst++; - *pdst++ = piQxelArray[1]; - *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelArray[2] & 0xFF); - pdst--; - pdst--; - pdst += widthDst; - } - break; - case 2: - while(h--){ - StepTile - *pdst = ((*pdst) & 0xFFFF) | (piQxelArray[1] & 0xFFFF0000); - pdst++; - *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelArray[2] & 0xFF); - pdst--; - pdst += widthDst; - } - break; - } - break; - case 2: - while(h--){ - StepTile - if(leftIndex){ - *pdst = ((*pdst) & 0xFFFFFF) | (piQxelArray[0] & 0xFF000000); - pdst++; - } - else{ - *pdst++ = piQxelArray[0]; - } - *pdst = ((*pdst) & 0xFFFF0000) | (piQxelArray[1] & 0xFFFF); - pdst--; - pdst += widthDst; - } - break; - case 1: /*only if leftIndex = 0 and w = 1*/ - while(h--){ - StepTile - *pdst = ((*pdst) & 0xFF000000) | (piQxelArray[0] & 0xFFFFFF); - pdst += widthDst; - } - break; - case 0: /*never*/ - break; - default: - { - w = nmiddle; - pdstULC = pdst; - - while(h--){ - StepTile - nmiddle = w; - pdst = pdstULC; - switch(leftIndex){ - case 0: - break; - case 1: - *pdst = ((*pdst) & 0xFFFFFF) | (piQxelArray[0] & 0xFF000000); - pdst++; - *pdst++ = piQxelArray[1]; - *pdst++ = piQxelArray[2]; - break; - case 2: - *pdst = ((*pdst) & 0xFFFF) | (piQxelArray[1] & 0xFFFF0000); - pdst++; - *pdst++ = piQxelArray[2]; - break; - case 3: - *pdst = ((*pdst) & 0xFF) | (piQxelArray[2] & 0xFFFFFF00); - pdst++; - break; - } - while(nmiddle--){ - *pdst++ = piQxelArray[0]; - *pdst++ = piQxelArray[1]; - *pdst++ = piQxelArray[2]; - } - switch(rightIndex){ - case 0: - break; - case 1: - *pdst = ((*pdst) & 0xFF000000) | (piQxelArray[0] & 0xFFFFFF); - break; - case 2: - *pdst++ = piQxelArray[0]; - *pdst = ((*pdst) & 0xFFFF0000) | (piQxelArray[1] & 0xFFFF); - break; - case 3: - *pdst++ = piQxelArray[0]; - *pdst++ = piQxelArray[1]; - *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelArray[2] & 0xFF); - break; - } - pdstULC += widthDst; - } - } - } -#else - w = pBox->x2 - pBox->x1; - h = pBox->y2 - pBox->y1; - y = pBox->y1; - pdst = pdstBase + (pBox->y1 * widthDst) + (pBox->x1 >> PWSH); - srcy = y % tileHeight; - -#define StepTile rrop_xor = psrc[srcy]; \ - ++srcy; \ - if (srcy == tileHeight) \ - srcy = 0; - - if ( ((pBox->x1 & PIM) + w) < PPW) - { - maskpartialbits(pBox->x1, w, leftMask); - rightMask = ~leftMask; - while (h--) - { - StepTile - *pdst = (*pdst & rightMask) | (rrop_xor & leftMask); - pdst += widthDst; - } - } - else - { - maskbits(pBox->x1, w, leftMask, rightMask, nmiddle); - - if (leftMask) - { - if (rightMask) - { - Expand (StepTile - RROP_SOLID_MASK(pdst, leftMask); pdst++;, - RROP_SOLID_MASK(pdst, rightMask);, - 1) - } - else - { - Expand (StepTile - RROP_SOLID_MASK(pdst, leftMask); pdst++;, - ;, - 1) - } - } - else - { - if (rightMask) - { - Expand (StepTile - , - RROP_SOLID_MASK(pdst, rightMask);, - 0) - } - else - { - Expand (StepTile - , - ;, - 0) - } - } - } -#endif - pBox++; - } -} diff --git a/cfb/cfbscrinit.c b/cfb/cfbscrinit.c index 83f5cf0a2..ddfb41e6b 100644 --- a/cfb/cfbscrinit.c +++ b/cfb/cfbscrinit.c @@ -88,7 +88,7 @@ cfbSetupScreen(pScreen, pbits, xsize, ysize, dpix, dpiy, width) int dpix, dpiy; /* dots per inch */ int width; /* pixel width of frame buffer */ { - if (!cfbAllocatePrivates(pScreen, (int *) 0, (int *) 0)) + if (!cfbAllocatePrivates(pScreen, NULL)) return FALSE; pScreen->defColormap = FakeClientID(0); /* let CreateDefColormap do whatever it wants for pixels */ @@ -103,8 +103,6 @@ cfbSetupScreen(pScreen, pbits, xsize, ysize, dpix, dpiy, width) pScreen->ChangeWindowAttributes = cfbChangeWindowAttributes; pScreen->RealizeWindow = cfbMapWindow; pScreen->UnrealizeWindow = cfbUnmapWindow; - pScreen->PaintWindowBackground = cfbPaintWindow; - pScreen->PaintWindowBorder = cfbPaintWindow; pScreen->CopyWindow = cfbCopyWindow; pScreen->CreatePixmap = cfbCreatePixmap; pScreen->DestroyPixmap = cfbDestroyPixmap; diff --git a/cfb/cfbtile32.c b/cfb/cfbtile32.c index fb6a10613..90439adc3 100644 --- a/cfb/cfbtile32.c +++ b/cfb/cfbtile32.c @@ -1,5 +1,5 @@ /* - * Fill 32 bit tiled rectangles. Used by both PolyFillRect and PaintWindow. + * Fill 32 bit tiled rectangles. Used by PolyFillRect. * no depth dependencies. */ diff --git a/cfb/cfbunmap.h b/cfb/cfbunmap.h index 61c7fc942..d15c23e30 100644 --- a/cfb/cfbunmap.h +++ b/cfb/cfbunmap.h @@ -74,8 +74,6 @@ #undef cfbDoBitbltOr #undef cfbDoBitbltXor #undef cfbExpandDirectColors -#undef cfbFillBoxSolid -#undef cfbFillBoxTile32 #undef cfbFillBoxTile32sCopy #undef cfbFillBoxTile32sGeneral #undef cfbFillBoxTileOdd @@ -112,7 +110,6 @@ #undef cfbNonTEOps #undef cfbNonTEOps1Rect #undef cfbPadPixmap -#undef cfbPaintWindow #undef cfbPolyFillArcSolidCopy #undef cfbPolyFillArcSolidGeneral #undef cfbPolyFillRect diff --git a/cfb/cfbwindow.c b/cfb/cfbwindow.c index e04b73df2..c4f027b08 100644 --- a/cfb/cfbwindow.c +++ b/cfb/cfbwindow.c @@ -60,19 +60,8 @@ SOFTWARE. #include "cfbmskbits.h" Bool -cfbCreateWindow(pWin) - WindowPtr pWin; +cfbCreateWindow(WindowPtr pWin) { - cfbPrivWin *pPrivWin; - - pPrivWin = cfbGetWindowPrivate(pWin); - pPrivWin->pRotatedBorder = NullPixmap; - pPrivWin->pRotatedBackground = NullPixmap; - pPrivWin->fastBackground = FALSE; - pPrivWin->fastBorder = FALSE; - pPrivWin->oldRotate.x = 0; - pPrivWin->oldRotate.y = 0; - #ifdef PIXMAP_PER_WINDOW /* Setup pointer to Screen pixmap */ pWin->devPrivates[frameWindowPrivateIndex].ptr = @@ -83,17 +72,8 @@ cfbCreateWindow(pWin) } Bool -cfbDestroyWindow(pWin) - WindowPtr pWin; +cfbDestroyWindow(WindowPtr pWin) { - cfbPrivWin *pPrivWin; - - pPrivWin = cfbGetWindowPrivate(pWin); - - if (pPrivWin->pRotatedBorder) - (*pWin->drawable.pScreen->DestroyPixmap)(pPrivWin->pRotatedBorder); - if (pPrivWin->pRotatedBackground) - (*pWin->drawable.pScreen->DestroyPixmap)(pPrivWin->pRotatedBackground); return(TRUE); } @@ -105,47 +85,10 @@ cfbMapWindow(pWindow) return(TRUE); } -/* (x, y) is the upper left corner of the window on the screen - do we really need to pass this? (is it a;ready in pWin->absCorner?) - we only do the rotation for pixmaps that are 32 bits wide (padded -or otherwise.) - cfbChangeWindowAttributes() has already put a copy of the pixmap -in pPrivWin->pRotated* -*/ /*ARGSUSED*/ Bool -cfbPositionWindow(pWin, x, y) - WindowPtr pWin; - int x, y; +cfbPositionWindow(WindowPtr pWin, int x, int y) { - cfbPrivWin *pPrivWin; - int setxy = 0; - - pPrivWin = cfbGetWindowPrivate(pWin); - if (pWin->backgroundState == BackgroundPixmap && pPrivWin->fastBackground) - { - cfbXRotatePixmap(pPrivWin->pRotatedBackground, - pWin->drawable.x - pPrivWin->oldRotate.x); - cfbYRotatePixmap(pPrivWin->pRotatedBackground, - pWin->drawable.y - pPrivWin->oldRotate.y); - setxy = 1; - } - - if (!pWin->borderIsPixel && pPrivWin->fastBorder) - { - while (pWin->backgroundState == ParentRelative) - pWin = pWin->parent; - cfbXRotatePixmap(pPrivWin->pRotatedBorder, - pWin->drawable.x - pPrivWin->oldRotate.x); - cfbYRotatePixmap(pPrivWin->pRotatedBorder, - pWin->drawable.y - pPrivWin->oldRotate.y); - setxy = 1; - } - if (setxy) - { - pPrivWin->oldRotate.x = pWin->drawable.x; - pPrivWin->oldRotate.y = pWin->drawable.y; - } return (TRUE); } @@ -209,129 +152,9 @@ cfbCopyWindow(pWin, ptOldOrg, prgnSrc) REGION_UNINIT(pWin->drawable.pScreen, &rgnDst); } - - -/* swap in correct PaintWindow* routine. If we can use a fast output -routine (i.e. the pixmap is paddable to 32 bits), also pre-rotate a copy -of it in devPrivates[cfbWindowPrivateIndex].ptr. -*/ Bool -cfbChangeWindowAttributes(pWin, mask) - WindowPtr pWin; - unsigned long mask; +cfbChangeWindowAttributes(WindowPtr pWin, unsigned long mask) { - register unsigned long index; - register cfbPrivWin *pPrivWin; - int width; - WindowPtr pBgWin; - - pPrivWin = cfbGetWindowPrivate(pWin); - - /* - * When background state changes from ParentRelative and - * we had previously rotated the fast border pixmap to match - * the parent relative origin, rerotate to match window - */ - if (mask & (CWBackPixmap | CWBackPixel) && - pWin->backgroundState != ParentRelative && - pPrivWin->fastBorder && - (pPrivWin->oldRotate.x != pWin->drawable.x || - pPrivWin->oldRotate.y != pWin->drawable.y)) - { - cfbXRotatePixmap(pPrivWin->pRotatedBorder, - pWin->drawable.x - pPrivWin->oldRotate.x); - cfbYRotatePixmap(pPrivWin->pRotatedBorder, - pWin->drawable.y - pPrivWin->oldRotate.y); - pPrivWin->oldRotate.x = pWin->drawable.x; - pPrivWin->oldRotate.y = pWin->drawable.y; - } - while(mask) - { - index = lowbit (mask); - mask &= ~index; - switch(index) - { - case CWBackPixmap: - if (pWin->backgroundState == None) - { - pPrivWin->fastBackground = FALSE; - } - else if (pWin->backgroundState == ParentRelative) - { - pPrivWin->fastBackground = FALSE; - /* Rotate border to match parent origin */ - if (pPrivWin->pRotatedBorder) { - for (pBgWin = pWin->parent; - pBgWin->backgroundState == ParentRelative; - pBgWin = pBgWin->parent); - cfbXRotatePixmap(pPrivWin->pRotatedBorder, - pBgWin->drawable.x - pPrivWin->oldRotate.x); - cfbYRotatePixmap(pPrivWin->pRotatedBorder, - pBgWin->drawable.y - pPrivWin->oldRotate.y); - pPrivWin->oldRotate.x = pBgWin->drawable.x; - pPrivWin->oldRotate.y = pBgWin->drawable.y; - } - } - else if (((width = (pWin->background.pixmap->drawable.width * PSZ)) - <= PGSZ) && !(width & (width - 1))) - { - cfbCopyRotatePixmap(pWin->background.pixmap, - &pPrivWin->pRotatedBackground, - pWin->drawable.x, - pWin->drawable.y); - if (pPrivWin->pRotatedBackground) - { - pPrivWin->fastBackground = TRUE; - pPrivWin->oldRotate.x = pWin->drawable.x; - pPrivWin->oldRotate.y = pWin->drawable.y; - } - else - { - pPrivWin->fastBackground = FALSE; - } - } - else - { - pPrivWin->fastBackground = FALSE; - } - break; - - case CWBackPixel: - pPrivWin->fastBackground = FALSE; - break; - - case CWBorderPixmap: - if (((width = (pWin->border.pixmap->drawable.width * PSZ)) <= PGSZ) && - !(width & (width - 1))) - { - for (pBgWin = pWin; - pBgWin->backgroundState == ParentRelative; - pBgWin = pBgWin->parent); - cfbCopyRotatePixmap(pWin->border.pixmap, - &pPrivWin->pRotatedBorder, - pBgWin->drawable.x, - pBgWin->drawable.y); - if (pPrivWin->pRotatedBorder) - { - pPrivWin->fastBorder = TRUE; - pPrivWin->oldRotate.x = pBgWin->drawable.x; - pPrivWin->oldRotate.y = pBgWin->drawable.y; - } - else - { - pPrivWin->fastBorder = FALSE; - } - } - else - { - pPrivWin->fastBorder = FALSE; - } - break; - case CWBorderPixel: - pPrivWin->fastBorder = FALSE; - break; - } - } return (TRUE); } |