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 /hw/xgl | |
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 'hw/xgl')
-rw-r--r-- | hw/xgl/glx/xglx.c | 2 | ||||
-rw-r--r-- | hw/xgl/xgl.h | 12 | ||||
-rw-r--r-- | hw/xgl/xglscreen.c | 2 | ||||
-rw-r--r-- | hw/xgl/xglwindow.c | 175 |
4 files changed, 1 insertions, 190 deletions
diff --git a/hw/xgl/glx/xglx.c b/hw/xgl/glx/xglx.c index 92974f0d4..87d8a4ea8 100644 --- a/hw/xgl/glx/xglx.c +++ b/hw/xgl/glx/xglx.c @@ -927,7 +927,7 @@ xglxWindowExposures (WindowPtr pWin, REGION_SUBTRACT (pScreen, &ClipList, &pWin->borderClip, &pWin->winSize); REGION_INTERSECT (pScreen, &ClipList, &ClipList, (RegionPtr) pReg); - (*pScreen->PaintWindowBorder) (pWin, &ClipList, PW_BORDER); + miPaintWindow(pWin, &ClipList, PW_BORDER); REGION_UNINIT (pScreen, &ClipList); } diff --git a/hw/xgl/xgl.h b/hw/xgl/xgl.h index 5710bbf5a..7bca1d53e 100644 --- a/hw/xgl/xgl.h +++ b/hw/xgl/xgl.h @@ -272,8 +272,6 @@ typedef struct _xglScreen { CreateWindowProcPtr CreateWindow; DestroyWindowProcPtr DestroyWindow; ChangeWindowAttributesProcPtr ChangeWindowAttributes; - PaintWindowBackgroundProcPtr PaintWindowBackground; - PaintWindowBorderProcPtr PaintWindowBorder; CopyWindowProcPtr CopyWindow; CreateGCProcPtr CreateGC; CloseScreenProcPtr CloseScreen; @@ -1090,16 +1088,6 @@ xglCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc); -void -xglPaintWindowBackground (WindowPtr pWin, - RegionPtr pRegion, - int what); - -void -xglPaintWindowBorder (WindowPtr pWin, - RegionPtr pRegion, - int what); - PixmapPtr xglGetWindowPixmap (WindowPtr pWin); diff --git a/hw/xgl/xglscreen.c b/hw/xgl/xglscreen.c index e46869770..9b7297b91 100644 --- a/hw/xgl/xglscreen.c +++ b/hw/xgl/xglscreen.c @@ -210,8 +210,6 @@ xglScreenInit (ScreenPtr pScreen) XGL_SCREEN_WRAP (CreateWindow, xglCreateWindow); XGL_SCREEN_WRAP (DestroyWindow, xglDestroyWindow); XGL_SCREEN_WRAP (ChangeWindowAttributes, xglChangeWindowAttributes); - XGL_SCREEN_WRAP (PaintWindowBackground, xglPaintWindowBackground); - XGL_SCREEN_WRAP (PaintWindowBorder, xglPaintWindowBorder); XGL_SCREEN_WRAP (CreateGC, xglCreateGC); diff --git a/hw/xgl/xglwindow.c b/hw/xgl/xglwindow.c index 967d10f77..393f01df1 100644 --- a/hw/xgl/xglwindow.c +++ b/hw/xgl/xglwindow.c @@ -141,181 +141,6 @@ xglCopyWindow (WindowPtr pWin, REGION_UNINIT (pWin->drawable.pScreen, &rgnDst); } -static Bool -xglFillRegionSolid (DrawablePtr pDrawable, - RegionPtr pRegion, - Pixel pixel) -{ - glitz_pixel_format_t format; - glitz_surface_t *solid; - glitz_buffer_t *buffer; - BoxPtr pExtent; - Bool ret; - - XGL_DRAWABLE_PIXMAP_PRIV (pDrawable); - XGL_SCREEN_PRIV (pDrawable->pScreen); - - if (!xglPrepareTarget (pDrawable)) - return FALSE; - - solid = glitz_surface_create (pScreenPriv->drawable, - pPixmapPriv->pVisual->format.surface, - 1, 1, 0, NULL); - if (!solid) - return FALSE; - - glitz_surface_set_fill (solid, GLITZ_FILL_REPEAT); - - format.fourcc = GLITZ_FOURCC_RGB; - format.masks = pPixmapPriv->pVisual->pPixel->masks; - format.xoffset = 0; - format.skip_lines = 0; - format.bytes_per_line = sizeof (CARD32); - format.scanline_order = GLITZ_PIXEL_SCANLINE_ORDER_BOTTOM_UP; - - buffer = glitz_buffer_create_for_data (&pixel); - - glitz_set_pixels (solid, 0, 0, 1, 1, &format, buffer); - - glitz_buffer_destroy (buffer); - - pExtent = REGION_EXTENTS (pDrawable->pScreen, pRegion); - - ret = xglSolid (pDrawable, - GLITZ_OPERATOR_SRC, - solid, - NULL, - pExtent->x1, pExtent->y1, - pExtent->x2 - pExtent->x1, pExtent->y2 - pExtent->y1, - REGION_RECTS (pRegion), - REGION_NUM_RECTS (pRegion)); - - glitz_surface_destroy (solid); - - return ret; -} - -static Bool -xglFillRegionTiled (DrawablePtr pDrawable, - RegionPtr pRegion, - PixmapPtr pTile, - int tileX, - int tileY) -{ - BoxPtr pExtent; - - pExtent = REGION_EXTENTS (pDrawable->pScreen, pRegion); - - if (xglTile (pDrawable, - GLITZ_OPERATOR_SRC, - pTile, - tileX, tileY, - NULL, - pExtent->x1, pExtent->y1, - pExtent->x2 - pExtent->x1, pExtent->y2 - pExtent->y1, - REGION_RECTS (pRegion), - REGION_NUM_RECTS (pRegion))) - return TRUE; - - return FALSE; -} - -void -xglPaintWindowBackground (WindowPtr pWin, - RegionPtr pRegion, - int what) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - - XGL_SCREEN_PRIV (pScreen); - - switch (pWin->backgroundState) { - case None: - return; - case ParentRelative: - do { - pWin = pWin->parent; - } while (pWin->backgroundState == ParentRelative); - - (*pScreen->PaintWindowBackground) (pWin, pRegion, what); - return; - case BackgroundPixmap: - if (xglFillRegionTiled (&pWin->drawable, - pRegion, - pWin->background.pixmap, - -pWin->drawable.x, - -pWin->drawable.y)) - { - xglAddCurrentBitDamage (&pWin->drawable); - return; - } - - if (!xglSyncBits (&pWin->background.pixmap->drawable, NullBox)) - FatalError (XGL_SW_FAILURE_STRING); - break; - case BackgroundPixel: - if (xglFillRegionSolid (&pWin->drawable, - pRegion, - pWin->background.pixel)) - { - xglAddCurrentBitDamage (&pWin->drawable); - return; - } - break; - } - - XGL_WINDOW_FALLBACK_PROLOGUE (pWin, PaintWindowBackground); - (*pScreen->PaintWindowBackground) (pWin, pRegion, what); - XGL_WINDOW_FALLBACK_EPILOGUE (pWin, pRegion, PaintWindowBackground, - xglPaintWindowBackground); -} - -void -xglPaintWindowBorder (WindowPtr pWin, - RegionPtr pRegion, - int what) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - - XGL_SCREEN_PRIV (pScreen); - - if (pWin->borderIsPixel) - { - if (xglFillRegionSolid (&pWin->drawable, - pRegion, - pWin->border.pixel)) - { - xglAddCurrentBitDamage (&pWin->drawable); - return; - } - } - else - { - WindowPtr pBgWin = pWin; - - while (pBgWin->backgroundState == ParentRelative) - pBgWin = pBgWin->parent; - - if (xglFillRegionTiled (&pBgWin->drawable, - pRegion, - pWin->border.pixmap, - -pBgWin->drawable.x, - -pBgWin->drawable.y)) - { - xglAddCurrentBitDamage (&pWin->drawable); - return; - } - - if (!xglSyncBits (&pWin->border.pixmap->drawable, NullBox)) - FatalError (XGL_SW_FAILURE_STRING); - } - - XGL_WINDOW_FALLBACK_PROLOGUE (pWin, PaintWindowBorder); - (*pScreen->PaintWindowBorder) (pWin, pRegion, what); - XGL_WINDOW_FALLBACK_EPILOGUE (pWin, pRegion, PaintWindowBorder, - xglPaintWindowBorder); -} - PixmapPtr xglGetWindowPixmap (WindowPtr pWin) { |