xc/config/cf/xprint_site.def

xc/programs/Xserver/Xprint/ps/Ps.h
xc/programs/Xserver/Xprint/ps/PsPixmap.c
xc/programs/Xserver/Xprint/ps/PsPolygon.c
//freedesktop.org/bugzilla/show_bug.cgi?id=1664) attachment #1161
    (https://bugs.freedesktop.org/attachment.cgi?id=1161): RFE: Add support
    for the DOUBLE-BUFFER extension to the Xprint server and DDX.
    Additionally a "pixmap-scrubber" optimisation is added to the
    PostScript DDX to remove all content from a vector pixmap when a
    |PolyFillRect()| call covers the whole pixmap surface with a solid fill
    (this avoids that a backbuffer vector pixmap gets constantly filled
    even when the content is not visible anymore after |XdbeSwapBuffers()|
    has cleared the hidden buffer with the background color).
This commit is contained in:
Roland Mainz 2004-12-13 05:48:41 +00:00
parent e2463040d8
commit 24c1ba42e2
4 changed files with 46 additions and 5 deletions

View file

@ -566,6 +566,7 @@ extern void PsSetFillColor(DrawablePtr pDrawable, GCPtr pGC, PsOutPtr psOut,
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);

View file

@ -114,13 +114,15 @@ PsCreatePixmap(
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;
@ -177,6 +179,20 @@ PsDestroyPixmap(PixmapPtr pPixmap)
}
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;

View file

@ -203,6 +203,31 @@ PsPolyFillRect(
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);

View file

@ -1,4 +1,4 @@
/* $XdotOrg: xc/programs/Xserver/mi/miinitext.c,v 1.12.2.1 2004/12/08 05:28:11 gisburn Exp $ */
/* $XdotOrg: xc/programs/Xserver/mi/miinitext.c,v 1.12.2.2 2004/12/08 05:38:02 gisburn Exp $ */
/* $XFree86: xc/programs/Xserver/mi/miinitext.c,v 3.67 2003/01/12 02:44:27 dawes Exp $ */
/***********************************************************
@ -74,7 +74,6 @@ SOFTWARE.
#undef SCREENSAVER
#undef XIDLE
#undef XRECORD
#undef DBE
#undef XF86VIDMODE
#undef XF86MISC
#undef XFreeXDGA