ui/cocoa: Add cursor composition
commitd2277f02b819c795e671ce27f4a48d5e8fce97b9
authorAkihiko Odaki <akihiko.odaki@daynix.com>
Mon, 15 Jul 2024 05:25:44 +0000 (15 14:25 +0900)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 16 Jul 2024 18:04:08 +0000 (16 20:04 +0200)
tree25b978b9afa8b7c1c1585b3be0ed5b18b535ae2a
parenta418e7aeea14d1cbe7dc9160aa0874bc1056ae74
ui/cocoa: Add cursor composition

Add accelerated cursor composition to ui/cocoa. This does not only
improve performance for display devices that exposes the capability to
the guest according to dpy_cursor_define_supported(), but fixes the
cursor display for devices that unconditionally expects the availability
of the capability (e.g., virtio-gpu).

The common pattern to implement accelerated cursor composition is to
replace the cursor and warp it so that the replaced cursor is shown at
the correct position on the guest display for relative pointer devices.
Unfortunately, ui/cocoa cannot do the same because warping the cursor
position interfers with the mouse input so it uses CALayer instead;
although it is not specialized for cursor composition, it still can
compose images with hardware acceleration.

Co-authored-by: Phil Dennis-Jordan <phil@philjordan.eu>
Tested-by: Phil Dennis-Jordan <phil@philjordan.eu>
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Message-ID: <20240715-cursor-v3-3-afa5b9492dbf@daynix.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
meson.build
ui/cocoa.m