summaryrefslogtreecommitdiff
path: root/miext/rootless
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 /miext/rootless
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 'miext/rootless')
-rw-r--r--miext/rootless/rootlessCommon.h2
-rw-r--r--miext/rootless/rootlessScreen.c2
-rw-r--r--miext/rootless/rootlessWindow.c98
-rw-r--r--miext/rootless/rootlessWindow.h4
-rw-r--r--miext/rootless/safeAlpha/Makefile.am3
-rw-r--r--miext/rootless/safeAlpha/safeAlpha.h2
-rw-r--r--miext/rootless/safeAlpha/safeAlphaWindow.c177
7 files changed, 4 insertions, 284 deletions
diff --git a/miext/rootless/rootlessCommon.h b/miext/rootless/rootlessCommon.h
index 3bf6af02f..66b930d36 100644
--- a/miext/rootless/rootlessCommon.h
+++ b/miext/rootless/rootlessCommon.h
@@ -86,8 +86,6 @@ typedef struct _RootlessScreenRec {
ChangeWindowAttributesProcPtr ChangeWindowAttributes;
CreateGCProcPtr CreateGC;
- PaintWindowBackgroundProcPtr PaintWindowBackground;
- PaintWindowBorderProcPtr PaintWindowBorder;
CopyWindowProcPtr CopyWindow;
GetImageProcPtr GetImage;
SourceValidateProcPtr SourceValidate;
diff --git a/miext/rootless/rootlessScreen.c b/miext/rootless/rootlessScreen.c
index 700de6edc..0bcd2f7f1 100644
--- a/miext/rootless/rootlessScreen.c
+++ b/miext/rootless/rootlessScreen.c
@@ -598,8 +598,6 @@ RootlessWrap(ScreenPtr pScreen)
WRAP(CreateScreenResources);
WRAP(CloseScreen);
WRAP(CreateGC);
- WRAP(PaintWindowBackground);
- WRAP(PaintWindowBorder);
WRAP(CopyWindow);
WRAP(GetImage);
WRAP(SourceValidate);
diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c
index 30b7daaab..f7126590b 100644
--- a/miext/rootless/rootlessWindow.c
+++ b/miext/rootless/rootlessWindow.c
@@ -217,10 +217,8 @@ RootlessSetShape(WindowPtr pWin)
/* Disallow ParentRelative background on top-level windows
- because the root window doesn't really have the right background
- and fb will try to draw on the root instead of on the window.
- ParentRelative prevention is also in PaintWindowBackground/Border()
- so it is no longer really needed here. */
+ because the root window doesn't really have the right background.
+ */
Bool
RootlessChangeWindowAttributes(WindowPtr pWin, unsigned long vmask)
{
@@ -670,7 +668,7 @@ RootlessResizeCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg,
/*
* RootlessCopyWindow
* Update *new* location of window. Old location is redrawn with
- * PaintWindowBackground/Border. Cloned from fbCopyWindow.
+ * miPaintWindow. Cloned from fbCopyWindow.
* The original always draws on the root pixmap, which we don't have.
* Instead, draw on the parent window's pixmap.
*/
@@ -1326,96 +1324,6 @@ out:
}
}
-
-/*
- * SetPixmapOfAncestors
- * Set the Pixmaps on all ParentRelative windows up the ancestor chain.
- */
-static void
-SetPixmapOfAncestors(WindowPtr pWin)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- WindowPtr topWin = TopLevelParent(pWin);
- RootlessWindowRec *topWinRec = WINREC(topWin);
-
- while (pWin->backgroundState == ParentRelative) {
- if (pWin == topWin) {
- // disallow ParentRelative background state on top level
- XID pixel = 0;
- ChangeWindowAttributes(pWin, CWBackPixel, &pixel, serverClient);
- RL_DEBUG_MSG("Cleared ParentRelative on 0x%x.\n", pWin);
- break;
- }
-
- pWin = pWin->parent;
- pScreen->SetWindowPixmap(pWin, topWinRec->pixmap);
- }
-}
-
-
-/*
- * RootlessPaintWindowBackground
- */
-void
-RootlessPaintWindowBackground(WindowPtr pWin, RegionPtr pRegion, int what)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
-
- if (IsRoot(pWin))
- return;
-
- RL_DEBUG_MSG("paintwindowbackground start (win 0x%x, framed %i) ",
- pWin, IsFramedWindow(pWin));
-
- if (IsFramedWindow(pWin)) {
- RootlessStartDrawing(pWin);
- RootlessDamageRegion(pWin, pRegion);
-
- // For ParentRelative windows, we have to make sure the window
- // pixmap is set correctly all the way up the ancestor chain.
- if (pWin->backgroundState == ParentRelative) {
- SetPixmapOfAncestors(pWin);
- }
- }
-
- SCREEN_UNWRAP(pScreen, PaintWindowBackground);
- pScreen->PaintWindowBackground(pWin, pRegion, what);
- SCREEN_WRAP(pScreen, PaintWindowBackground);
-
- RL_DEBUG_MSG("paintwindowbackground end\n");
-}
-
-
-/*
- * RootlessPaintWindowBorder
- */
-void
-RootlessPaintWindowBorder(WindowPtr pWin, RegionPtr pRegion, int what)
-{
- RL_DEBUG_MSG("paintwindowborder start (win 0x%x) ", pWin);
-
- if (IsFramedWindow(pWin)) {
- RootlessStartDrawing(pWin);
- RootlessDamageRegion(pWin, pRegion);
-
- // For ParentRelative windows with tiled borders, we have to make
- // sure the window pixmap is set correctly all the way up the
- // ancestor chain.
- if (!pWin->borderIsPixel &&
- pWin->backgroundState == ParentRelative)
- {
- SetPixmapOfAncestors(pWin);
- }
- }
-
- SCREEN_UNWRAP(pWin->drawable.pScreen, PaintWindowBorder);
- pWin->drawable.pScreen->PaintWindowBorder(pWin, pRegion, what);
- SCREEN_WRAP(pWin->drawable.pScreen, PaintWindowBorder);
-
- RL_DEBUG_MSG("paintwindowborder end\n");
-}
-
-
/*
* RootlessChangeBorderWidth
* FIXME: untested!
diff --git a/miext/rootless/rootlessWindow.h b/miext/rootless/rootlessWindow.h
index 093a2b384..9573068b4 100644
--- a/miext/rootless/rootlessWindow.h
+++ b/miext/rootless/rootlessWindow.h
@@ -54,10 +54,6 @@ void RootlessMoveWindow(WindowPtr pWin,int x,int y,WindowPtr pSib,VTKind kind);
void RootlessResizeWindow(WindowPtr pWin, int x, int y,
unsigned int w, unsigned int h, WindowPtr pSib);
void RootlessReparentWindow(WindowPtr pWin, WindowPtr pPriorParent);
-void RootlessPaintWindowBackground(WindowPtr pWin, RegionPtr pRegion,
- int what);
-void RootlessPaintWindowBorder(WindowPtr pWin, RegionPtr pRegion,
- int what);
void RootlessChangeBorderWidth(WindowPtr pWin, unsigned int width);
#endif
diff --git a/miext/rootless/safeAlpha/Makefile.am b/miext/rootless/safeAlpha/Makefile.am
index 7592c1840..823fb777d 100644
--- a/miext/rootless/safeAlpha/Makefile.am
+++ b/miext/rootless/safeAlpha/Makefile.am
@@ -6,7 +6,6 @@ INCLUDES = -I$(srcdir)/.. -I$(top_srcdir)/hw/xfree86/os-support
noinst_LTLIBRARIES = libsafeAlpha.la
-libsafeAlpha_la_SOURCES = safeAlphaPicture.c \
- safeAlphaWindow.c
+libsafeAlpha_la_SOURCES = safeAlphaPicture.c
EXTRA_DIST = safeAlpha.h
diff --git a/miext/rootless/safeAlpha/safeAlpha.h b/miext/rootless/safeAlpha/safeAlpha.h
index bd1ce3203..9b9b39c92 100644
--- a/miext/rootless/safeAlpha/safeAlpha.h
+++ b/miext/rootless/safeAlpha/safeAlpha.h
@@ -32,8 +32,6 @@
#include "picturestr.h"
-void SafeAlphaPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what);
-
#ifdef RENDER
void
SafeAlphaComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
diff --git a/miext/rootless/safeAlpha/safeAlphaWindow.c b/miext/rootless/safeAlpha/safeAlphaWindow.c
deleted file mode 100644
index 5226782fe..000000000
--- a/miext/rootless/safeAlpha/safeAlphaWindow.c
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Specialized window functions to protect the alpha channel
- */
-/*
- * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * 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 ABOVE LISTED COPYRIGHT HOLDER(S) 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(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* Portions of this file are based on fbwindow.c, which contains the
- * following copyright:
- *
- * Copyright © 1998 Keith Packard
- */
-
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-#include "fb.h"
-#include "safeAlpha.h"
-#include "rootlessCommon.h"
-
-#ifdef PANORAMIX
-#include "panoramiX.h"
-#include "panoramiXsrv.h"
-#endif
-
-/*
- * SafeAlphaFillRegionTiled
- * Fill using a tile while leaving the alpha channel untouched.
- * Based on fbfillRegionTiled.
- */
-void
-SafeAlphaFillRegionTiled(
- DrawablePtr pDrawable,
- RegionPtr pRegion,
- PixmapPtr pTile)
-{
- FbBits *dst;
- FbStride dstStride;
- int dstBpp;
- int dstXoff, dstYoff;
- FbBits *tile;
- FbStride tileStride;
- int tileBpp;
- int tileXoff, tileYoff; /* XXX assumed to be zero */
- int tileWidth, tileHeight;
- int n = REGION_NUM_RECTS(pRegion);
- BoxPtr pbox = REGION_RECTS(pRegion);
- int xRot = pDrawable->x;
- int yRot = pDrawable->y;
- FbBits planeMask;
-
-#ifdef PANORAMIX
- if(!noPanoramiXExtension)
- {
- int index = pDrawable->pScreen->myNum;
- if(&WindowTable[index]->drawable == pDrawable)
- {
- xRot -= panoramiXdataPtr[index].x;
- yRot -= panoramiXdataPtr[index].y;
- }
- }
-#endif
- fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
- fbGetDrawable (&pTile->drawable, tile, tileStride, tileBpp,
- tileXoff, tileYoff);
- tileWidth = pTile->drawable.width;
- tileHeight = pTile->drawable.height;
- xRot += dstXoff;
- yRot += dstYoff;
- planeMask = FB_ALLONES & ~RootlessAlphaMask(dstBpp);
-
- while (n--)
- {
- fbTile (dst + (pbox->y1 + dstYoff) * dstStride,
- dstStride,
- (pbox->x1 + dstXoff) * dstBpp,
- (pbox->x2 - pbox->x1) * dstBpp,
- pbox->y2 - pbox->y1,
- tile,
- tileStride,
- tileWidth * dstBpp,
- tileHeight,
- GXcopy,
- planeMask,
- dstBpp,
- xRot * dstBpp,
- yRot - pbox->y1);
- pbox++;
- }
-}
-
-
-/*
- * SafeAlphaPaintWindow
- * Paint the window while filling in the alpha channel with all on.
- * We can't use fbPaintWindow because it zeros the alpha channel.
- */
-void
-SafeAlphaPaintWindow(
- WindowPtr pWin,
- RegionPtr pRegion,
- int what)
-{
- 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:
- SafeAlphaFillRegionTiled (&pWin->drawable,
- pRegion,
- pWin->background.pixmap);
- break;
- case BackgroundPixel:
- {
- Pixel pixel = pWin->background.pixel |
- RootlessAlphaMask(pWin->drawable.bitsPerPixel);
- fbFillRegionSolid (&pWin->drawable, pRegion, 0,
- fbReplicatePixel (pixel,
- pWin->drawable.bitsPerPixel));
- break;
- }
- }
- break;
- case PW_BORDER:
- if (pWin->borderIsPixel)
- {
- Pixel pixel = pWin->border.pixel |
- RootlessAlphaMask(pWin->drawable.bitsPerPixel);
- fbFillRegionSolid (&pWin->drawable, pRegion, 0,
- fbReplicatePixel (pixel,
- pWin->drawable.bitsPerPixel));
- }
- else
- {
- WindowPtr pBgWin;
- for (pBgWin = pWin; pBgWin->backgroundState == ParentRelative;
- pBgWin = pBgWin->parent);
-
- SafeAlphaFillRegionTiled (&pBgWin->drawable,
- pRegion,
- pWin->border.pixmap);
- }
- break;
- }
- fbValidateDrawable (&pWin->drawable);
-}