diff options
author | Brian Paul <[email protected]> | 2009-01-06 08:15:54 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2009-01-06 08:15:54 -0700 |
commit | 374cf77b2f0f13f9380fb0c9d804222a83bdc2e0 (patch) | |
tree | 39cfbbcbbbdc9b2d64e4ad134472cf747101dc7b /src/mesa/drivers/dri/common | |
parent | 52d5d25537a9291f7d247211d2881ed56edaca94 (diff) | |
parent | a8ee35c1c59c23938e0a18b163515acc892ed407 (diff) |
Merge commit 'origin/master' into gallium-0.2
Conflicts:
src/mesa/drivers/dri/common/dri_util.c
Diffstat (limited to 'src/mesa/drivers/dri/common')
-rw-r--r-- | src/mesa/drivers/dri/common/dri_util.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index a2316e2662b..ae790554055 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -314,10 +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, |