From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LaZ0M-0000es-GW for qemu-devel@nongnu.org; Fri, 20 Feb 2009 12:17:38 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LaZ0L-0000eH-MW for qemu-devel@nongnu.org; Fri, 20 Feb 2009 12:17:38 -0500 Received: from [199.232.76.173] (port=39399 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LaZ0L-0000eA-Bd for qemu-devel@nongnu.org; Fri, 20 Feb 2009 12:17:37 -0500 Received: from fg-out-1718.google.com ([72.14.220.153]:55866) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LaZ0K-00044t-QP for qemu-devel@nongnu.org; Fri, 20 Feb 2009 12:17:37 -0500 Received: by fg-out-1718.google.com with SMTP id e21so1611804fga.8 for ; Fri, 20 Feb 2009 09:17:33 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <200902201652.55386.paul@codesourcery.com> References: <7fac565a0902150510y1fb01c6awd1dcc3b6e7b8232d@mail.gmail.com> <499EDC54.3020508@eu.citrix.com> <200902201652.55386.paul@codesourcery.com> Date: Fri, 20 Feb 2009 18:17:32 +0100 Message-ID: <761ea48b0902200917t4e156346ifd48489ce8864fe8@mail.gmail.com> Subject: Re: [Qemu-devel] Re: Qemu 2D performance plunges below acceptable levels From: Laurent Desnogues Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Fri, Feb 20, 2009 at 5:52 PM, Paul Brook wrote: >> =A0 =A0 =A0SDL_BlitSurface(guest_screen, &rec, real_screen, &rec); >> - =A0 =A0SDL_UpdateRect(real_screen, x, y, w, h); >> + =A0 =A0SDL_UpdateRects(real_screen, 1, &rec); > > Have you actually tried this? I'd be amazed and dismayed if it made any > difference. I can believe that SDL_UpdateRects is better that *multiple* > calls to SDL_UpdateRect. However I see absolutely no justification for th= is > change. UpdateRect is a thin wrapper around UpdateRects. So thin I don't believe it makes any difference (unless you're doing dozens of UpdateRect which is not the case here as you pointed). Laurent void SDL_UpdateRect(SDL_Surface *screen, Sint32 x, Sint32 y, Uint32 w, Uint= 32 h) { if ( screen ) { SDL_Rect rect; /* Perform some checking */ if ( w =3D=3D 0 ) w =3D screen->w; if ( h =3D=3D 0 ) h =3D screen->h; if ( (int)(x+w) > screen->w ) return; if ( (int)(y+h) > screen->h ) return; /* Fill the rectangle */ rect.x =3D (Sint16)x; rect.y =3D (Sint16)y; rect.w =3D (Uint16)w; rect.h =3D (Uint16)h; SDL_UpdateRects(screen, 1, &rect); } }