From 30f1e661b640de58ba1e8178f7f2290179a7e01c Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Wed, 18 Jun 2014 11:03:15 +0200 Subject: console: stop using PixelFormat With this patch the qemu console core stops using PixelFormat and pixman format codes side-by-side, pixman format code is the primary way to specify the DisplaySurface format: * DisplaySurface stops carrying a PixelFormat field. * qemu_create_displaysurface_from() expects a pixman format now. Functions to convert PixelFormat to pixman_format_code_t (and back) exist for those who still use PixelFormat. As PixelFormat allows easy access to masks and shifts it will probably continue to exist. [ xenfb added by Benjamin Herrenschmidt ] Signed-off-by: Gerd Hoffmann --- include/ui/console.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'include/ui/console.h') diff --git a/include/ui/console.h b/include/ui/console.h index 845526ed01..68ac362f06 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -119,8 +119,6 @@ struct DisplaySurface { pixman_format_code_t format; pixman_image_t *image; uint8_t flags; - - struct PixelFormat pf; }; typedef struct QemuUIInfo { @@ -188,9 +186,9 @@ struct DisplayChangeListener { }; DisplayState *init_displaystate(void); -DisplaySurface* qemu_create_displaysurface_from(int width, int height, int bpp, - int linesize, uint8_t *data, - bool byteswap); +DisplaySurface *qemu_create_displaysurface_from(int width, int height, + pixman_format_code_t format, + int linesize, uint8_t *data); PixelFormat qemu_different_endianness_pixelformat(int bpp); PixelFormat qemu_default_pixelformat(int bpp); @@ -199,10 +197,12 @@ void qemu_free_displaysurface(DisplaySurface *surface); static inline int is_surface_bgr(DisplaySurface *surface) { - if (surface->pf.bits_per_pixel == 32 && surface->pf.rshift == 0) + if (PIXMAN_FORMAT_BPP(surface->format) == 32 && + PIXMAN_FORMAT_TYPE(surface->format) == PIXMAN_TYPE_ABGR) { return 1; - else + } else { return 0; + } } static inline int is_buffer_shared(DisplaySurface *surface) -- cgit v1.2.1