diff options
author | Dave Airlie <airlied@redhat.com> | 2012-10-10 11:52:49 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-10-10 11:52:49 +1000 |
commit | 780574c17105c325350ada0a042b8532f6e0dc62 (patch) | |
tree | 1da6a30af25d43154ea5d1cf841756cac1a57116 | |
parent | a3489986d36018901924c9bc9312bbedd51ef46c (diff) |
damage: change API to take a screen and a drawable
-rw-r--r-- | composite/compalloc.c | 2 | ||||
-rw-r--r-- | composite/compwindow.c | 4 | ||||
-rw-r--r-- | damageext/damageext.c | 2 | ||||
-rw-r--r-- | exa/exa.c | 2 | ||||
-rw-r--r-- | exa/exa_render.c | 4 | ||||
-rw-r--r-- | fb/fbtrap.c | 4 | ||||
-rw-r--r-- | glx/glxdri.c | 4 | ||||
-rw-r--r-- | hw/xfree86/dri2/dri2.c | 4 | ||||
-rw-r--r-- | hw/xfree86/modes/xf86Rotate.c | 2 | ||||
-rw-r--r-- | miext/damage/damage.c | 168 | ||||
-rw-r--r-- | miext/damage/damage.h | 6 |
11 files changed, 100 insertions, 102 deletions
diff --git a/composite/compalloc.c b/composite/compalloc.c index cc69c68f2..3f256925d 100644 --- a/composite/compalloc.c +++ b/composite/compalloc.c @@ -301,7 +301,7 @@ compFreeClientWindow(WindowPtr pWin, XID id) DamageRegister(&pWin->drawable, cw->damage); cw->damageRegistered = TRUE; pWin->redirectDraw = RedirectDrawAutomatic; - DamageDamageRegion(&pWin->drawable, &pWin->borderSize); + DamageDamageRegion(pScreen, &pWin->drawable, &pWin->borderSize); } if (anyMarked) diff --git a/composite/compwindow.c b/composite/compwindow.c index 3c7041f66..8ec1b7e36 100644 --- a/composite/compwindow.c +++ b/composite/compwindow.c @@ -529,7 +529,7 @@ compCopyWindow(ScreenPtr pScreen, WindowPtr pWin, DDXPointRec ptOldOrg, RegionPt RegionTranslate(prgnSrc, pWin->drawable.x - ptOldOrg.x, pWin->drawable.y - ptOldOrg.y); - DamageDamageRegion(&pWin->drawable, prgnSrc); + DamageDamageRegion(pScreen, &pWin->drawable, prgnSrc); } cs->CopyWindow = pScreen->CopyWindow; pScreen->CopyWindow = compCopyWindow; @@ -613,7 +613,7 @@ compSetRedirectBorderClip(WindowPtr pWin, RegionPtr pRegion) /* * Report that as damaged so it will be redrawn */ - DamageDamageRegion(&pWin->drawable, &damage); + DamageDamageRegion(pWin->drawable.pScreen, &pWin->drawable, &damage); RegionUninit(&damage); /* * Save the new border clip region diff --git a/damageext/damageext.c b/damageext/damageext.c index a942ffa68..c8da7e4e7 100644 --- a/damageext/damageext.c +++ b/damageext/damageext.c @@ -292,7 +292,7 @@ ProcDamageAdd(ClientPtr client) * screen coordinates like damage expects. */ RegionTranslate(pRegion, pDrawable->x, pDrawable->y); - DamageDamageRegion(pDrawable, pRegion); + DamageDamageRegion(pDrawable->pScreen, pDrawable, pRegion); RegionTranslate(pRegion, -pDrawable->x, -pDrawable->y); return Success; @@ -153,7 +153,7 @@ exaPixmapDirty(PixmapPtr pPix, int x1, int y1, int x2, int y2) return; RegionInit(®ion, &box, 1); - DamageDamageRegion(&pPix->drawable, ®ion); + DamageDamageRegion(pPix->drawable.pScreen, &pPix->drawable, ®ion); RegionUninit(®ion); } diff --git a/exa/exa_render.c b/exa/exa_render.c index 0554e1aad..7b64086ab 100644 --- a/exa/exa_render.c +++ b/exa/exa_render.c @@ -566,7 +566,7 @@ exaCompositeRects(CARD8 op, RegionInit(®ion, &box, 1); - DamageRegionAppend(pDst->pDrawable, ®ion); + DamageRegionAppend(pDst->pScreen, pDst->pDrawable, ®ion); RegionUninit(®ion); } @@ -617,7 +617,7 @@ exaCompositeRects(CARD8 op, * Calling DamageRegionProcessPending has that effect. */ - DamageRegionProcessPending(pDst->pDrawable); + DamageRegionProcessPending(pDst->pScreen, pDst->pDrawable); } } diff --git a/fb/fbtrap.c b/fb/fbtrap.c index bf82f8f2c..858153d63 100644 --- a/fb/fbtrap.c +++ b/fb/fbtrap.c @@ -109,7 +109,7 @@ fbShapes(CompositeShapesFunc composite, if (src && dst) { pixman_format_code_t format; - DamageRegionAppend(pDst->pDrawable, pDst->pCompositeClip); + DamageRegionAppend(pDst->pScreen, pDst->pDrawable, pDst->pCompositeClip); if (!maskFormat) { int i; @@ -147,7 +147,7 @@ fbShapes(CompositeShapesFunc composite, ySrc + src_yoff, dst_xoff, dst_yoff, nshapes, shapes); } - DamageRegionProcessPending(pDst->pDrawable); + DamageRegionProcessPending(pDst->pScreen, pDst->pDrawable); } free_pixman_pict(pSrc, src); diff --git a/glx/glxdri.c b/glx/glxdri.c index b9b92b9d9..355acc73f 100644 --- a/glx/glxdri.c +++ b/glx/glxdri.c @@ -823,14 +823,14 @@ __glXReportDamage(__DRIdrawable * driDraw, if (RegionInitBoxes(®ion, (BoxPtr) rects, num_rects)) { RegionTranslate(®ion, pDraw->x, pDraw->y); - DamageDamageRegion(pDraw, ®ion); + DamageDamageRegion(pDraw->pScreen, pDraw, ®ion); RegionUninit(®ion); } else { while (num_rects--) { RegionInit(®ion, (BoxPtr) rects++, 1); RegionTranslate(®ion, pDraw->x, pDraw->y); - DamageDamageRegion(pDraw, ®ion); + DamageDamageRegion(pDraw->pScreen, pDraw, ®ion); RegionUninit(®ion); } } diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c index b3dc53b22..e135320f7 100644 --- a/hw/xfree86/dri2/dri2.c +++ b/hw/xfree86/dri2/dri2.c @@ -904,8 +904,8 @@ static void dri2_copy_region(DrawablePtr pDraw, RegionPtr pRegion, box.y2 = box.y1 + pDraw->height; RegionInit(®ion, &box, 1); RegionTranslate(®ion, pDraw->x, pDraw->y); - DamageRegionAppend(pDraw, ®ion); - DamageRegionProcessPending(pDraw); + DamageRegionAppend(primeScreen, pDraw, ®ion); + DamageRegionProcessPending(primeScreen, pDraw); RegionUninit(®ion); } } diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c index a3937478f..22916823a 100644 --- a/hw/xfree86/modes/xf86Rotate.c +++ b/hw/xfree86/modes/xf86Rotate.c @@ -143,7 +143,7 @@ xf86CrtcDamageShadow(xf86CrtcPtr crtc) if (damage_box.y2 > pScreen->height) damage_box.y2 = pScreen->height; RegionInit(&damage_region, &damage_box, 1); - DamageDamageRegion(&(*pScreen->GetScreenPixmap) (pScreen)->drawable, + DamageDamageRegion(pScreen, &(*pScreen->GetScreenPixmap) (pScreen)->drawable, &damage_region); RegionUninit(&damage_region); crtc->shadowClear = TRUE; diff --git a/miext/damage/damage.c b/miext/damage/damage.c index 30f46884c..d19856b5a 100644 --- a/miext/damage/damage.c +++ b/miext/damage/damage.c @@ -81,20 +81,18 @@ static DevPrivateKeyRec damageWinPrivateKeyRec; #define damageWinPrivateKey (&damageWinPrivateKeyRec) static DamagePtr * -getDrawableDamageRef(DrawablePtr pDrawable) +getDrawableDamageRef(ScreenPtr pScreen, DrawablePtr pDrawable) { PixmapPtr pPixmap; if (WindowDrawable(pDrawable->type)) { - ScreenPtr pScreen = pDrawable->pScreen; - pPixmap = 0; if (pScreen->GetWindowPixmap #ifdef ROOTLESS_WORKAROUND && ((WindowPtr) pDrawable)->viewable #endif ) - pPixmap = (*pScreen->GetWindowPixmap) ((WindowPtr) pDrawable); + pPixmap = GetDrawablePixmap(pScreen, pDrawable); if (!pPixmap) { damageScrPriv(pScreen); @@ -103,17 +101,18 @@ getDrawableDamageRef(DrawablePtr pDrawable) } } else - pPixmap = (PixmapPtr) pDrawable; + pPixmap = GetDrawablePixmap(pScreen, pDrawable); + return getPixmapDamageRef(pPixmap); } -#define getDrawableDamage(pDrawable) (*getDrawableDamageRef (pDrawable)) -#define getWindowDamage(pWin) getDrawableDamage(&(pWin)->drawable) +#define getDrawableDamage(pScreen, pDrawable) (*getDrawableDamageRef (pScreen, pDrawable)) +#define getWindowDamage(pScreen, pWin) getDrawableDamage(pScreen, &(pWin)->drawable) -#define drawableDamage(pDrawable) \ - DamagePtr pDamage = getDrawableDamage(pDrawable) +#define drawableDamage(pScreen, pDrawable) \ + DamagePtr pDamage = getDrawableDamage(pScreen, pDrawable) -#define windowDamage(pWin) drawableDamage(&(pWin)->drawable) +#define windowDamage(pScreen, pWin) drawableDamage(pScreen, &(pWin)->drawable) #define winDamageRef(pWindow) \ DamagePtr *pPrev = (DamagePtr *) \ @@ -166,19 +165,17 @@ damageReportDamagePostRendering(DamagePtr pDamage, RegionPtr pOldDamage, #if DAMAGE_DEBUG_ENABLE static void -_damageRegionAppend(DrawablePtr pDrawable, RegionPtr pRegion, Bool clip, +_damageRegionAppend(ScreenPtr pScreen, DrawablePtr pDrawable, RegionPtr pRegion, Bool clip, int subWindowMode, const char *where) -#define damageRegionAppend(d,r,c,m) _damageRegionAppend(d,r,c,m,__FUNCTION__) +#define damageRegionAppend(s,d,r,c,m) _damageRegionAppend(s,d,r,c,m,__FUNCTION__) #else static void -damageRegionAppend(DrawablePtr pDrawable, RegionPtr pRegion, Bool clip, +damageRegionAppend(ScreenPtr pScreen, DrawablePtr pDrawable, RegionPtr pRegion, Bool clip, int subWindowMode) #endif { - ScreenPtr pScreen = pDrawable->pScreen; - damageScrPriv(pScreen); - drawableDamage(pDrawable); + drawableDamage(pScreen, pDrawable); DamagePtr pNext; RegionRec clippedRec; RegionPtr pDamageRegion; @@ -330,9 +327,9 @@ damageRegionAppend(DrawablePtr pDrawable, RegionPtr pRegion, Bool clip, } static void -damageRegionProcessPending(DrawablePtr pDrawable) +damageRegionProcessPending(ScreenPtr pScreen, DrawablePtr pDrawable) { - drawableDamage(pDrawable); + drawableDamage(pScreen, pDrawable); for (; pDamage != NULL; pDamage = pDamage->pNext) { /* submit damage marker whenever possible. */ @@ -359,22 +356,22 @@ damageRegionProcessPending(DrawablePtr pDrawable) } #if DAMAGE_DEBUG_ENABLE -#define damageDamageBox(d,b,m) _damageDamageBox(d,b,m,__FUNCTION__) +#define damageDamageBox(s,d,b,m) _damageDamageBox(s,d,b,m,__FUNCTION__) static void -_damageDamageBox(DrawablePtr pDrawable, BoxPtr pBox, int subWindowMode, +_damageDamageBox(ScreenPtr pScreen, DrawablePtr pDrawable, BoxPtr pBox, int subWindowMode, const char *where) #else static void -damageDamageBox(DrawablePtr pDrawable, BoxPtr pBox, int subWindowMode) +damageDamageBox(ScreenPtr pScreen, DrawablePtr pDrawable, BoxPtr pBox, int subWindowMode) #endif { RegionRec region; RegionInit(®ion, pBox, 1); #if DAMAGE_DEBUG_ENABLE - _damageRegionAppend(pDrawable, ®ion, TRUE, subWindowMode, where); + _damageRegionAppend(pScreen, pDrawable, ®ion, TRUE, subWindowMode, where); #else - damageRegionAppend(pDrawable, ®ion, TRUE, subWindowMode); + damageRegionAppend(pScreen, pDrawable, ®ion, TRUE, subWindowMode); #endif RegionUninit(®ion); } @@ -513,7 +510,7 @@ damageDestroyClip(GCPtr pGC) #define BOX_NOT_EMPTY(box) \ (((box.x2 - box.x1) > 0) && ((box.y2 - box.y1) > 0)) -#define checkGCDamage(d,g) (getDrawableDamage(d) && \ +#define checkGCDamage(d,g) (getDrawableDamage(g->pScreen, d) && \ (!g->pCompositeClip ||\ RegionNotEmpty(g->pCompositeClip))) @@ -525,7 +522,7 @@ damageDestroyClip(GCPtr pGC) if(box.y2 > extents->y2) box.y2 = extents->y2; \ } -#define checkPictureDamage(p) (getDrawableDamage(p->pDrawable) && \ +#define checkPictureDamage(p) (getDrawableDamage(p->pScreen, p->pDrawable) && \ RegionNotEmpty(p->pCompositeClip)) static void @@ -553,7 +550,7 @@ damageComposite(CARD8 op, box.y2 = box.y1 + height; TRIM_PICTURE_BOX(box, pDst); if (BOX_NOT_EMPTY(box)) - damageDamageBox(pDst->pDrawable, &box, pDst->subWindowMode); + damageDamageBox(pScreen, pDst->pDrawable, &box, pDst->subWindowMode); } unwrap(pScrPriv, ps, Composite); (*ps->Composite) (op, @@ -561,7 +558,7 @@ damageComposite(CARD8 op, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst, yDst, width, height); - damageRegionProcessPending(pDst->pDrawable); + damageRegionProcessPending(pDst->pScreen, pDst->pDrawable); wrap(pScrPriv, ps, Composite, damageComposite); } @@ -619,11 +616,11 @@ damageGlyphs(CARD8 op, } TRIM_PICTURE_BOX(box, pDst); if (BOX_NOT_EMPTY(box)) - damageDamageBox(pDst->pDrawable, &box, pDst->subWindowMode); + damageDamageBox(pScreen, pDst->pDrawable, &box, pDst->subWindowMode); } unwrap(pScrPriv, ps, Glyphs); (*ps->Glyphs) (op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, list, glyphs); - damageRegionProcessPending(pDst->pDrawable); + damageRegionProcessPending(pDst->pScreen, pDst->pDrawable); wrap(pScrPriv, ps, Glyphs, damageGlyphs); } @@ -667,11 +664,11 @@ damageAddTraps(PicturePtr pPicture, } TRIM_PICTURE_BOX(box, pPicture); if (BOX_NOT_EMPTY(box)) - damageDamageBox(pPicture->pDrawable, &box, pPicture->subWindowMode); + damageDamageBox(pScreen, pPicture->pDrawable, &box, pPicture->subWindowMode); } unwrap(pScrPriv, ps, AddTraps); (*ps->AddTraps) (pPicture, x_off, y_off, ntrap, traps); - damageRegionProcessPending(pPicture->pDrawable); + damageRegionProcessPending(pPicture->pScreen, pPicture->pDrawable); wrap(pScrPriv, ps, AddTraps, damageAddTraps); } @@ -714,12 +711,12 @@ damageFillSpans(DrawablePtr pDrawable, TRIM_BOX(box, pGC); if (BOX_NOT_EMPTY(box)) - damageDamageBox(pDrawable, &box, pGC->subWindowMode); + damageDamageBox(pGC->pScreen, pDrawable, &box, pGC->subWindowMode); } (*pGC->ops->FillSpans) (pDrawable, pGC, npt, ppt, pwidth, fSorted); - damageRegionProcessPending(pDrawable); + damageRegionProcessPending(pGC->pScreen, pDrawable); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); } @@ -762,10 +759,10 @@ damageSetSpans(DrawablePtr pDrawable, TRIM_BOX(box, pGC); if (BOX_NOT_EMPTY(box)) - damageDamageBox(pDrawable, &box, pGC->subWindowMode); + damageDamageBox(pGC->pScreen, pDrawable, &box, pGC->subWindowMode); } (*pGC->ops->SetSpans) (pDrawable, pGC, pcharsrc, ppt, pwidth, npt, fSorted); - damageRegionProcessPending(pDrawable); + damageRegionProcessPending(pGC->pScreen, pDrawable); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); } @@ -787,11 +784,11 @@ damagePutImage(DrawablePtr pDrawable, TRIM_BOX(box, pGC); if (BOX_NOT_EMPTY(box)) - damageDamageBox(pDrawable, &box, pGC->subWindowMode); + damageDamageBox(pGC->pScreen, pDrawable, &box, pGC->subWindowMode); } (*pGC->ops->PutImage) (pDrawable, pGC, depth, x, y, w, h, leftPad, format, pImage); - damageRegionProcessPending(pDrawable); + damageRegionProcessPending(pGC->pScreen, pDrawable); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); } @@ -815,12 +812,12 @@ damageCopyArea(DrawablePtr pSrc, TRIM_BOX(box, pGC); if (BOX_NOT_EMPTY(box)) - damageDamageBox(pDst, &box, pGC->subWindowMode); + damageDamageBox(pGC->pScreen, pDst, &box, pGC->subWindowMode); } ret = (*pGC->ops->CopyArea) (pSrc, pDst, pGC, srcx, srcy, width, height, dstx, dsty); - damageRegionProcessPending(pDst); + damageRegionProcessPending(pGC->pScreen, pDst); DAMAGE_GC_OP_EPILOGUE(pGC, pDst); return ret; } @@ -848,13 +845,13 @@ damageCopyPlane(DrawablePtr pSrc, TRIM_BOX(box, pGC); if (BOX_NOT_EMPTY(box)) - damageDamageBox(pDst, &box, pGC->subWindowMode); + damageDamageBox(pGC->pScreen, pDst, &box, pGC->subWindowMode); } ret = (*pGC->ops->CopyPlane) (pSrc, pDst, pGC, srcx, srcy, width, height, dstx, dsty, bitPlane); - damageRegionProcessPending(pDst); + damageRegionProcessPending(pGC->pScreen, pDst); DAMAGE_GC_OP_EPILOGUE(pGC, pDst); return ret; } @@ -892,10 +889,10 @@ damagePolyPoint(DrawablePtr pDrawable, TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC); if (BOX_NOT_EMPTY(box)) - damageDamageBox(pDrawable, &box, pGC->subWindowMode); + damageDamageBox(pGC->pScreen, pDrawable, &box, pGC->subWindowMode); } (*pGC->ops->PolyPoint) (pDrawable, pGC, mode, npt, ppt); - damageRegionProcessPending(pDrawable); + damageRegionProcessPending(pGC->pScreen, pDrawable); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); } @@ -965,10 +962,10 @@ damagePolylines(DrawablePtr pDrawable, TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC); if (BOX_NOT_EMPTY(box)) - damageDamageBox(pDrawable, &box, pGC->subWindowMode); + damageDamageBox(pGC->pScreen, pDrawable, &box, pGC->subWindowMode); } (*pGC->ops->Polylines) (pDrawable, pGC, mode, npt, ppt); - damageRegionProcessPending(pDrawable); + damageRegionProcessPending(pGC->pScreen, pDrawable); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); } @@ -1044,10 +1041,10 @@ damagePolySegment(DrawablePtr pDrawable, GCPtr pGC, int nSeg, xSegment * pSeg) TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC); if (BOX_NOT_EMPTY(box)) - damageDamageBox(pDrawable, &box, pGC->subWindowMode); + damageDamageBox(pGC->pScreen, pDrawable, &box, pGC->subWindowMode); } (*pGC->ops->PolySegment) (pDrawable, pGC, nSeg, pSeg); - damageRegionProcessPending(pDrawable); + damageRegionProcessPending(pGC->pScreen, pDrawable); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); } @@ -1076,7 +1073,7 @@ damagePolyRectangle(DrawablePtr pDrawable, box.y2 = box.y1 + offset2; TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC); if (BOX_NOT_EMPTY(box)) - damageDamageBox(pDrawable, &box, pGC->subWindowMode); + damageDamageBox(pGC->pScreen, pDrawable, &box, pGC->subWindowMode); box.x1 = pRectsTmp->x - offset1; box.y1 = pRectsTmp->y + offset3; @@ -1084,7 +1081,7 @@ damagePolyRectangle(DrawablePtr pDrawable, box.y2 = box.y1 + pRectsTmp->height - offset2; TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC); if (BOX_NOT_EMPTY(box)) - damageDamageBox(pDrawable, &box, pGC->subWindowMode); + damageDamageBox(pGC->pScreen, pDrawable, &box, pGC->subWindowMode); box.x1 = pRectsTmp->x + pRectsTmp->width - offset1; box.y1 = pRectsTmp->y + offset3; @@ -1092,7 +1089,7 @@ damagePolyRectangle(DrawablePtr pDrawable, box.y2 = box.y1 + pRectsTmp->height - offset2; TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC); if (BOX_NOT_EMPTY(box)) - damageDamageBox(pDrawable, &box, pGC->subWindowMode); + damageDamageBox(pGC->pScreen, pDrawable, &box, pGC->subWindowMode); box.x1 = pRectsTmp->x - offset1; box.y1 = pRectsTmp->y + pRectsTmp->height - offset1; @@ -1100,13 +1097,13 @@ damagePolyRectangle(DrawablePtr pDrawable, box.y2 = box.y1 + offset2; TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC); if (BOX_NOT_EMPTY(box)) - damageDamageBox(pDrawable, &box, pGC->subWindowMode); + damageDamageBox(pGC->pScreen, pDrawable, &box, pGC->subWindowMode); pRectsTmp++; } } (*pGC->ops->PolyRectangle) (pDrawable, pGC, nRects, pRects); - damageRegionProcessPending(pDrawable); + damageRegionProcessPending(pGC->pScreen, pDrawable); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); } @@ -1150,10 +1147,10 @@ damagePolyArc(DrawablePtr pDrawable, GCPtr pGC, int nArcs, xArc * pArcs) TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC); if (BOX_NOT_EMPTY(box)) - damageDamageBox(pDrawable, &box, pGC->subWindowMode); + damageDamageBox(pGC->pScreen, pDrawable, &box, pGC->subWindowMode); } (*pGC->ops->PolyArc) (pDrawable, pGC, nArcs, pArcs); - damageRegionProcessPending(pDrawable); + damageRegionProcessPending(pGC->pScreen, pDrawable); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); } @@ -1208,11 +1205,11 @@ damageFillPolygon(DrawablePtr pDrawable, TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC); if (BOX_NOT_EMPTY(box)) - damageDamageBox(pDrawable, &box, pGC->subWindowMode); + damageDamageBox(pGC->pScreen, pDrawable, &box, pGC->subWindowMode); } (*pGC->ops->FillPolygon) (pDrawable, pGC, shape, mode, npt, ppt); - damageRegionProcessPending(pDrawable); + damageRegionProcessPending(pGC->pScreen, pDrawable); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); } @@ -1245,10 +1242,10 @@ damagePolyFillRect(DrawablePtr pDrawable, TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC); if (BOX_NOT_EMPTY(box)) - damageDamageBox(pDrawable, &box, pGC->subWindowMode); + damageDamageBox(pGC->pScreen, pDrawable, &box, pGC->subWindowMode); } (*pGC->ops->PolyFillRect) (pDrawable, pGC, nRects, pRects); - damageRegionProcessPending(pDrawable); + damageRegionProcessPending(pGC->pScreen, pDrawable); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); } @@ -1281,10 +1278,10 @@ damagePolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int nArcs, xArc * pArcs) TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC); if (BOX_NOT_EMPTY(box)) - damageDamageBox(pDrawable, &box, pGC->subWindowMode); + damageDamageBox(pGC->pScreen, pDrawable, &box, pGC->subWindowMode); } (*pGC->ops->PolyFillArc) (pDrawable, pGC, nArcs, pArcs); - damageRegionProcessPending(pDrawable); + damageRegionProcessPending(pGC->pScreen, pDrawable); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); } @@ -1294,7 +1291,8 @@ damagePolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int nArcs, xArc * pArcs) */ static void -damageDamageChars(DrawablePtr pDrawable, +damageDamageChars(ScreenPtr pScreen, + DrawablePtr pDrawable, FontPtr font, int x, int y, @@ -1321,7 +1319,7 @@ damageDamageChars(DrawablePtr pDrawable, box.y1 = y - extents.overallAscent; box.x2 = x + extents.overallRight; box.y2 = y + extents.overallDescent; - damageDamageBox(pDrawable, &box, subWindowMode); + damageDamageBox(pScreen, pDrawable, &box, subWindowMode); } /* @@ -1362,7 +1360,7 @@ damageText(DrawablePtr pDrawable, w += (*info)->metrics.characterWidth; if (n != 0) { - damageDamageChars(pDrawable, pGC->font, x + pDrawable->x, + damageDamageChars(pGC->pScreen, pDrawable, pGC->font, x + pDrawable->x, y + pDrawable->y, n, charinfo, imageblt, pGC->subWindowMode); if (imageblt) @@ -1387,7 +1385,7 @@ damagePolyText8(DrawablePtr pDrawable, Linear8Bit, TT_POLY8); else x = (*pGC->ops->PolyText8) (pDrawable, pGC, x, y, count, chars); - damageRegionProcessPending(pDrawable); + damageRegionProcessPending(pGC->pScreen, pDrawable); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); return x; } @@ -1405,7 +1403,7 @@ damagePolyText16(DrawablePtr pDrawable, TT_POLY16); else x = (*pGC->ops->PolyText16) (pDrawable, pGC, x, y, count, chars); - damageRegionProcessPending(pDrawable); + damageRegionProcessPending(pGC->pScreen, pDrawable); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); return x; } @@ -1421,7 +1419,7 @@ damageImageText8(DrawablePtr pDrawable, Linear8Bit, TT_IMAGE8); else (*pGC->ops->ImageText8) (pDrawable, pGC, x, y, count, chars); - damageRegionProcessPending(pDrawable); + damageRegionProcessPending(pGC->pScreen, pDrawable); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); } @@ -1437,7 +1435,7 @@ damageImageText16(DrawablePtr pDrawable, TT_IMAGE16); else (*pGC->ops->ImageText16) (pDrawable, pGC, x, y, count, chars); - damageRegionProcessPending(pDrawable); + damageRegionProcessPending(pGC->pScreen, pDrawable); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); } @@ -1449,10 +1447,10 @@ damageImageGlyphBlt(DrawablePtr pDrawable, unsigned int nglyph, CharInfoPtr * ppci, pointer pglyphBase) { DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - damageDamageChars(pDrawable, pGC->font, x + pDrawable->x, y + pDrawable->y, + damageDamageChars(pGC->pScreen, pDrawable, pGC->font, x + pDrawable->x, y + pDrawable->y, nglyph, ppci, TRUE, pGC->subWindowMode); (*pGC->ops->ImageGlyphBlt) (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase); - damageRegionProcessPending(pDrawable); + damageRegionProcessPending(pGC->pScreen, pDrawable); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); } @@ -1464,10 +1462,10 @@ damagePolyGlyphBlt(DrawablePtr pDrawable, unsigned int nglyph, CharInfoPtr * ppci, pointer pglyphBase) { DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - damageDamageChars(pDrawable, pGC->font, x + pDrawable->x, y + pDrawable->y, + damageDamageChars(pGC->pScreen, pDrawable, pGC->font, x + pDrawable->x, y + pDrawable->y, nglyph, ppci, FALSE, pGC->subWindowMode); (*pGC->ops->PolyGlyphBlt) (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase); - damageRegionProcessPending(pDrawable); + damageRegionProcessPending(pGC->pScreen, pDrawable); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); } @@ -1493,10 +1491,10 @@ damagePushPixels(GCPtr pGC, TRIM_BOX(box, pGC); if (BOX_NOT_EMPTY(box)) - damageDamageBox(pDrawable, &box, pGC->subWindowMode); + damageDamageBox(pGC->pScreen, pDrawable, &box, pGC->subWindowMode); } (*pGC->ops->PushPixels) (pGC, pBitMap, pDrawable, dx, dy, xOrg, yOrg); - damageRegionProcessPending(pDrawable); + damageRegionProcessPending(pGC->pScreen, pDrawable); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); } @@ -1561,7 +1559,7 @@ damageCopyWindow(ScreenPtr pScreen, { damageScrPriv(pScreen); - if (getWindowDamage(pWindow)) { + if (getWindowDamage(pScreen, pWindow)) { int dx = pWindow->drawable.x - ptOldOrg.x; int dy = pWindow->drawable.y - ptOldOrg.y; @@ -1570,12 +1568,12 @@ damageCopyWindow(ScreenPtr pScreen, * at the destination location. Translate back and forth. */ RegionTranslate(prgnSrc, dx, dy); - damageRegionAppend(&pWindow->drawable, prgnSrc, FALSE, -1); + damageRegionAppend(pScreen, &pWindow->drawable, prgnSrc, FALSE, -1); RegionTranslate(prgnSrc, -dx, -dy); } unwrap(pScrPriv, pScreen, CopyWindow); (*pScreen->CopyWindow) (pScreen, pWindow, ptOldOrg, prgnSrc); - damageRegionProcessPending(&pWindow->drawable); + damageRegionProcessPending(pScreen, &pWindow->drawable); wrap(pScrPriv, pScreen, CopyWindow, damageCopyWindow); } @@ -1802,7 +1800,7 @@ DamageRegister(DrawablePtr pDrawable, DamagePtr pDamage) else pDamage->isWindow = FALSE; pDamage->pDrawable = pDrawable; - damageInsertDamage(getDrawableDamageRef(pDrawable), pDamage); + damageInsertDamage(getDrawableDamageRef(pScreen, pDrawable), pDamage); (*pScrPriv->funcs.Register) (pDrawable, pDamage); } @@ -1849,7 +1847,7 @@ DamageUnregister(DrawablePtr pDrawable, DamagePtr pDamage) #endif } pDamage->pDrawable = 0; - damageRemoveDamage(getDrawableDamageRef(pDrawable), pDamage); + damageRemoveDamage(getDrawableDamageRef(pScreen, pDrawable), pDamage); } void @@ -1916,15 +1914,15 @@ DamagePendingRegion(DamagePtr pDamage) } void -DamageRegionAppend(DrawablePtr pDrawable, RegionPtr pRegion) +DamageRegionAppend(ScreenPtr pScreen, DrawablePtr pDrawable, RegionPtr pRegion) { - damageRegionAppend(pDrawable, pRegion, FALSE, -1); + damageRegionAppend(pScreen, pDrawable, pRegion, FALSE, -1); } void -DamageRegionProcessPending(DrawablePtr pDrawable) +DamageRegionProcessPending(ScreenPtr pScreen, DrawablePtr pDrawable) { - damageRegionProcessPending(pDrawable); + damageRegionProcessPending(pScreen, pDrawable); } /* If a damage marker is provided, then this function must be called after rendering is done. */ @@ -1940,15 +1938,15 @@ DamageRegionRendered(DrawablePtr pDrawable, DamagePtr pDamage, /* This call is very odd, i'm leaving it intact for API sake, but please don't use it. */ void -DamageDamageRegion(DrawablePtr pDrawable, RegionPtr pRegion) +DamageDamageRegion(ScreenPtr pScreen, DrawablePtr pDrawable, RegionPtr pRegion) { - damageRegionAppend(pDrawable, pRegion, FALSE, -1); + damageRegionAppend(pScreen, pDrawable, pRegion, FALSE, -1); /* Go back and report this damage for DamagePtrs with reportAfter set, since * this call isn't part of an in-progress drawing op in the call chain and * the DDX probably just wants to know about it right away. */ - damageRegionProcessPending(pDrawable); + damageRegionProcessPending(pScreen, pDrawable); } void diff --git a/miext/damage/damage.h b/miext/damage/damage.h index c2c313a15..5bc99092a 100644 --- a/miext/damage/damage.h +++ b/miext/damage/damage.h @@ -99,11 +99,11 @@ extern _X_EXPORT RegionPtr /* In case of rendering, call this before the submitting the commands. */ extern _X_EXPORT void - DamageRegionAppend(DrawablePtr pDrawable, RegionPtr pRegion); +DamageRegionAppend(ScreenPtr pScreen, DrawablePtr pDrawable, RegionPtr pRegion); /* Call this directly after the rendering operation has been submitted. */ extern _X_EXPORT void - DamageRegionProcessPending(DrawablePtr pDrawable); +DamageRegionProcessPending(ScreenPtr pScreen, DrawablePtr pDrawable); /* Call this some time after rendering is done, only relevant when a damageMarker is provided. */ extern _X_EXPORT void @@ -117,7 +117,7 @@ extern _X_EXPORT void /* Avoid using this call, it only exists for API compatibility. */ extern _X_EXPORT void - DamageDamageRegion(DrawablePtr pDrawable, const RegionPtr pRegion); +DamageDamageRegion(ScreenPtr pScreen, DrawablePtr pDrawable, const RegionPtr pRegion); extern _X_EXPORT void DamageSetReportAfterOp(DamagePtr pDamage, Bool reportAfter); |