Use XLIB_SKIP_ARGB_VISUALS environment variable to disable all depth 32

visuals. Necessary to keep Flash from crashing.
Must call ValidateGC/ValidatePicture on "real" GC/Picture to ensure
    pCompositeClip is set correctly.
Need to take the composite clip from the "real" GC/Picture and turn it into
    the clientClip for the backing version.
Adjust pixmap screen origin to account for drawable->x/y Change debugging
    output a bit (disabled by default)
This commit is contained in:
Keith Packard 2004-08-14 07:12:37 +00:00
parent 05f6329eb6
commit e61b5d38ab
3 changed files with 41 additions and 27 deletions

View File

@ -198,6 +198,11 @@ cwValidateGC(GCPtr pGC, unsigned long stateChanges, DrawablePtr pDrawable)
FUNC_PROLOGUE(pGC, pPriv); FUNC_PROLOGUE(pGC, pPriv);
/*
* Must call ValidateGC to ensure pGC->pCompositeClip is valid
*/
(*pGC->funcs->ValidateGC)(pGC, stateChanges, pDrawable);
if (pDrawable->serialNumber != pPriv->serialNumber && if (pDrawable->serialNumber != pPriv->serialNumber &&
!cwDrawableIsRedirWindow(pDrawable)) !cwDrawableIsRedirWindow(pDrawable))
{ {
@ -205,7 +210,6 @@ cwValidateGC(GCPtr pGC, unsigned long stateChanges, DrawablePtr pDrawable)
* private and go back to cheap functions. * private and go back to cheap functions.
*/ */
cwDestroyGCPrivate(pGC); cwDestroyGCPrivate(pGC);
(*pGC->funcs->ValidateGC)(pGC, stateChanges, pDrawable);
return; return;
} }
@ -231,16 +235,21 @@ cwValidateGC(GCPtr pGC, unsigned long stateChanges, DrawablePtr pDrawable)
if (pDrawable->serialNumber != pPriv->serialNumber) { if (pDrawable->serialNumber != pPriv->serialNumber) {
XID vals[2]; XID vals[2];
RegionPtr pCompositeClip;
pCompositeClip = REGION_CREATE (pScreen, NULL, 0);
REGION_COPY (pScreen, pCompositeClip, pGC->pCompositeClip);
/* Either the drawable has changed, or the clip list in the drawable has /* Either the drawable has changed, or the clip list in the drawable has
* changed. Copy the new clip list over and set the new translated * changed. Copy the new clip list over and set the new translated
* offset for it. * offset for it.
*/ */
(*pBackingGC->funcs->DestroyClip)(pBackingGC); (*pBackingGC->funcs->ChangeClip) (pBackingGC, CT_REGION,
(*pBackingGC->funcs->CopyClip)(pBackingGC, pGC); (pointer) pCompositeClip, 0);
vals[0] = pGC->clipOrg.x + x_off;
vals[1] = pGC->clipOrg.y + y_off; vals[0] = x_off - pDrawable->x;
vals[1] = y_off - pDrawable->y;
dixChangeGC(NullClient, pBackingGC, dixChangeGC(NullClient, pBackingGC,
(GCClipXOrigin | GCClipYOrigin), vals, NULL); (GCClipXOrigin | GCClipYOrigin), vals, NULL);

View File

@ -162,23 +162,29 @@ static void
cwValidatePicture (PicturePtr pPicture, cwValidatePicture (PicturePtr pPicture,
Mask mask) Mask mask)
{ {
ScreenPtr pScreen = pPicture->pDrawable->pScreen; DrawablePtr pDrawable = pPicture->pDrawable;
ScreenPtr pScreen = pDrawable->pScreen;
cwPsDecl(pScreen); cwPsDecl(pScreen);
cwPictureDecl; cwPictureDecl;
cwPsUnwrap(ValidatePicture); cwPsUnwrap(ValidatePicture);
if (!cwDrawableIsRedirWindow (pPicture->pDrawable))
/*
* Must call ValidatePicture to ensure pPicture->pCompositeClip is valid
*/
(*ps->ValidatePicture) (pPicture, mask);
if (!cwDrawableIsRedirWindow (pDrawable))
{ {
if (pBackingPicture) if (pBackingPicture)
cwDestroyBackingPicture (pPicture); cwDestroyBackingPicture (pPicture);
(*ps->ValidatePicture) (pPicture, mask);
} }
else else
{ {
DrawablePtr pBackingDrawable; DrawablePtr pBackingDrawable;
int x_off, y_off; int x_off, y_off;
pBackingDrawable = cwGetBackingDrawable(pPicture->pDrawable, &x_off, pBackingDrawable = cwGetBackingDrawable(pDrawable, &x_off,
&y_off); &y_off);
if (pBackingPicture && pBackingPicture->pDrawable != pBackingDrawable) if (pBackingPicture && pBackingPicture->pDrawable != pBackingDrawable)
@ -192,7 +198,6 @@ cwValidatePicture (PicturePtr pPicture,
pBackingPicture = cwCreateBackingPicture (pPicture); pBackingPicture = cwCreateBackingPicture (pPicture);
if (!pBackingPicture) if (!pBackingPicture)
{ {
(*ps->ValidatePicture) (pPicture, mask);
cwPsWrap(ValidatePicture, cwValidatePicture); cwPsWrap(ValidatePicture, cwValidatePicture);
return; return;
} }
@ -201,20 +206,16 @@ cwValidatePicture (PicturePtr pPicture,
SetPictureTransform(pBackingPicture, pPicture->transform); SetPictureTransform(pBackingPicture, pPicture->transform);
/* XXX Set filters */ /* XXX Set filters */
if (mask & (CPClipXOrigin || CPClipYOrigin)) { mask &= ~(CPClipXOrigin | CPClipYOrigin);
XID vals[2];
vals[0] = pPicture->clipOrigin.x + x_off;
vals[1] = pPicture->clipOrigin.y + y_off;
ChangePicture(pBackingPicture, CPClipXOrigin | CPClipYOrigin,
vals, NULL, NullClient);
mask &= ~(CPClipXOrigin | CPClipYOrigin);
}
CopyPicture(pPicture, mask, pBackingPicture); CopyPicture(pPicture, mask, pBackingPicture);
(*ps->ValidatePicture) (pBackingPicture, mask); SetPictureClipRegion (pBackingPicture,
x_off - pDrawable->x,
y_off - pDrawable->y,
pPicture->pCompositeClip);
ValidatePicture (pBackingPicture);
} }
cwPsWrap(ValidatePicture, cwValidatePicture); cwPsWrap(ValidatePicture, cwValidatePicture);
} }

View File

@ -143,11 +143,11 @@ damageDamageRegion (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip)
*/ */
if (pDrawable->type != DRAWABLE_WINDOW) if (pDrawable->type != DRAWABLE_WINDOW)
{ {
screen_x = ((PixmapPtr) pDrawable)->screen_x; screen_x = ((PixmapPtr) pDrawable)->screen_x - pDrawable->x;
screen_y = ((PixmapPtr) pDrawable)->screen_y; screen_y = ((PixmapPtr) pDrawable)->screen_y - pDrawable->y;
} }
if (screen_x || screen_y) if (screen_x || screen_y)
REGION_TRANSLATE (pScreen, pRegion, screen_x, screen_y); REGION_TRANSLATE (pScreen, pRegion, screen_x, screen_y);
#endif #endif
REGION_NULL (pScreen, &clippedRec); REGION_NULL (pScreen, &clippedRec);
@ -169,7 +169,9 @@ damageDamageRegion (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip)
if (pDamage->pDrawable->type == DRAWABLE_WINDOW && if (pDamage->pDrawable->type == DRAWABLE_WINDOW &&
!((WindowPtr) (pDamage->pDrawable))->realized) !((WindowPtr) (pDamage->pDrawable))->realized)
{ {
#if 0
DAMAGE_DEBUG (("damage while window unrealized\n")); DAMAGE_DEBUG (("damage while window unrealized\n"));
#endif
continue; continue;
} }
@ -215,10 +217,12 @@ damageDamageRegion (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip)
continue; continue;
} }
DAMAGE_DEBUG (("%s %d x %d +%d +%d\n", where, DAMAGE_DEBUG (("%s %d x %d +%d +%d (target 0x%lx monitor 0x%lx)\n",
where,
pDamageRegion->extents.x2 - pDamageRegion->extents.x1, pDamageRegion->extents.x2 - pDamageRegion->extents.x1,
pDamageRegion->extents.y2 - pDamageRegion->extents.y1, pDamageRegion->extents.y2 - pDamageRegion->extents.y1,
pDamageRegion->extents.x1, pDamageRegion->extents.y1)); pDamageRegion->extents.x1, pDamageRegion->extents.y1,
pDrawable->id, pDamage->pDrawable->id));
/* /*
* Move region to target coordinate space * Move region to target coordinate space