From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1OA6xq-0004ZX-EE for qemu-devel@nongnu.org; Thu, 06 May 2010 15:42:30 -0400 Received: from [140.186.70.92] (port=34810 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OA6xi-0004Ss-NI for qemu-devel@nongnu.org; Thu, 06 May 2010 15:42:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OA6xc-0004MU-7d for qemu-devel@nongnu.org; Thu, 06 May 2010 15:42:22 -0400 Received: from mail-px0-f173.google.com ([209.85.212.173]:44534) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OA6xc-0004MJ-1m for qemu-devel@nongnu.org; Thu, 06 May 2010 15:42:16 -0400 Received: by pxi19 with SMTP id 19so143309pxi.4 for ; Thu, 06 May 2010 12:42:15 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <4BE31833.5000904@redhat.com> References: <1273063904-6028-1-git-send-email-kraxel@redhat.com> <1273063904-6028-2-git-send-email-kraxel@redhat.com> <4BE31833.5000904@redhat.com> Date: Thu, 6 May 2010 22:42:14 +0300 Message-ID: Subject: Re: [Qemu-devel] [PATCH 1/3] cursor: add cursor functions. From: Blue Swirl Content-Type: text/plain; charset=UTF-8 List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel@nongnu.org On 5/6/10, Gerd Hoffmann wrote: > > > > > +static const char cursor_left_ptr_32[32*32] = { > > > + " " > > > + " X " > > > + " XX " > > > + " X.X " > > > + " X..X " > > > + " X...X " > > > + " X....X " > > > + " X.....X " > > > + " X......X " > > > + " X.......X " > > > + " X........X " > > > + " X.....XXXXX " > > > + " X..X..X " > > > + " X.X X..X " > > > + " XX X..X " > > > + " X X..X " > > > + " X..X " > > > + " X..X " > > > + " X..X " > > > + " XX " > > > + " " > > > +}; > > > > > > > Is this format standard? > > > > Inspiried by xpm but simplified a bit as full xpm support just for a > built-in fallback cursor would have been overkill. The nice thing about xpm > is that you can use any text editor for editing icons. But for X bitmaps, you can use any real drawing program. The same would also apply to full xpm. But read on. > > How about using X bitmap format instead: > > $ cat /usr/include/X11/bitmaps/left_ptr > > > > > > Then there would be no need of parsing. > > > > Well. You still would have to convert it as qemu internal cursor format is > defined as 32bit depth, rgb with alpha channel. So it doesn't buy you that > much. There's still more wasted memory compared to binary format. I think the best would be to store only the 32 bit image and perform any conversions offline. This was the approach with for example keyboard tables, we don't convert them at startup but the original tables are retained as comments.