mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-30 22:03:54 -06:00
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 <kraxel@redhat.com>
This commit is contained in:
parent
56bd9ea1a3
commit
30f1e661b6
8 changed files with 42 additions and 45 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue