summaryrefslogtreecommitdiff
path: root/hw/xfree86/xf8_32bpp
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2007-09-12 13:58:46 +0000
committerEric Anholt <eric@anholt.net>2007-09-13 00:08:53 +0000
commite4d11e58ce349dfe6af2f73ff341317f9b39684c (patch)
tree05509150343f56d8ec6c88e8da338bf99e6ec03f /hw/xfree86/xf8_32bpp
parent6da39c67905500ab2db00a45cda4a9f756cdde96 (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 'hw/xfree86/xf8_32bpp')
-rw-r--r--hw/xfree86/xf8_32bpp/cfb8_32.h16
-rw-r--r--hw/xfree86/xf8_32bpp/cfbpntwin.c129
-rw-r--r--hw/xfree86/xf8_32bpp/cfbscrinit.c8
-rw-r--r--hw/xfree86/xf8_32bpp/cfbwindow.c5
-rw-r--r--hw/xfree86/xf8_32bpp/xf86overlay.c65
5 files changed, 1 insertions, 222 deletions
diff --git a/hw/xfree86/xf8_32bpp/cfb8_32.h b/hw/xfree86/xf8_32bpp/cfb8_32.h
index 31028a30b..e14096568 100644
--- a/hw/xfree86/xf8_32bpp/cfb8_32.h
+++ b/hw/xfree86/xf8_32bpp/cfb8_32.h
@@ -111,13 +111,6 @@ cfb8_32GetImage (
char *pdstLine
);
-void
-cfb8_32PaintWindow (
- WindowPtr pWin,
- RegionPtr pRegion,
- int what
-);
-
Bool
cfb8_32ScreenInit (
ScreenPtr pScreen,
@@ -135,15 +128,6 @@ cfb8_32FillBoxSolid8 (
unsigned long color
);
-
-void
-cfb8_32FillBoxSolid32 (
- DrawablePtr pDraw,
- int nbox,
- BoxPtr pBox,
- unsigned long color
-);
-
RegionPtr
cfb8_32CopyPlane(
DrawablePtr pSrc,
diff --git a/hw/xfree86/xf8_32bpp/cfbpntwin.c b/hw/xfree86/xf8_32bpp/cfbpntwin.c
index a1b988716..fbf597d22 100644
--- a/hw/xfree86/xf8_32bpp/cfbpntwin.c
+++ b/hw/xfree86/xf8_32bpp/cfbpntwin.c
@@ -23,97 +23,6 @@
#endif
void
-cfb8_32PaintWindow(
- WindowPtr pWin,
- RegionPtr pRegion,
- int what
-){
- WindowPtr pBgWin;
- int xorg, yorg;
-
- 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:
- xorg = pWin->drawable.x;
- 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
- cfb32FillBoxTileOddGeneral ((DrawablePtr)pWin,
- (int)REGION_NUM_RECTS(pRegion), REGION_RECTS(pRegion),
- pWin->background.pixmap, xorg, yorg, GXcopy,
- (pWin->drawable.depth == 24) ? 0x00ffffff : 0xff000000);
- break;
- case BackgroundPixel:
- if(pWin->drawable.depth == 24)
- cfb8_32FillBoxSolid32 ((DrawablePtr)pWin,
- (int)REGION_NUM_RECTS(pRegion),
- REGION_RECTS(pRegion),
- pWin->background.pixel);
- else
- cfb8_32FillBoxSolid8 ((DrawablePtr)pWin,
- (int)REGION_NUM_RECTS(pRegion),
- REGION_RECTS(pRegion),
- pWin->background.pixel);
- break;
- }
- break;
- case PW_BORDER:
- if (pWin->borderIsPixel) {
- if(pWin->drawable.depth == 24) {
- cfb8_32FillBoxSolid32 ((DrawablePtr)pWin,
- (int)REGION_NUM_RECTS(pRegion),
- REGION_RECTS(pRegion),
- pWin->border.pixel);
- } else
- cfb8_32FillBoxSolid8 ((DrawablePtr)pWin,
- (int)REGION_NUM_RECTS(pRegion),
- REGION_RECTS(pRegion),
- pWin->border.pixel);
- } else {
- 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
- cfb32FillBoxTileOddGeneral ((DrawablePtr)pWin,
- (int)REGION_NUM_RECTS(pRegion), REGION_RECTS(pRegion),
- pWin->border.pixmap, xorg, yorg, GXcopy,
- (pWin->drawable.depth == 24) ? 0x00ffffff : 0xff000000);
- }
- break;
- }
-
-}
-
-void
cfb8_32FillBoxSolid8(
DrawablePtr pDraw,
int nbox,
@@ -140,41 +49,3 @@ cfb8_32FillBoxSolid8(
pbox++;
}
}
-
-
-void
-cfb8_32FillBoxSolid32(
- DrawablePtr pDraw,
- int nbox,
- BoxPtr pbox,
- unsigned long color
-){
- CARD8 *ptr, *data;
- CARD16 *ptr2, *data2;
- int pitch, pitch2;
- int height, width, i;
- CARD8 c = (CARD8)(color >> 16);
- CARD16 c2 = (CARD16)color;
-
- cfbGetByteWidthAndPointer(pDraw, pitch, ptr);
- cfbGetTypedWidthAndPointer(pDraw, pitch2, ptr2, CARD16, CARD16);
- ptr += 2; /* point to the third byte */
-
- while(nbox--) {
- data = ptr + (pbox->y1 * pitch) + (pbox->x1 << 2);
- data2 = ptr2 + (pbox->y1 * pitch2) + (pbox->x1 << 1);
- width = (pbox->x2 - pbox->x1) << 1;
- height = pbox->y2 - pbox->y1;
-
- while(height--) {
- for(i = 0; i < width; i+=2) {
- data[i << 1] = c;
- data2[i] = c2;
- }
- data += pitch;
- data2 += pitch2;
- }
- pbox++;
- }
-}
-
diff --git a/hw/xfree86/xf8_32bpp/cfbscrinit.c b/hw/xfree86/xf8_32bpp/cfbscrinit.c
index 29dc6691f..5e2657f2b 100644
--- a/hw/xfree86/xf8_32bpp/cfbscrinit.c
+++ b/hw/xfree86/xf8_32bpp/cfbscrinit.c
@@ -56,11 +56,7 @@ cfb8_32AllocatePrivates(ScreenPtr pScreen)
/* All cfb will have the same GC and Window private indicies */
- if(!mfbAllocatePrivates(pScreen,&cfbWindowPrivateIndex, &cfbGCPrivateIndex))
- return FALSE;
-
- /* The cfb indicies are the mfb indicies. Reallocating them resizes them */
- if(!AllocateWindowPrivate(pScreen,cfbWindowPrivateIndex,sizeof(cfbPrivWin)))
+ if(!mfbAllocatePrivates(pScreen, &cfbGCPrivateIndex))
return FALSE;
if(!AllocateGCPrivate(pScreen, cfbGCPrivateIndex, sizeof(cfbPrivGC)))
@@ -109,8 +105,6 @@ cfb8_32SetupScreen(
pScreen->ChangeWindowAttributes = cfb8_32ChangeWindowAttributes;
pScreen->RealizeWindow = cfb32MapWindow; /* OK */
pScreen->UnrealizeWindow = cfb32UnmapWindow; /* OK */
- pScreen->PaintWindowBackground = cfb8_32PaintWindow;
- pScreen->PaintWindowBorder = cfb8_32PaintWindow;
pScreen->CopyWindow = cfb8_32CopyWindow;
pScreen->CreatePixmap = cfb32CreatePixmap; /* OK */
pScreen->DestroyPixmap = cfb32DestroyPixmap; /* OK */
diff --git a/hw/xfree86/xf8_32bpp/cfbwindow.c b/hw/xfree86/xf8_32bpp/cfbwindow.c
index ce741cb55..787cbdec6 100644
--- a/hw/xfree86/xf8_32bpp/cfbwindow.c
+++ b/hw/xfree86/xf8_32bpp/cfbwindow.c
@@ -27,11 +27,6 @@
Bool
cfb8_32CreateWindow(WindowPtr pWin)
{
- cfbPrivWin *pPrivWin = cfbGetWindowPrivate(pWin);
-
- pPrivWin->fastBackground = FALSE;
- pPrivWin->fastBorder = FALSE;
-
pWin->drawable.bitsPerPixel = 32;
return TRUE;
}
diff --git a/hw/xfree86/xf8_32bpp/xf86overlay.c b/hw/xfree86/xf8_32bpp/xf86overlay.c
index c5585ca6d..3cd351ad0 100644
--- a/hw/xfree86/xf8_32bpp/xf86overlay.c
+++ b/hw/xfree86/xf8_32bpp/xf86overlay.c
@@ -34,7 +34,6 @@ static Bool OverlayCreateGC(GCPtr pGC);
static Bool OverlayDestroyPixmap(PixmapPtr);
static PixmapPtr OverlayCreatePixmap(ScreenPtr, int, int, int);
static Bool OverlayChangeWindowAttributes(WindowPtr, unsigned long);
-static void OverlayPaintWindow(WindowPtr, RegionPtr, int);
/** Funcs **/
static void OverlayValidateGC(GCPtr, unsigned long, DrawablePtr);
@@ -159,8 +158,6 @@ typedef struct {
CreatePixmapProcPtr CreatePixmap;
DestroyPixmapProcPtr DestroyPixmap;
ChangeWindowAttributesProcPtr ChangeWindowAttributes;
- PaintWindowBackgroundProcPtr PaintWindowBackground;
- PaintWindowBorderProcPtr PaintWindowBorder;
int LockPrivate;
} OverlayScreenRec, *OverlayScreenPtr;
@@ -284,16 +281,12 @@ xf86Overlay8Plus32Init (ScreenPtr pScreen)
pScreenPriv->CreatePixmap = pScreen->CreatePixmap;
pScreenPriv->DestroyPixmap = pScreen->DestroyPixmap;
pScreenPriv->ChangeWindowAttributes = pScreen->ChangeWindowAttributes;
- pScreenPriv->PaintWindowBackground = pScreen->PaintWindowBackground;
- pScreenPriv->PaintWindowBorder = pScreen->PaintWindowBorder;
pScreen->CreateGC = OverlayCreateGC;
pScreen->CloseScreen = OverlayCloseScreen;
pScreen->CreatePixmap = OverlayCreatePixmap;
pScreen->DestroyPixmap = OverlayDestroyPixmap;
pScreen->ChangeWindowAttributes = OverlayChangeWindowAttributes;
- pScreen->PaintWindowBackground = OverlayPaintWindow;
- pScreen->PaintWindowBorder = OverlayPaintWindow;
pScreenPriv->LockPrivate = 0;
@@ -402,8 +395,6 @@ OverlayCloseScreen (int i, ScreenPtr pScreen)
pScreen->CreatePixmap = pScreenPriv->CreatePixmap;
pScreen->DestroyPixmap = pScreenPriv->DestroyPixmap;
pScreen->ChangeWindowAttributes = pScreenPriv->ChangeWindowAttributes;
- pScreen->PaintWindowBackground = pScreenPriv->PaintWindowBackground;
- pScreen->PaintWindowBorder = pScreenPriv->PaintWindowBorder;
xfree ((pointer) pScreenPriv);
@@ -435,62 +426,6 @@ OverlayChangeWindowAttributes (WindowPtr pWin, unsigned long mask)
return result;
}
-static void
-OverlayPaintWindow(
- WindowPtr pWin,
- RegionPtr pReg,
- int what
-){
- ScreenPtr pScreen = pWin->drawable.pScreen;
- OverlayScreenPtr pScreenPriv = OVERLAY_GET_SCREEN_PRIVATE(pScreen);
- OverlayPixmapPtr pixPriv;
- PixmapPtr oldPix = NULL;
-
- if(what == PW_BACKGROUND) {
- if(pWin->drawable.depth == 8) {
- if(pWin->backgroundState == ParentRelative) {
- do {
- pWin = pWin->parent;
- } while (pWin->backgroundState == ParentRelative);
- }
-
- if(pWin->backgroundState == BackgroundPixmap) {
- oldPix = pWin->background.pixmap;
- pixPriv = OVERLAY_GET_PIXMAP_PRIVATE(oldPix);
- /* have to do this here because alot of applications
- incorrectly assume changes to a pixmap that is
- a window background go into effect immediatedly */
- if(pixPriv->dirty & IS_DIRTY)
- OverlayRefreshPixmap(pWin->background.pixmap);
- pWin->background.pixmap = pixPriv->pix32;
- }
- }
-
- pScreen->PaintWindowBackground = pScreenPriv->PaintWindowBackground;
- (*pScreen->PaintWindowBackground) (pWin, pReg, what);
- pScreen->PaintWindowBackground = OverlayPaintWindow;
-
- if(oldPix)
- pWin->background.pixmap = oldPix;
- } else {
- if((pWin->drawable.depth == 8) && !pWin->borderIsPixel) {
- oldPix = pWin->border.pixmap;
- pixPriv = OVERLAY_GET_PIXMAP_PRIVATE(oldPix);
- if(pixPriv->dirty & IS_DIRTY)
- OverlayRefreshPixmap(pWin->border.pixmap);
- pWin->border.pixmap = pixPriv->pix32;
- }
-
- pScreen->PaintWindowBorder = pScreenPriv->PaintWindowBorder;
- (*pScreen->PaintWindowBorder) (pWin, pReg, what);
- pScreen->PaintWindowBorder = OverlayPaintWindow;
-
- if(oldPix)
- pWin->border.pixmap = oldPix;
- }
-}
-
-
/*********************** GC Funcs *****************************/