Index: xc/programs/Xserver/Xprint/ps/Ps.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/Xprint/ps/Ps.h,v retrieving revision 1.4 diff -u -2 -0 -r1.4 Ps.h --- xc/programs/Xserver/Xprint/ps/Ps.h 4 Oct 2004 05:04:14 -0000 1.4 +++ xc/programs/Xserver/Xprint/ps/Ps.h 21 Oct 2004 01:56:10 -0000 @@ -549,33 +549,34 @@ */ extern Bool PsCreateColormap(ColormapPtr pColor); extern void PsDestroyColormap(ColormapPtr pColor); extern void PsInstallColormap(ColormapPtr pColor); extern void PsUninstallColormap(ColormapPtr pColor); extern int PsListInstalledColormaps(ScreenPtr pScreen, XID *pCmapList); extern void PsStoreColors(ColormapPtr pColor, int ndef, xColorItem *pdefs); extern void PsResolveColor(unsigned short *pRed, unsigned short *pGreen, unsigned short *pBlue, VisualPtr pVisual); extern PsOutColor PsGetPixelColor(ColormapPtr cMap, int pixval); extern void PsSetFillColor(DrawablePtr pDrawable, GCPtr pGC, PsOutPtr psOut, ColormapPtr cMap); /* * Functions in PsPixmap.c */ extern PixmapPtr PsCreatePixmap(ScreenPtr pScreen, int width, int height, int depth); +extern void PsScrubPixmap(PixmapPtr pPixmap); extern Bool PsDestroyPixmap(PixmapPtr pPixmap); extern DisplayListPtr PsGetFreeDisplayBlock(PsPixmapPrivPtr priv); extern void PsReplayPixmap(PixmapPtr pix, DrawablePtr pDrawable); extern int PsCloneDisplayElm(PixmapPtr dst, DisplayElmPtr elm, DisplayElmPtr newElm, int xoff, int yoff); extern void PsCopyDisplayList(PixmapPtr src, PixmapPtr dst, int xoff, int yoff, int x, int y, int w, int h); extern PsElmPtr PsCreateFillElementList(PixmapPtr pix, int *nElms); extern PsElmPtr PsCloneFillElementList(int nElms, PsElmPtr elms); extern void PsDestroyFillElementList(int nElms, PsElmPtr elms); #endif /* _PS_H_ */ Index: xc/programs/Xserver/Xprint/ps/PsPixmap.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/Xprint/ps/PsPixmap.c,v retrieving revision 1.4 diff -u -2 -0 -r1.4 PsPixmap.c --- xc/programs/Xserver/Xprint/ps/PsPixmap.c 3 Oct 2004 15:34:33 -0000 1.4 +++ xc/programs/Xserver/Xprint/ps/PsPixmap.c 21 Oct 2004 01:56:10 -0000 @@ -97,47 +97,49 @@ pPixmap->drawable.type = DRAWABLE_PIXMAP; pPixmap->drawable.class = 0; pPixmap->drawable.pScreen = pScreen; pPixmap->drawable.depth = depth; pPixmap->drawable.bitsPerPixel = _BitsPerPixel(depth); pPixmap->drawable.id = 0; pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER; pPixmap->drawable.x = 0; pPixmap->drawable.y = 0; pPixmap->drawable.width = width; pPixmap->drawable.height = height; pPixmap->devKind = 0; pPixmap->refcnt = 1; pPixmap->devPrivate.ptr = (PsPixmapPrivPtr)xcalloc(1, sizeof(PsPixmapPrivRec)); if( !pPixmap->devPrivate.ptr ) { xfree(pPixmap); return NullPixmap; } return pPixmap; } -Bool -PsDestroyPixmap(PixmapPtr pPixmap) +/* PsScrubPixmap: Remove all content from a pixmap (used by + * |PsPolyFillRect()| when the "solid fill" operation covers + * the whole pixmap) */ +void +PsScrubPixmap(PixmapPtr pPixmap) { PsPixmapPrivPtr priv = (PsPixmapPrivPtr)pPixmap->devPrivate.ptr; DisplayListPtr disp = priv->dispList; - if( --pPixmap->refcnt ) return TRUE; while( disp ) { int i; DisplayListPtr oldDisp = disp; disp = disp->next; for( i=0 ; inelms ; i++ ) { DisplayElmPtr elm = &oldDisp->elms[i]; switch(elm->type) { case PolyPointCmd: case PolyLineCmd: if( elm->c.polyPts.pPoints ) xfree(elm->c.polyPts.pPoints); break; case PolySegmentCmd: if( elm->c.segments.pSegments ) xfree(elm->c.segments.pSegments); break; case PolyRectangleCmd: if( elm->c.rects.pRects ) xfree(elm->c.rects.pRects); @@ -160,40 +162,54 @@ break; case Text16Cmd: case TextI16Cmd: if( elm->c.text16.string ) xfree(elm->c.text16.string); break; case PutImageCmd: if( elm->c.image.pData ) xfree(elm->c.image.pData); break; case BeginFrameCmd: break; case EndFrameCmd: break; } if (elm->type != BeginFrameCmd && elm->type != EndFrameCmd) { (void) FreeGC(elm->gc, (GContext) 0); } } xfree(oldDisp); } + + priv->dispList = NULL; +} + +Bool +PsDestroyPixmap(PixmapPtr pPixmap) +{ + PsPixmapPrivPtr priv = (PsPixmapPrivPtr)pPixmap->devPrivate.ptr; + DisplayListPtr disp = priv->dispList; + + if( --pPixmap->refcnt ) return TRUE; + + PsScrubPixmap(pPixmap); + xfree(priv); xfree(pPixmap); return TRUE; } DisplayListPtr PsGetFreeDisplayBlock(PsPixmapPrivPtr priv) { DisplayListPtr disp = priv->dispList; for(; disp ; disp=disp->next ) { if( disp->nelms>=DPY_BLOCKSIZE && disp->next ) continue; if( disp->nelmsnext = (DisplayListPtr)xcalloc(1, sizeof(DisplayListRec)); disp->next->next = (DisplayListPtr)0; disp->next->nelms = 0; } disp = (DisplayListPtr)xcalloc(1, sizeof(DisplayListRec)); disp->next = (DisplayListPtr)0; Index: xc/programs/Xserver/Xprint/ps/PsPolygon.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/Xprint/ps/PsPolygon.c,v retrieving revision 1.2 diff -u -2 -0 -r1.2 PsPolygon.c --- xc/programs/Xserver/Xprint/ps/PsPolygon.c 23 Apr 2004 18:57:56 -0000 1.2 +++ xc/programs/Xserver/Xprint/ps/PsPolygon.c 21 Oct 2004 01:56:10 -0000 @@ -186,40 +186,65 @@ PsOut_Polygon(psOut, nPoints, pts); xfree(pts); } } void PsPolyFillRect( DrawablePtr pDrawable, GCPtr pGC, int nRects, xRectangle *pRects) { if( pDrawable->type==DRAWABLE_PIXMAP ) { DisplayElmPtr elm; PixmapPtr pix = (PixmapPtr)pDrawable; PsPixmapPrivPtr priv = (PsPixmapPrivPtr)pix->devPrivate.ptr; DisplayListPtr disp; GCPtr gc; +#ifdef DBE + /* Remove previous pixmap content if we render one single rect which + * covers the whole pixmap surface (this optimisation was added for + * the double-buffer extension ("DBE") which uses |PolyFillRect()| + * to clear the buffer - but it makes sense in other cases, too). + */ + if (nRects == 1) + { + extern Bool noDbeExtension; + + if ( (pRects[0].x==0) && (pRects[0].y==0) && + (pRects[0].width==pDrawable->width) && (pRects[0].height==pDrawable->height) && + (pGC->fillStyle == FillSolid) && + (noDbeExtension == False)) + { +#ifdef DEBUG_gismobile + ErrorF("PsPolyFillRect: scrubbing pixmap...\n"); +#endif /* DEBUG_gismobile */ + /* Remove all content from the pixmap as it would be covered + * by the whole rect anyway */ + PsScrubPixmap(pDrawable); + } + } +#endif /* DBE */ + if ((gc = PsCreateAndCopyGC(pDrawable, pGC)) == NULL) return; disp = PsGetFreeDisplayBlock(priv); elm = &disp->elms[disp->nelms]; elm->type = PolyFillRectCmd; elm->gc = gc; elm->c.rects.nRects = nRects; elm->c.rects.pRects = (xRectangle *)xalloc(nRects*sizeof(xRectangle)); memcpy(elm->c.rects.pRects, pRects, nRects*sizeof(xRectangle)); disp->nelms += 1; } else { int i; PsOutPtr psOut; ColormapPtr cMap; if( PsUpdateDrawableGC(pGC, pDrawable, &psOut, &cMap)==FALSE ) return; PsOut_Offset(psOut, pDrawable->x, pDrawable->y); Index: xc/programs/Xserver/mi/miinitext.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/mi/miinitext.c,v retrieving revision 1.13 diff -u -2 -0 -r1.13 miinitext.c --- xc/programs/Xserver/mi/miinitext.c 14 Sep 2004 00:51:25 -0000 1.13 +++ xc/programs/Xserver/mi/miinitext.c 21 Oct 2004 01:56:21 -0000 @@ -57,41 +57,40 @@ #endif #if defined(QNX4) /* sleaze for Watcom on QNX4 ... */ #undef PEXEXT #undef XIE #undef GLXEXT #endif /* Make sure Xprt only announces extensions it supports */ #ifdef PRINT_ONLY_SERVER #undef MITSHM /* this is incompatible to the vector-based Xprint DDX */ #undef XKB #undef PANORAMIX #undef RES #undef XIE #undef XINPUT #undef XV #undef SCREENSAVER #undef XIDLE #undef XRECORD -#undef DBE #undef XF86VIDMODE #undef XF86MISC #undef XFreeXDGA #undef XF86DRI #undef DPMSExtension #undef DPSEXT #undef FONTCACHE #undef RENDER /* not yet */ #undef DAMAGE #undef XFIXES #undef XEVIE #endif /* PRINT_ONLY_SERVER */ extern Bool noTestExtensions; #ifdef BEZIER extern Bool noBezierExtension; #endif #ifdef BIGREQS