Merge of the relatively stable bits of redhat-xdc2006 branch, which should

now be considered dead. Two optimizations have not been merged yet:
- Suppressing damage reporting on XMoveWindow
- Suppressing region computation for the NonEmpty report level
In both cases the implementation of the optimization in the xdc branch
    violated the Damage spec in nasty ways.
This commit is contained in:
Adam Jackson 2006-02-13 20:29:49 +00:00
parent 3da5bb16ed
commit 20d4eee8cf
6 changed files with 74 additions and 19 deletions

View file

@ -1392,6 +1392,28 @@ int __glXQueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc)
return Success;
}
static void
FillAlphaChannel (PixmapPtr pixmap)
{
int i, j;
CARD32 *pixels = (CARD32 *)pixmap->devPrivate.ptr;
CARD32 rowstride = pixmap->devKind / 4;
CARD32 x, y;
x = pixmap->drawable.x;
y = pixmap->drawable.y;
for (i = y; i < pixmap->drawable.height + y; ++i)
{
for (j = x; j < pixmap->drawable.width + x; ++j)
{
int index = i * rowstride + j;
pixels[index] |= 0xFF000000;
}
}
}
int __glXBindTexImageEXT(__GLXclientState *cl, GLbyte *pc)
{
xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
@ -1401,6 +1423,7 @@ int __glXBindTexImageEXT(__GLXclientState *cl, GLbyte *pc)
GLXDrawable drawId;
int buffer;
int error;
int bpp;
pc += __GLX_VENDPRIV_HDR_SIZE;
@ -1420,20 +1443,27 @@ int __glXBindTexImageEXT(__GLXclientState *cl, GLbyte *pc)
}
pixmap = (PixmapPtr) pGlxPixmap->pDraw;
bpp = pixmap->drawable.depth == 24 ? 4 : 2; /* XXX 24bpp packed, 8, etc */
CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_ROW_LENGTH, pixmap->devKind / 4) );
CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_ROWS, pixmap->drawable.y) );
CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_PIXELS, pixmap->drawable.x) );
CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_ROW_LENGTH,
pixmap->devKind / bpp) );
CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_ROWS,
pixmap->drawable.y) );
CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_PIXELS,
pixmap->drawable.x) );
if (bpp == 4)
FillAlphaChannel(pixmap);
CALL_TexImage2D( GET_DISPATCH(),
( GL_TEXTURE_RECTANGLE_ARB,
0,
4,
bpp == 4 ? 4 : 3,
pixmap->drawable.width,
pixmap->drawable.height,
0,
GL_BGRA,
GL_UNSIGNED_BYTE,
bpp == 4 ? GL_BGRA : GL_RGB,
bpp == 4 ? GL_UNSIGNED_BYTE : GL_UNSIGNED_SHORT_5_6_5,
pixmap->devPrivate.ptr ) );
return Success;

View file

@ -432,7 +432,7 @@ compUnredirectOneSubwindow (WindowPtr pParent, WindowPtr pWin)
}
static PixmapPtr
compNewPixmap (WindowPtr pWin, int x, int y, int w, int h)
compNewPixmap (WindowPtr pWin, int x, int y, int w, int h, Bool backfill)
{
ScreenPtr pScreen = pWin->drawable.pScreen;
WindowPtr pParent = pWin->parent;
@ -446,7 +446,11 @@ compNewPixmap (WindowPtr pWin, int x, int y, int w, int h)
pPixmap->screen_x = x;
pPixmap->screen_y = y;
if (!backfill)
return pPixmap;
#if 0
pGC = GetScratchGC (pWin->drawable.depth, pScreen);
/*
@ -467,6 +471,7 @@ compNewPixmap (WindowPtr pWin, int x, int y, int w, int h)
w, h, 0, 0);
FreeScratchGC (pGC);
}
#endif
return pPixmap;
}
@ -478,7 +483,7 @@ compAllocPixmap (WindowPtr pWin)
int y = pWin->drawable.y - bw;
int w = pWin->drawable.width + (bw << 1);
int h = pWin->drawable.height + (bw << 1);
PixmapPtr pPixmap = compNewPixmap (pWin, x, y, w, h);
PixmapPtr pPixmap = compNewPixmap (pWin, x, y, w, h, TRUE);
CompWindowPtr cw = GetCompWindow (pWin);
if (!pPixmap)
@ -548,7 +553,7 @@ compReallocPixmap (WindowPtr pWin, int draw_x, int draw_y,
pix_h = h + (bw << 1);
if (pix_w != pOld->drawable.width || pix_h != pOld->drawable.height)
{
pNew = compNewPixmap (pWin, pix_x, pix_y, pix_w, pix_h);
pNew = compNewPixmap (pWin, pix_x, pix_y, pix_w, pix_h, FALSE);
if (!pNew)
return FALSE;
cw->pOldPixmap = pOld;

View file

@ -231,6 +231,9 @@ ProcCompositeNameWindowPixmap (ClientPtr client)
if (!cw)
return BadMatch;
if (!pWin->mapped)
return BadMatch;
pPixmap = (*pWin->drawable.pScreen->GetWindowPixmap) (pWin);
if (!pPixmap)
return BadMatch;

View file

@ -548,7 +548,9 @@ compCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
REGION_TRANSLATE (prgnSrc, prgnSrc,
pWin->drawable.x - ptOldOrg.x,
pWin->drawable.y - ptOldOrg.y);
#if 0
DamageDamageRegion (&pWin->drawable, prgnSrc);
#endif
}
cs->CopyWindow = pScreen->CopyWindow;
pScreen->CopyWindow = compCopyWindow;
@ -627,7 +629,9 @@ compSetRedirectBorderClip (WindowPtr pWin, RegionPtr pRegion)
/*
* Report that as damaged so it will be redrawn
*/
#if 0
DamageDamageRegion (&pWin->drawable, &damage);
#endif
REGION_UNINIT (pScreen, &damage);
/*
* Save the new border clip region

View file

@ -1,5 +1,5 @@
/* $Xorg: mivaltree.c,v 1.4 2001/02/09 02:05:22 xorgcvs Exp $ */
/* $XdotOrg: xc/programs/Xserver/mi/mivaltree.c,v 1.4 2005/04/20 12:25:45 daniels Exp $ */
/* $XdotOrg: xserver/xorg/mi/mivaltree.c,v 1.6.10.1 2006/02/06 23:18:55 ajax Exp $ */
/*
* mivaltree.c --
* Functions for recalculating window clip lists. Main function
@ -313,7 +313,11 @@ miComputeClips (
{
if (pChild->viewable)
{
if (pChild->visibility != VisibilityFullyObscured)
if (pChild->visibility != VisibilityFullyObscured
#ifdef COMPOSITE
|| pChild->redirectDraw
#endif
)
{
REGION_TRANSLATE( pScreen, &pChild->borderClip,
dx, dy);
@ -491,9 +495,15 @@ miComputeClips (
*
* To figure the exposure of the window we subtract the old clip from the
* new, just as for the border.
*
* For composite this optimization is incorrect since
* the window should not in fact be exposed just because it
* was FullyObscured before.
*/
if (oldVis == VisibilityFullyObscured ||
if (
#ifndef COMPOSITE
oldVis == VisibilityFullyObscured ||
#endif
oldVis == VisibilityNotViewable)
{
REGION_COPY( pScreen, &pParent->valdata->after.exposed, universe);

View file

@ -199,9 +199,7 @@ damageDamageRegion (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip,
#endif
continue;
}
draw_x = pDamage->pDrawable->x;
draw_y = pDamage->pDrawable->y;
#ifdef COMPOSITE
/*
* Need to move everyone to screen coordinates
@ -209,10 +207,15 @@ damageDamageRegion (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip,
*/
if (pDamage->pDrawable->type != DRAWABLE_WINDOW)
{
draw_x += ((PixmapPtr) pDamage->pDrawable)->screen_x;
draw_y += ((PixmapPtr) pDamage->pDrawable)->screen_y;
draw_x = ((PixmapPtr) pDamage->pDrawable)->screen_x;
draw_y = ((PixmapPtr) pDamage->pDrawable)->screen_y;
}
else
#endif
{
draw_x = pDamage->pDrawable->x;
draw_y = pDamage->pDrawable->y;
}
/*
* Clip against border or pixmap bounds