diff options
Diffstat (limited to 'hw/xgl/xglwindow.c')
-rw-r--r-- | hw/xgl/xglwindow.c | 175 |
1 files changed, 0 insertions, 175 deletions
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) { |