summaryrefslogtreecommitdiff
path: root/miext/cw
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2004-08-14 07:12:37 +0000
committerKeith Packard <keithp@keithp.com>2004-08-14 07:12:37 +0000
commite61b5d38ab30c4f73ba0d070f485a32708a03eb6 (patch)
tree6a682f0a67a8015142d57f089859d6f39c4389b1 /miext/cw
parent05f6329eb6f564ad4fc366d75f4ebf9f3ba4b5dd (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/cw')
-rw-r--r--miext/cw/cw.c21
-rw-r--r--miext/cw/cw_render.c33
2 files changed, 32 insertions, 22 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);
}