qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] Guest mouse cursor drawing in SDL


From: andrzej zaborowski
Subject: Re: [Qemu-devel] [PATCH] Guest mouse cursor drawing in SDL
Date: Fri, 23 Mar 2007 14:57:01 +0100

Hi, sorry for late reply.

On 21/03/07, Anthony Liguori <address@hidden> wrote:
andrzej zaborowski wrote:
>> > (the pixel format of the cursor was the same as the pixel format of
>> DisplayState).
>
> I'm not sure if we want to always use the same pixel format - for
> example with VMware SVGA and SDL in 16 bit mode, the cursor pixel
> format reported by guest Xorg was 8 bpp. This would mean two
> conversions instead of one: first VMware SVGA would have to convert 8
> -> 16 bpp then SDL 16 -> 1 bpp.

VNC expects the cursor data to be in the current pixel format.  The nice
thing about this approach is you don't need to pass a bunch of pixel
info (for instance, you don't need to pass the depth, endianness, etc.).

True. Maybe it's worth doing the double conversion (in the VGA and
another one in SDL).


The Cirrus hardware cursor also has to be copied anyway and doing the
conversion is really straight forward.

>> One question in my mind is what the alpha mask should look like.  All
>> that VNC (and SDL) can use is a 1-bit alpha depth.  That's all Cirrus
>> supports too.  VMware SVGA supports an 8-bit alpha channel though so it
>> may make sense to design the interface now to support that.
>
> VMware SVGA without CAP_ALPHA_CURSOR also does only 1-bit alpha. Maybe
> we should keep two masks - if the frontend (e.g SDL) supports only
> 1-bit alpha it would use only this basic mask - if the emulated VGA
> supports only 1-bit alpha it would leave the other mask opaque.

I thought about that.  Right now with my patch, the cursor mask is
always 1-bit deep.  I was thinking that perhaps the right thing to do is
to make it always 8-bits deep and then convert in VNC.

Do you think using the SDL cursor is all that useful?  As soon as gtk
widgets get involved, the cursor becomes ARGB so in practice, I'm not
sure that it's all that helpful.

It's pretty cool that you have only one cursor and that it's either
"in the VM" or outside, and it's full hardware drawn. In addition
without it, I think you can't get cursor refreshes between the SDL
refresh callbacks. So with the patch the cursor movement is really
smooth and responsive, eliminating the SDL latency. I find it amazing
that it works :p

I think VNC support is not a reason to drop this couple of lines in
sdl.c (cause there's no API changes related).


BTW, I've got the ALPHA_CURSOR working with VNC.. it's very sweet :-)

Awesome! Are there screenshots?

Regards,
Andrew




reply via email to

[Prev in Thread] Current Thread [Next in Thread]