static void
XAAOverPaintWindow(
    WindowPtr   pWin,
    RegionPtr   pRegion,
    int         what
){
    ScreenPtr pScreen = pWin->drawable.pScreen;
    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pScreen);
    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
    ScrnInfoPtr pScrn = infoRec->pScrn;

    if(pScrn->vtSema) {
	if(what == PW_BACKGROUND) {
	    SWITCH_DEPTH(pWin->drawable.depth);
	    (*infoRec->PaintWindowBackground)(pWin, pRegion, what);
	    return;
	} else {
	    if(pWin->drawable.bitsPerPixel == 8) {
		SWITCH_DEPTH(8);
		(*infoRec->PaintWindowBorder)(pWin, pRegion, what);
		return;
	    } else if (infoRec->FillSolidRects)  {
		SWITCH_DEPTH(8);
		(*infoRec->FillSolidRects)(pScrn, pScrn->colorKey, GXcopy, 
			~0, REGION_NUM_RECTS(pRegion), REGION_RECTS(pRegion));

		SWITCH_DEPTH(pWin->drawable.depth);
		(*infoRec->PaintWindowBorder)(pWin, pRegion, what);
		return;
	    } 
	}

	if(infoRec->NeedToSync) {
	    (*infoRec->Sync)(infoRec->pScrn);
	    infoRec->NeedToSync = FALSE;
	}
    }

    if(what == PW_BACKGROUND) {
	XAA_SCREEN_PROLOGUE (pScreen, PaintWindowBackground);
	(*pScreen->PaintWindowBackground) (pWin, pRegion, what);
	XAA_SCREEN_EPILOGUE(pScreen, PaintWindowBackground, XAAOverPaintWindow);
    } else {
	XAA_SCREEN_PROLOGUE (pScreen, PaintWindowBorder);
	(*pScreen->PaintWindowBorder) (pWin, pRegion, what);
	XAA_SCREEN_EPILOGUE(pScreen, PaintWindowBorder, XAAOverPaintWindow);
    }
}
void
XAAOverWindowExposures(
   WindowPtr pWin,
   RegionPtr pReg,
   RegionPtr pOtherReg
){
    ScreenPtr pScreen = pWin->drawable.pScreen;
    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);

    if((pWin->drawable.bitsPerPixel != 8) && infoRec->pScrn->vtSema) {
	if(REGION_NUM_RECTS(pReg) && infoRec->FillSolidRects) {
	    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pScreen);

	    SWITCH_DEPTH(8);
	    (*infoRec->FillSolidRects)(infoRec->pScrn, 
		infoRec->pScrn->colorKey, GXcopy, ~0,
			REGION_NUM_RECTS(pReg), REGION_RECTS(pReg));
	    miWindowExposures(pWin, pReg, pOtherReg);
	    return;
	} else if(infoRec->NeedToSync) {
            (*infoRec->Sync)(infoRec->pScrn);
            infoRec->NeedToSync = FALSE;
	}
    } 

    XAA_SCREEN_PROLOGUE (pScreen, WindowExposures);
    (*pScreen->WindowExposures) (pWin, pReg, pOtherReg);
    XAA_SCREEN_EPILOGUE(pScreen, WindowExposures, XAAOverWindowExposures);
}
Exemple #3
0
static void
XAAOverPolyFillArcSolid(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs)
{
    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);

    SWITCH_DEPTH(pGC->depth);

    (*pOverPriv->PolyFillArcSolid) (pDraw, pGC, narcs, parcs);
}
Exemple #4
0
static void
XAAOverPolySegmentThinDashed(DrawablePtr pDraw,
                             GCPtr pGC, int nseg, xSegment * pSeg)
{
    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);

    SWITCH_DEPTH(pGC->depth);

    (*pOverPriv->PolySegmentThinDashed) (pDraw, pGC, nseg, pSeg);
}
Exemple #5
0
static void
XAAOverPolylinesThinDashed(DrawablePtr pDraw,
                           GCPtr pGC, int mode, int npt, DDXPointPtr pPts)
{
    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);

    SWITCH_DEPTH(pGC->depth);

    (*pOverPriv->PolylinesThinDashed) (pDraw, pGC, mode, npt, pPts);
}
Exemple #6
0
static void
XAAOverImageText8NonTE(DrawablePtr pDraw,
                       GCPtr pGC, int x, int y, int count, char *chars)
{
    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);

    SWITCH_DEPTH(pGC->depth);

    (*pOverPriv->ImageText8NonTE) (pDraw, pGC, x, y, count, chars);
}
Exemple #7
0
static int
XAAOverPolyText16TE(DrawablePtr pDraw,
                    GCPtr pGC, int x, int y, int count, unsigned short *chars)
{
    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);

    SWITCH_DEPTH(pGC->depth);

    return (*pOverPriv->PolyText16TE) (pDraw, pGC, x, y, count, chars);
}
Exemple #8
0
static void
XAAOverPolyFillRectTiled(DrawablePtr pDraw,
                         GCPtr pGC, int nrectFill, xRectangle *prectInit)
{
    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);

    SWITCH_DEPTH(pGC->depth);

    (*pOverPriv->PolyFillRectTiled) (pDraw, pGC, nrectFill, prectInit);
}
Exemple #9
0
static void
XAAOverPolyRectangleThinSolid(DrawablePtr pDraw,
                              GCPtr pGC, int nRectsInit, xRectangle *pRectsInit)
{
    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);

    SWITCH_DEPTH(pGC->depth);

    (*pOverPriv->PolyRectangleThinSolid) (pDraw, pGC, nRectsInit, pRectsInit);
}
Exemple #10
0
static void
XAAOverFillPolygonTiled(DrawablePtr pDraw,
                        GCPtr pGC,
                        int shape, int mode, int count, DDXPointPtr ptsIn)
{
    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);

    SWITCH_DEPTH(pGC->depth);

    (*pOverPriv->FillPolygonTiled) (pDraw, pGC, shape, mode, count, ptsIn);
}
Exemple #11
0
static void
XAAOverFillSpansTiled(DrawablePtr pDraw,
                      GCPtr pGC,
                      int nInit, DDXPointPtr ppt, int *pwidth, int fSorted)
{
    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);

    SWITCH_DEPTH(pGC->depth);

    (*pOverPriv->FillSpansTiled) (pDraw, pGC, nInit, ppt, pwidth, fSorted);
}
Exemple #12
0
static void
XAAOverPushPixelsSolid(GCPtr pGC,
                       PixmapPtr pBitMap,
                       DrawablePtr pDraw, int dx, int dy, int xOrg, int yOrg)
{
    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);

    SWITCH_DEPTH(pGC->depth);

    (*pOverPriv->PushPixelsSolid) (pGC, pBitMap, pDraw, dx, dy, xOrg, yOrg);
}
Exemple #13
0
static RegionPtr
XAAOverCopyArea(DrawablePtr pSrc,
                DrawablePtr pDst,
                GC * pGC,
                int srcx, int srcy, int width, int height, int dstx, int dsty)
{
    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);

    SWITCH_DEPTH(pGC->depth);

    return (*pOverPriv->CopyArea) (pSrc, pDst,
                                   pGC, srcx, srcy, width, height, dstx, dsty);
}
Exemple #14
0
static void
XAAOverPutImage(DrawablePtr pDraw,
                GCPtr pGC,
                int depth,
                int x,
                int y, int w, int h, int leftPad, int format, char *pImage)
{
    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);

    SWITCH_DEPTH(pGC->depth);

    (*pOverPriv->PutImage) (pDraw, pGC, depth, x, y, w, h,
                            leftPad, format, pImage);
}
Exemple #15
0
static void
XAAOverPolyGlyphBltNonTE(DrawablePtr pDraw,
                         GCPtr pGC,
                         int xInit, int yInit,
                         unsigned int nglyph,
                         CharInfoPtr * ppci, pointer pglyphBase)
{
    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);

    SWITCH_DEPTH(pGC->depth);

    (*pOverPriv->PolyGlyphBltNonTE) (pDraw, pGC, xInit, yInit, nglyph, ppci,
                                     pglyphBase);
}
Exemple #16
0
static RegionPtr
XAAOverCopyPlane(DrawablePtr pSrc,
                 DrawablePtr pDst,
                 GCPtr pGC,
                 int srcx, int srcy,
                 int width, int height,
                 int dstx, int dsty, unsigned long bitPlane)
{
    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);

    SWITCH_DEPTH(pGC->depth);

    return (*pOverPriv->CopyPlane) (pSrc, pDst,
                                    pGC, srcx, srcy, width, height, dstx, dsty,
                                    bitPlane);

}
static void
XAAOverRestoreAreas (    
    PixmapPtr pPixmap,
    RegionPtr prgnRestore,
    int       xorg,
    int       yorg,
    WindowPtr pWin 
){
    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pWin->drawable.pScreen);
    XAAInfoRecPtr infoRec = 
		GET_XAAINFORECPTR_FROM_DRAWABLE((DrawablePtr)pWin);

    if(pOverPriv->pScrn->vtSema) {
	SWITCH_DEPTH(pWin->drawable.depth);
    }
    
    (*infoRec->RestoreAreas)(pPixmap, prgnRestore, xorg, yorg, pWin);
}
Exemple #18
0
void
XAAOverCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
{
    ScreenPtr pScreen = pWin->drawable.pScreen;
    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pScreen);
    ScrnInfoPtr pScrn = infoRec->pScrn;
    DDXPointPtr ppt, pptSrc;
    RegionRec rgnDst;
    BoxPtr pbox;
    int i, nbox, dx, dy;
    WindowPtr pRoot = pScreen->root;

    if (!pScrn->vtSema || !infoRec->ScreenToScreenBitBlt) {
        XAA_SCREEN_PROLOGUE(pScreen, CopyWindow);
        if (pScrn->vtSema && infoRec->NeedToSync) {
            (*infoRec->Sync) (pScrn);
            infoRec->NeedToSync = FALSE;
        }
        (*pScreen->CopyWindow) (pWin, ptOldOrg, prgnSrc);
        XAA_SCREEN_EPILOGUE(pScreen, CopyWindow, XAAOverCopyWindow);
        return;
    }

    infoRec->ScratchGC.alu = GXcopy;
    infoRec->ScratchGC.planemask = ~0;

    RegionNull(&rgnDst);

    dx = ptOldOrg.x - pWin->drawable.x;
    dy = ptOldOrg.y - pWin->drawable.y;
    RegionTranslate(prgnSrc, -dx, -dy);
    RegionIntersect(&rgnDst, &pWin->borderClip, prgnSrc);

    nbox = RegionNumRects(&rgnDst);
    if (nbox && (pptSrc = (DDXPointPtr) malloc(nbox * sizeof(DDXPointRec)))) {

        pbox = RegionRects(&rgnDst);
        for (i = nbox, ppt = pptSrc; i--; ppt++, pbox++) {
            ppt->x = pbox->x1 + dx;
            ppt->y = pbox->y1 + dy;
        }

        SWITCH_DEPTH(8);
        XAADoBitBlt((DrawablePtr) pRoot, (DrawablePtr) pRoot,
                    &(infoRec->ScratchGC), &rgnDst, pptSrc);

        if (pWin->drawable.bitsPerPixel != 8) {
            SWITCH_DEPTH(pScrn->depth);
            XAADoBitBlt((DrawablePtr) pRoot, (DrawablePtr) pRoot,
                        &(infoRec->ScratchGC), &rgnDst, pptSrc);
        }

        free(pptSrc);
    }

    RegionUninit(&rgnDst);

    if (pWin->drawable.depth == 8) {
        RegionNull(&rgnDst);
        miSegregateChildren(pWin, &rgnDst, pScrn->depth);
        if (RegionNotEmpty(&rgnDst)) {
            RegionIntersect(&rgnDst, &rgnDst, prgnSrc);
            nbox = RegionNumRects(&rgnDst);
            if (nbox &&
                (pptSrc = (DDXPointPtr) malloc(nbox * sizeof(DDXPointRec)))) {

                pbox = RegionRects(&rgnDst);
                for (i = nbox, ppt = pptSrc; i--; ppt++, pbox++) {
                    ppt->x = pbox->x1 + dx;
                    ppt->y = pbox->y1 + dy;
                }

                SWITCH_DEPTH(pScrn->depth);
                XAADoBitBlt((DrawablePtr) pRoot, (DrawablePtr) pRoot,
                            &(infoRec->ScratchGC), &rgnDst, pptSrc);
                free(pptSrc);
            }
        }
        RegionUninit(&rgnDst);
    }
}
void
XAAOverCopyWindow(
    WindowPtr pWin,
    DDXPointRec ptOldOrg,
    RegionPtr prgnSrc
){
    ScreenPtr pScreen = pWin->drawable.pScreen;
    XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
    XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pScreen);
    ScrnInfoPtr pScrn = infoRec->pScrn;
    DDXPointPtr ppt, pptSrc;
    RegionRec rgnDst;
    BoxPtr pbox;
    int i, nbox, dx, dy;
    WindowPtr pRoot = WindowTable[pScreen->myNum];


    if (!pScrn->vtSema || !infoRec->ScreenToScreenBitBlt) { 
	XAA_SCREEN_PROLOGUE (pScreen, CopyWindow);
	if(pScrn->vtSema && infoRec->NeedToSync) {
	    (*infoRec->Sync)(pScrn);
	    infoRec->NeedToSync = FALSE;
	}
        (*pScreen->CopyWindow) (pWin, ptOldOrg, prgnSrc);
	XAA_SCREEN_EPILOGUE (pScreen, CopyWindow, XAAOverCopyWindow);
    	return;
    }

    infoRec->ScratchGC.alu = GXcopy;
    infoRec->ScratchGC.planemask = ~0;

    REGION_NULL(pScreen, &rgnDst);

    dx = ptOldOrg.x - pWin->drawable.x;
    dy = ptOldOrg.y - pWin->drawable.y;
    REGION_TRANSLATE(pScreen, prgnSrc, -dx, -dy);
    REGION_INTERSECT(pScreen, &rgnDst, &pWin->borderClip, prgnSrc);

    nbox = REGION_NUM_RECTS(&rgnDst);
    if(nbox &&
	(pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec)))) {

	pbox = REGION_RECTS(&rgnDst);
	for (i = nbox, ppt = pptSrc; i--; ppt++, pbox++) {
	    ppt->x = pbox->x1 + dx;
	    ppt->y = pbox->y1 + dy;
	}

	SWITCH_DEPTH(8);
	XAADoBitBlt((DrawablePtr)pRoot, (DrawablePtr)pRoot,
        		&(infoRec->ScratchGC), &rgnDst, pptSrc);

	if(pWin->drawable.bitsPerPixel != 8) {
	    SWITCH_DEPTH(pScrn->depth);
	    XAADoBitBlt((DrawablePtr)pRoot, (DrawablePtr)pRoot,
        		&(infoRec->ScratchGC), &rgnDst, pptSrc);
	}

	DEALLOCATE_LOCAL(pptSrc);
    }

    REGION_UNINIT(pScreen, &rgnDst);

    if(pWin->drawable.depth == 8) {
      REGION_NULL(pScreen, &rgnDst);
      miSegregateChildren(pWin, &rgnDst, pScrn->depth);
      if(REGION_NOTEMPTY(pScreen, &rgnDst)) {
	REGION_INTERSECT(pScreen, &rgnDst, &rgnDst, prgnSrc);
	nbox = REGION_NUM_RECTS(&rgnDst);
	if(nbox &&
	  (pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec)))){

	    pbox = REGION_RECTS(&rgnDst);
	    for (i = nbox, ppt = pptSrc; i--; ppt++, pbox++) {
		ppt->x = pbox->x1 + dx;
		ppt->y = pbox->y1 + dy;
	    }

	    SWITCH_DEPTH(pScrn->depth);
	    XAADoBitBlt((DrawablePtr)pRoot, (DrawablePtr)pRoot,
        		&(infoRec->ScratchGC), &rgnDst, pptSrc);
	    DEALLOCATE_LOCAL(pptSrc);
	}
      }
      REGION_UNINIT(pScreen, &rgnDst);
    }
}