Don't Swap buffer if a DRIDrawable is entirely obscured
authorXiang, Haihao <haihao.xiang@intel.com>
Wed, 5 Dec 2007 02:31:35 +0000 (10:31 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Wed, 5 Dec 2007 02:31:35 +0000 (10:31 +0800)
by another window.

src/mesa/drivers/dri/common/dri_util.c

index 2e2e64c..2b378a5 100644 (file)
@@ -336,6 +336,9 @@ static void driSwapBuffers(__DRIdrawable *drawable)
     __DRIdrawablePrivate *dPriv = drawable->private;
     drm_clip_rect_t rect;
 
+    if (!dPriv->numClipRects)
+        return;
+
     dPriv->swapBuffers(dPriv);
 
     /* Check that we actually have the new damage report method */