From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51152) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZdR3-00044T-0a for qemu-devel@nongnu.org; Wed, 09 Sep 2015 07:21:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZdQy-00051q-Vh for qemu-devel@nongnu.org; Wed, 09 Sep 2015 07:21:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43037) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZdQy-00051k-QW for qemu-devel@nongnu.org; Wed, 09 Sep 2015 07:21:00 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 69A57C0AA26B for ; Wed, 9 Sep 2015 11:21:00 +0000 (UTC) From: Gerd Hoffmann Date: Wed, 9 Sep 2015 13:20:47 +0200 Message-Id: <1441797654-15350-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1441797654-15350-1-git-send-email-kraxel@redhat.com> References: <1441797654-15350-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 2/9] sdl2: quick & dirty flicker workaround 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 --- ui/sdl2-2d.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ui/sdl2-2d.c b/ui/sdl2-2d.c index d0b340f..191ee3b 100644 --- a/ui/sdl2-2d.c +++ b/ui/sdl2-2d.c @@ -45,10 +45,23 @@ void sdl2_2d_update(DisplayChangeListener *dcl, return; } + /* + * SDL2 seems to do some double-buffering, and trying to only + * update the changed areas results in only one of the two buffers + * being updated. Which flickers alot. So lets not try to be + * clever do a full update every time ... + */ +#if 0 rect.x = x; rect.y = y; rect.w = w; rect.h = h; +#else + rect.x = 0; + rect.y = 0; + rect.w = surface_width(surf); + rect.h = surface_height(surf); +#endif SDL_UpdateTexture(scon->texture, NULL, surface_data(surf), surface_stride(surf)); -- 1.8.3.1