From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MJT1J-0003pP-Po for qemu-devel@nongnu.org; Wed, 24 Jun 2009 10:00:13 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MJT1F-0003m2-7X for qemu-devel@nongnu.org; Wed, 24 Jun 2009 10:00:13 -0400 Received: from [199.232.76.173] (port=43799 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MJT1E-0003lx-Uc for qemu-devel@nongnu.org; Wed, 24 Jun 2009 10:00:08 -0400 Received: from smtp.citrix.com ([66.165.176.89]:15610) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MJT1E-0005LZ-HH for qemu-devel@nongnu.org; Wed, 24 Jun 2009 10:00:08 -0400 Message-ID: <4A42328F.5070103@eu.citrix.com> Date: Wed, 24 Jun 2009 15:05:03 +0100 From: Stefano Stabellini MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] sdl zooming References: <4A4206D1.4010002@eu.citrix.com> <4A421EED.6030206@codemonkey.ws> In-Reply-To: <4A421EED.6030206@codemonkey.ws> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: "qemu-devel@nongnu.org" Anthony Liguori wrote: > Hi Stefano, > > First, really neat patch. Thank you, this time I spent a considerable amount of time in cleaning the patch up and testing it so that it would be easier to merge. > 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? The smooth==0 is a nearest neighbor algorithm, while the smooth==1 is a bilinear interpolation. > > 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? I think cairo is a good choice for a new qemu gtk-cairo frontend, but I don't think that mixing cairo and sdl is a good idea. Among other things they can have pixel format issues, and it seems to me that cairo is only able to use 32bpp SDL_Surface. If you really want a library than SDL_gfx should be used instead, but I think is overkill.