From b742ad828d825c512f2b1d2c09ed1853f4d178b2 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 17 Jun 2008 11:41:09 +0930 Subject: [PATCH] Report damage before modifying the area, not after. If we copy the area before reporting the damage in this area, the server may restore buffered data over the new data, leading to artefacts on the screen. Reproducable with two cursors (second of which is SW rendered) and moving windows around in compiz. --- src/mesa/drivers/dri/common/dri_util.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index 10d2e80..e4bb276 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -509,13 +509,13 @@ static void driCopySubBuffer(__DRIdrawable *dPriv, { drm_clip_rect_t rect; - dPriv->driScreenPriv->DriverAPI.CopySubBuffer(dPriv, x, y, w, h); - rect.x1 = x; rect.y1 = dPriv->h - y - h; rect.x2 = x + w; rect.y2 = rect.y1 + h; driReportDamage(dPriv, &rect, 1); + + dPriv->driScreenPriv->DriverAPI.CopySubBuffer(dPriv, x, y, w, h); } const __DRIcopySubBufferExtension driCopySubBufferExtension = { -- 1.5.3