From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57004) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZhzVS-0004FX-J2 for qemu-devel@nongnu.org; Fri, 02 Oct 2015 08:32:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZhzVO-0001tI-Hi for qemu-devel@nongnu.org; Fri, 02 Oct 2015 08:32:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36085) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZhzVO-0001t8-D5 for qemu-devel@nongnu.org; Fri, 02 Oct 2015 08:32:06 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 06FC2461EE for ; Fri, 2 Oct 2015 12:32:06 +0000 (UTC) From: Gerd Hoffmann Date: Fri, 2 Oct 2015 14:31:47 +0200 Message-Id: <1443789116-27876-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1443789116-27876-1-git-send-email-kraxel@redhat.com> References: <1443789116-27876-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 v3 02/11] sdl2: stop flickering List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann 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