From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43952) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkSt2-00012j-PV for qemu-devel@nongnu.org; Fri, 09 Oct 2015 04:18:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZkSsx-0003If-JW for qemu-devel@nongnu.org; Fri, 09 Oct 2015 04:18:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46478) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkSsx-0003IV-Ej for qemu-devel@nongnu.org; Fri, 09 Oct 2015 04:18:39 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id A5F229246B for ; Fri, 9 Oct 2015 08:18:38 +0000 (UTC) From: Gerd Hoffmann Date: Fri, 9 Oct 2015 10:18:25 +0200 Message-Id: <1444378714-15190-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1444378714-15190-1-git-send-email-kraxel@redhat.com> References: <1444378714-15190-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] [PULL 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