From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34592) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TjQ6I-0006k0-QY for qemu-devel@nongnu.org; Fri, 14 Dec 2012 02:54:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TjQ6G-0005od-P6 for qemu-devel@nongnu.org; Fri, 14 Dec 2012 02:54:30 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50350) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TjQ6G-0005oX-HW for qemu-devel@nongnu.org; Fri, 14 Dec 2012 02:54:28 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qBE7sRet009952 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 14 Dec 2012 02:54:28 -0500 From: Gerd Hoffmann Date: Fri, 14 Dec 2012 08:54:25 +0100 Message-Id: <1355471665-23903-6-git-send-email-kraxel@redhat.com> In-Reply-To: <1355471665-23903-1-git-send-email-kraxel@redhat.com> References: <1355471665-23903-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 5/5] console: clip update rectangle List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann Signed-off-by: Gerd Hoffmann --- console.h | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/console.h b/console.h index 50a0512..edb1950 100644 --- a/console.h +++ b/console.h @@ -229,6 +229,16 @@ static inline void unregister_displaychangelistener(DisplayState *ds, static inline void dpy_gfx_update(DisplayState *s, int x, int y, int w, int h) { struct DisplayChangeListener *dcl; + int width = pixman_image_get_width(s->surface->image); + int height = pixman_image_get_height(s->surface->image); + + x = MAX(x, 0); + y = MAX(y, 0); + x = MIN(x, width); + y = MIN(y, height); + w = MIN(w, width - x); + h = MIN(h, height - y); + QLIST_FOREACH(dcl, &s->listeners, next) { if (dcl->dpy_gfx_update) { dcl->dpy_gfx_update(s, x, y, w, h); -- 1.7.1