diff options
author | Xiang, Haihao <haihao.xiang@intel.com> | 2009-01-06 11:22:19 +0800 |
---|---|---|
committer | Xiang, Haihao <haihao.xiang@intel.com> | 2009-01-06 11:22:19 +0800 |
commit | 7627c7f5dfa3b1bc7be9d1670668a81a70d9f64a (patch) | |
tree | 43c8f0b7b8e190d12d030081bc81bce907480c8e /src | |
parent | c5c9241cca3c57684db955390410c8cda44b785e (diff) |
dri: correct the damage.
Fixes bug #17234
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/common/dri_util.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index e9b1a80b91..ae79055405 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -314,13 +314,28 @@ static void driReportDamage(__DRIdrawable *pdp, static void driSwapBuffers(__DRIdrawable *dPriv) { __DRIscreen *psp = dPriv->driScreenPriv; - + drm_clip_rect_t *rects; + int i; + if (!dPriv->numClipRects) return; psp->DriverAPI.SwapBuffers(dPriv); - driReportDamage(dPriv, dPriv->pClipRects, dPriv->numClipRects); + rects = _mesa_malloc(sizeof(*rects) * dPriv->numClipRects); + + if (!rects) + return; + + for (i = 0; i < dPriv->numClipRects; i++) { + rects[i].x1 = dPriv->pClipRects[i].x1 - dPriv->x; + rects[i].y1 = dPriv->pClipRects[i].y1 - dPriv->y; + rects[i].x2 = dPriv->pClipRects[i].x2 - dPriv->x; + rects[i].y2 = dPriv->pClipRects[i].y2 - dPriv->y; + } + + driReportDamage(dPriv, rects, dPriv->numClipRects); + _mesa_free(rects); } static int driDrawableGetMSC( __DRIscreen *sPriv, __DRIdrawable *dPriv, |