From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MJRn6-0002ve-RB for qemu-devel@nongnu.org; Wed, 24 Jun 2009 08:41:28 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MJRn1-0002rI-Tj for qemu-devel@nongnu.org; Wed, 24 Jun 2009 08:41:28 -0400 Received: from [199.232.76.173] (port=52963 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MJRn1-0002r6-OD for qemu-devel@nongnu.org; Wed, 24 Jun 2009 08:41:23 -0400 Received: from mx20.gnu.org ([199.232.41.8]:9004) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MJRn1-0002Bn-9L for qemu-devel@nongnu.org; Wed, 24 Jun 2009 08:41:23 -0400 Received: from qw-out-1920.google.com ([74.125.92.144]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MJRn0-0000mb-AM for qemu-devel@nongnu.org; Wed, 24 Jun 2009 08:41:22 -0400 Received: by qw-out-1920.google.com with SMTP id 5so142009qwc.4 for ; Wed, 24 Jun 2009 05:41:20 -0700 (PDT) Message-ID: <4A421EED.6030206@codemonkey.ws> Date: Wed, 24 Jun 2009 07:41:17 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] sdl zooming References: <4A4206D1.4010002@eu.citrix.com> In-Reply-To: <4A4206D1.4010002@eu.citrix.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefano Stabellini Cc: "qemu-devel@nongnu.org" Stefano Stabellini wrote: > Hi all, > this patch implements zooming capabilities for the sdl interface. > A new sdl_zoom_blit function is added that is able to scale and blit a > portion of a surface into another. > This way we can enable SDL_RESIZABLE and have a real_screen surface with > a different size than the guest surface and let sdl_zoom_blit take care > of the problem. > > Signed-off-by: Stefano Stabellini > Hi Stefano, First, really neat patch. I was looking at this recently myself. I cannot tell quickly from looking at the code--perhaps not enough caffeine yet this morning. Is this nearest neighbor with some sort of smoothing mechanism on top? In my experiences with scaling VM displays, bilinear interpolation seems to fit the use case here well as it does best from 1.0-2.0x which is more or less what you'll commonly see. Bilinear interpolation can be implemented rather effectively on most processors and is usually hardware supported too. That suggests that using a library is the right approach to avoid maintaining platform-specific code. Cairo seems to be a good choice. It integrates well with SDL and is portable to all of the platforms we care about. It's a very simple API too for scaling. We use it in gtk-vnc and it has proven to be very good for this task. What do you think? http://cairographics.org/SDL/ Regards, Anthony Liguori