From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35391) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zf2TP-0008Pj-UN for qemu-devel@nongnu.org; Thu, 24 Sep 2015 05:05:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zf2TL-000656-Es for qemu-devel@nongnu.org; Thu, 24 Sep 2015 05:05:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54613) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zf2TL-00063n-2Q for qemu-devel@nongnu.org; Thu, 24 Sep 2015 05:05:47 -0400 From: Gerd Hoffmann Date: Thu, 24 Sep 2015 11:04:53 +0200 Message-Id: <1443085502-596-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1443085502-596-1-git-send-email-kraxel@redhat.com> References: <1443085502-596-1-git-send-email-kraxel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v2 02/11] sdl2: stop flickering List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: David Airlie , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann , Max Reitz Optimizing updates by copying the dirty rectangle only do not work because of double-buffering. Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Max Reitz --- 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; } =20 + /* + * 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 =3D x; rect.y =3D y; rect.w =3D w; rect.h =3D h; +#else + rect.x =3D 0; + rect.y =3D 0; + rect.w =3D surface_width(surf); + rect.h =3D surface_height(surf); +#endif =20 SDL_UpdateTexture(scon->texture, NULL, surface_data(surf), surface_stride(surf)); --=20 1.8.3.1