mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
ui: refactor using a common qemu_pixman_shareable
Use a common shareable type for win32 & unix, and helper functions. This simplify the code as it avoids a lot of #ifdef'ery. Note: if it helps review, commits could be reordered to introduce the common type before introducing shareable memory for unix. Suggested-by: Akihiko Odaki <akihiko.odaki@daynix.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com> Message-ID: <20241008125028.1177932-19-marcandre.lureau@redhat.com>
This commit is contained in:
+6
-14
@@ -23,13 +23,8 @@ typedef struct DisplaySurface {
|
||||
GLenum gltype;
|
||||
GLuint texture;
|
||||
#endif
|
||||
#ifdef WIN32
|
||||
HANDLE handle;
|
||||
uint32_t handle_offset;
|
||||
#else
|
||||
int shmfd;
|
||||
uint32_t shmfd_offset;
|
||||
#endif
|
||||
qemu_pixman_shareable share_handle;
|
||||
uint32_t share_handle_offset;
|
||||
} DisplaySurface;
|
||||
|
||||
PixelFormat qemu_default_pixelformat(int bpp);
|
||||
@@ -40,13 +35,10 @@ DisplaySurface *qemu_create_displaysurface_from(int width, int height,
|
||||
DisplaySurface *qemu_create_displaysurface_pixman(pixman_image_t *image);
|
||||
DisplaySurface *qemu_create_placeholder_surface(int w, int h,
|
||||
const char *msg);
|
||||
#ifdef WIN32
|
||||
void qemu_displaysurface_win32_set_handle(DisplaySurface *surface,
|
||||
HANDLE h, uint32_t offset);
|
||||
#else
|
||||
void qemu_displaysurface_set_shmfd(DisplaySurface *surface,
|
||||
int shmfd, uint32_t offset);
|
||||
#endif
|
||||
|
||||
void qemu_displaysurface_set_share_handle(DisplaySurface *surface,
|
||||
qemu_pixman_shareable handle,
|
||||
uint32_t offset);
|
||||
|
||||
DisplaySurface *qemu_create_displaysurface(int width, int height);
|
||||
void qemu_free_displaysurface(DisplaySurface *surface);
|
||||
|
||||
Reference in New Issue
Block a user