#if DAMAGE_DEBUG_ENABLE
static void
-_damageDamageRegion (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip, char *where)
-#define damageDamageRegion(d,r,c) _damageDamageRegion(d,r,c,__FUNCTION__)
+_damageDamageRegion (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip, int subWindowMode, const char *where)
+#define damageDamageRegion(d,r,c,m) _damageDamageRegion(d,r,c,m,__FUNCTION__)
#else
static void
-damageDamageRegion (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip)
+damageDamageRegion (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip,
+ int subWindowMode)
#endif
{
ScreenPtr pScreen = pDrawable->pScreen;
REGION_TRANSLATE (pScreen, pRegion, screen_x, screen_y);
#endif
+ if (pDrawable->type == DRAWABLE_WINDOW &&
+ ((WindowPtr)(pDrawable))->backingStore == NotUseful)
+ {
+ if (subWindowMode == ClipByChildren)
+ {
+ REGION_INTERSECT(pScreen, pRegion, pRegion,
+ &((WindowPtr)(pDrawable))->clipList);
+ }
+ else if (subWindowMode == IncludeInferiors)
+ {
+ RegionPtr pTempRegion =
+ NotClippedByChildren((WindowPtr)(pDrawable));
+ REGION_INTERSECT(pScreen, pRegion, pRegion, pTempRegion);
+ REGION_UNINIT(pScreen, pTempRegion);
+ }
+ /* If subWindowMode is set to an invalid value, don't perform
+ * any drawable-based clipping. */
+ }
+
+
REGION_NULL (pScreen, &clippedRec);
for (; pDamage; pDamage = pNext)
{
}
#if DAMAGE_DEBUG_ENABLE
-#define damageDamageBox(d,b) _damageDamageBox(d,b,__FUNCTION__)
+#define damageDamageBox(d,b,m) _damageDamageBox(d,b,m,__FUNCTION__)
static void
-_damageDamageBox (DrawablePtr pDrawable, BoxPtr pBox, char *where)
+_damageDamageBox (DrawablePtr pDrawable, BoxPtr pBox, int subWindowMode, const char *where)
#else
static void
-damageDamageBox (DrawablePtr pDrawable, BoxPtr pBox)
+damageDamageBox (DrawablePtr pDrawable, BoxPtr pBox, int subWindowMode)
#endif
{
RegionRec region;
REGION_INIT (pDrawable->pScreen, ®ion, pBox, 1);
#if DAMAGE_DEBUG_ENABLE
- _damageDamageRegion (pDrawable, ®ion, TRUE, where);
+ _damageDamageRegion (pDrawable, ®ion, TRUE, subWindowMode, where);
#else
- damageDamageRegion (pDrawable, ®ion, TRUE);
+ damageDamageRegion (pDrawable, ®ion, TRUE, subWindowMode);
#endif
REGION_UNINIT (pDrawable->pScreen, ®ion);
}
box.y2 = box.y1 + height;
TRIM_PICTURE_BOX(box, pDst);
if (BOX_NOT_EMPTY(box))
- damageDamageBox (pDst->pDrawable, &box);
+ damageDamageBox (pDst->pDrawable, &box, pDst->subWindowMode);
}
unwrap (pScrPriv, ps, Composite);
(*ps->Composite) (op,
}
TRIM_PICTURE_BOX (box, pDst);
if (BOX_NOT_EMPTY(box))
- damageDamageBox (pDst->pDrawable, &box);
+ damageDamageBox (pDst->pDrawable, &box, pDst->subWindowMode);
}
unwrap (pScrPriv, ps, Glyphs);
(*ps->Glyphs) (op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, list, glyphs);
TRIM_BOX(box, pGC);
if(BOX_NOT_EMPTY(box))
- damageDamageBox (pDrawable, &box);
+ damageDamageBox (pDrawable, &box, pGC->subWindowMode);
}
(*pGC->ops->FillSpans)(pDrawable, pGC, npt, ppt, pwidth, fSorted);
TRIM_BOX(box, pGC);
if(BOX_NOT_EMPTY(box))
- damageDamageBox (pDrawable, &box);
+ damageDamageBox (pDrawable, &box, pGC->subWindowMode);
}
(*pGC->ops->SetSpans)(pDrawable, pGC, pcharsrc, ppt, pwidth, npt, fSorted);
DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable);
TRIM_BOX(box, pGC);
if(BOX_NOT_EMPTY(box))
- damageDamageBox (pDrawable, &box);
+ damageDamageBox (pDrawable, &box, pGC->subWindowMode);
}
(*pGC->ops->PutImage)(pDrawable, pGC, depth, x, y, w, h,
leftPad, format, pImage);
TRIM_BOX(box, pGC);
if(BOX_NOT_EMPTY(box))
- damageDamageBox (pDst, &box);
+ damageDamageBox (pDst, &box, pGC->subWindowMode);
}
ret = (*pGC->ops->CopyArea)(pSrc, pDst,
TRIM_BOX(box, pGC);
if(BOX_NOT_EMPTY(box))
- damageDamageBox (pDst, &box);
+ damageDamageBox (pDst, &box, pGC->subWindowMode);
}
ret = (*pGC->ops->CopyPlane)(pSrc, pDst,
TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC);
if(BOX_NOT_EMPTY(box))
- damageDamageBox (pDrawable, &box);
+ damageDamageBox (pDrawable, &box, pGC->subWindowMode);
}
(*pGC->ops->PolyPoint)(pDrawable, pGC, mode, npt, ppt);
DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable);
TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC);
if(BOX_NOT_EMPTY(box))
- damageDamageBox (pDrawable, &box);
+ damageDamageBox (pDrawable, &box, pGC->subWindowMode);
}
(*pGC->ops->Polylines)(pDrawable, pGC, mode, npt, ppt);
DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable);
TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC);
if(BOX_NOT_EMPTY(box))
- damageDamageBox (pDrawable, &box);
+ damageDamageBox (pDrawable, &box, pGC->subWindowMode);
}
(*pGC->ops->PolySegment)(pDrawable, pGC, nSeg, pSeg);
DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable);
box.y2 = box.y1 + offset2;
TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC);
if(BOX_NOT_EMPTY(box))
- damageDamageBox (pDrawable, &box);
+ damageDamageBox (pDrawable, &box, pGC->subWindowMode);
box.x1 = pRectsTmp->x - offset1;
box.y1 = pRectsTmp->y + offset3;
box.y2 = box.y1 + pRectsTmp->height - offset2;
TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC);
if(BOX_NOT_EMPTY(box))
- damageDamageBox (pDrawable, &box);
+ damageDamageBox (pDrawable, &box, pGC->subWindowMode);
box.x1 = pRectsTmp->x + pRectsTmp->width - offset1;
box.y1 = pRectsTmp->y + offset3;
box.y2 = box.y1 + pRectsTmp->height - offset2;
TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC);
if(BOX_NOT_EMPTY(box))
- damageDamageBox (pDrawable, &box);
+ damageDamageBox (pDrawable, &box, pGC->subWindowMode);
box.x1 = pRectsTmp->x - offset1;
box.y1 = pRectsTmp->y + pRectsTmp->height - offset1;
box.y2 = box.y1 + offset2;
TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC);
if(BOX_NOT_EMPTY(box))
- damageDamageBox (pDrawable, &box);
+ damageDamageBox (pDrawable, &box, pGC->subWindowMode);
pRectsTmp++;
}
TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC);
if(BOX_NOT_EMPTY(box))
- damageDamageBox (pDrawable, &box);
+ damageDamageBox (pDrawable, &box, pGC->subWindowMode);
}
(*pGC->ops->PolyArc)(pDrawable, pGC, nArcs, pArcs);
DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable);
TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC);
if(BOX_NOT_EMPTY(box))
- damageDamageBox (pDrawable, &box);
+ damageDamageBox (pDrawable, &box, pGC->subWindowMode);
}
(*pGC->ops->FillPolygon)(pDrawable, pGC, shape, mode, npt, ppt);
TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC);
if(BOX_NOT_EMPTY(box))
- damageDamageBox (pDrawable, &box);
+ damageDamageBox (pDrawable, &box, pGC->subWindowMode);
}
(*pGC->ops->PolyFillRect)(pDrawable, pGC, nRects, pRects);
DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable);
TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC);
if(BOX_NOT_EMPTY(box))
- damageDamageBox (pDrawable, &box);
+ damageDamageBox (pDrawable, &box, pGC->subWindowMode);
}
(*pGC->ops->PolyFillArc)(pDrawable, pGC, nArcs, pArcs);
DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable);
int y,
unsigned int n,
CharInfoPtr *charinfo,
- Bool imageblt)
+ Bool imageblt,
+ int subWindowMode)
{
ExtentInfoRec extents;
BoxRec box;
box.y1 = y - extents.overallAscent;
box.x2 = x + extents.overallRight;
box.y2 = y + extents.overallDescent;
- damageDamageBox (pDrawable, &box);
+ damageDamageBox (pDrawable, &box, subWindowMode);
}
/*
if (n != 0) {
damageDamageChars (pDrawable, pGC->font, x + pDrawable->x, y + pDrawable->y, n,
- charinfo, imageblt);
+ charinfo, imageblt, pGC->subWindowMode);
if (imageblt)
(*pGC->ops->ImageGlyphBlt)(pDrawable, pGC, x, y, n, charinfo,
FONTGLYPHS(pGC->font));
{
DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable);
damageDamageChars (pDrawable, pGC->font, x + pDrawable->x, y + pDrawable->y,
- nglyph, ppci, TRUE);
+ nglyph, ppci, TRUE, pGC->subWindowMode);
(*pGC->ops->ImageGlyphBlt)(pDrawable, pGC, x, y, nglyph,
ppci, pglyphBase);
DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable);
{
DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable);
damageDamageChars (pDrawable, pGC->font, x + pDrawable->x, y + pDrawable->y,
- nglyph, ppci, FALSE);
+ nglyph, ppci, FALSE, pGC->subWindowMode);
(*pGC->ops->PolyGlyphBlt)(pDrawable, pGC, x, y, nglyph,
ppci, pglyphBase);
DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable);
TRIM_BOX(box, pGC);
if(BOX_NOT_EMPTY(box))
- damageDamageBox (pDrawable, &box);
+ damageDamageBox (pDrawable, &box, pGC->subWindowMode);
}
(*pGC->ops->PushPixels)(pGC, pBitMap, pDrawable, dx, dy, xOrg, yOrg);
DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable);
*/
if ((what != PW_BACKGROUND || pWindow->backgroundState != None) &&
getWindowDamage (pWindow))
- damageDamageRegion (&pWindow->drawable, prgn, FALSE);
+ damageDamageRegion (&pWindow->drawable, prgn, FALSE, -1);
if(what == PW_BACKGROUND) {
unwrap (pScrPriv, pScreen, PaintWindowBackground);
(*pScreen->PaintWindowBackground) (pWindow, prgn, what);
* at the destination location. Translate back and forth.
*/
REGION_TRANSLATE (pScreen, prgnSrc, dx, dy);
- damageDamageRegion (&pWindow->drawable, prgnSrc, FALSE);
+ damageDamageRegion (&pWindow->drawable, prgnSrc, FALSE, -1);
REGION_TRANSLATE (pScreen, prgnSrc, -dx, -dy);
}
unwrap (pScrPriv, pScreen, CopyWindow);
ScreenPtr pScreen = pWindow->drawable.pScreen;
damageScrPriv(pScreen);
- damageDamageRegion (&pWindow->drawable, prgn, FALSE);
+ damageDamageRegion (&pWindow->drawable, prgn, FALSE, -1);
unwrap (pScrPriv, pScreen, BackingStoreFuncs.RestoreAreas);
(*pScreen->BackingStoreFuncs.RestoreAreas) (pPixmap, prgn,
xorg, yorg, pWindow);
DamageDamageRegion (DrawablePtr pDrawable,
RegionPtr pRegion)
{
- damageDamageRegion (pDrawable, pRegion, FALSE);
+ damageDamageRegion (pDrawable, pRegion, FALSE, -1);
}