diff options
author | Keith Packard <keithp@keithp.com> | 2004-08-14 07:12:37 +0000 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2004-08-14 07:12:37 +0000 |
commit | e61b5d38ab30c4f73ba0d070f485a32708a03eb6 (patch) | |
tree | 6a682f0a67a8015142d57f089859d6f39c4389b1 /miext | |
parent | 05f6329eb6f564ad4fc366d75f4ebf9f3ba4b5dd (diff) |
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)
Diffstat (limited to 'miext')
-rw-r--r-- | miext/cw/cw.c | 21 | ||||
-rw-r--r-- | miext/cw/cw_render.c | 33 | ||||
-rwxr-xr-x | miext/damage/damage.c | 14 |
3 files changed, 41 insertions, 27 deletions
diff --git a/miext/cw/cw.c b/miext/cw/cw.c index 0b89c1b7b..7ab0aee24 100644 --- a/miext/cw/cw.c +++ b/miext/cw/cw.c @@ -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); diff --git a/miext/cw/cw_render.c b/miext/cw/cw_render.c index 285ad4f96..8e6d011b6 100644 --- a/miext/cw/cw_render.c +++ b/miext/cw/cw_render.c @@ -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); } diff --git a/miext/damage/damage.c b/miext/damage/damage.c index e27b95e80..b4b893855 100755 --- a/miext/damage/damage.c +++ b/miext/damage/damage.c @@ -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 |