Commit e61b5d38 authored by Keith Packard's avatar Keith Packard
Browse files

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)
parent 05f6329e
......@@ -198,6 +198,11 @@ cwValidateGC(GCPtr pGC, unsigned long stateChanges, DrawablePtr pDrawable)
FUNC_PROLOGUE(pGC, pPriv);
/*
* Must call ValidateGC to ensure pGC->pCompositeClip is valid
*/
(*pGC->funcs->ValidateGC)(pGC, stateChanges, pDrawable);
if (pDrawable->serialNumber != pPriv->serialNumber &&
!cwDrawableIsRedirWindow(pDrawable))
{
......@@ -205,7 +210,6 @@ cwValidateGC(GCPtr pGC, unsigned long stateChanges, DrawablePtr pDrawable)
* private and go back to cheap functions.
*/
cwDestroyGCPrivate(pGC);
(*pGC->funcs->ValidateGC)(pGC, stateChanges, pDrawable);
return;
}
......@@ -231,16 +235,21 @@ cwValidateGC(GCPtr pGC, unsigned long stateChanges, DrawablePtr pDrawable)
if (pDrawable->serialNumber != pPriv->serialNumber) {
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
* changed. Copy the new clip list over and set the new translated
* offset for it.
*/
(*pBackingGC->funcs->DestroyClip)(pBackingGC);
(*pBackingGC->funcs->CopyClip)(pBackingGC, pGC);
vals[0] = pGC->clipOrg.x + x_off;
vals[1] = pGC->clipOrg.y + y_off;
(*pBackingGC->funcs->ChangeClip) (pBackingGC, CT_REGION,
(pointer) pCompositeClip, 0);
vals[0] = x_off - pDrawable->x;
vals[1] = y_off - pDrawable->y;
dixChangeGC(NullClient, pBackingGC,
(GCClipXOrigin | GCClipYOrigin), vals, NULL);
......
......@@ -162,23 +162,29 @@ static void
cwValidatePicture (PicturePtr pPicture,
Mask mask)
{
ScreenPtr pScreen = pPicture->pDrawable->pScreen;
DrawablePtr pDrawable = pPicture->pDrawable;
ScreenPtr pScreen = pDrawable->pScreen;
cwPsDecl(pScreen);
cwPictureDecl;
cwPsUnwrap(ValidatePicture);
if (!cwDrawableIsRedirWindow (pPicture->pDrawable))
/*
* Must call ValidatePicture to ensure pPicture->pCompositeClip is valid
*/
(*ps->ValidatePicture) (pPicture, mask);
if (!cwDrawableIsRedirWindow (pDrawable))
{
if (pBackingPicture)
cwDestroyBackingPicture (pPicture);
(*ps->ValidatePicture) (pPicture, mask);
}
else
{
DrawablePtr pBackingDrawable;
int x_off, y_off;
pBackingDrawable = cwGetBackingDrawable(pPicture->pDrawable, &x_off,
pBackingDrawable = cwGetBackingDrawable(pDrawable, &x_off,
&y_off);
if (pBackingPicture && pBackingPicture->pDrawable != pBackingDrawable)
......@@ -192,7 +198,6 @@ cwValidatePicture (PicturePtr pPicture,
pBackingPicture = cwCreateBackingPicture (pPicture);
if (!pBackingPicture)
{
(*ps->ValidatePicture) (pPicture, mask);
cwPsWrap(ValidatePicture, cwValidatePicture);
return;
}
......@@ -201,20 +206,16 @@ cwValidatePicture (PicturePtr pPicture,
SetPictureTransform(pBackingPicture, pPicture->transform);
/* XXX Set filters */
if (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);
}
mask &= ~(CPClipXOrigin | CPClipYOrigin);
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);
}
......
......@@ -143,11 +143,11 @@ damageDamageRegion (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip)
*/
if (pDrawable->type != DRAWABLE_WINDOW)
{
screen_x = ((PixmapPtr) pDrawable)->screen_x;
screen_y = ((PixmapPtr) pDrawable)->screen_y;
screen_x = ((PixmapPtr) pDrawable)->screen_x - pDrawable->x;
screen_y = ((PixmapPtr) pDrawable)->screen_y - pDrawable->y;
}
if (screen_x || screen_y)
REGION_TRANSLATE (pScreen, pRegion, screen_x, screen_y);
REGION_TRANSLATE (pScreen, pRegion, screen_x, screen_y);
#endif
REGION_NULL (pScreen, &clippedRec);
......@@ -169,7 +169,9 @@ damageDamageRegion (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip)
if (pDamage->pDrawable->type == DRAWABLE_WINDOW &&
!((WindowPtr) (pDamage->pDrawable))->realized)
{
#if 0
DAMAGE_DEBUG (("damage while window unrealized\n"));
#endif
continue;
}
......@@ -215,10 +217,12 @@ damageDamageRegion (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip)
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.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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment