ui/console: remove redundant format field
It's already part of PIXMAN image. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
cc6ba2c6f5
commit
ff174c67db
@ -152,7 +152,6 @@ typedef struct ScanoutTexture {
|
|||||||
} ScanoutTexture;
|
} ScanoutTexture;
|
||||||
|
|
||||||
typedef struct DisplaySurface {
|
typedef struct DisplaySurface {
|
||||||
pixman_format_code_t format;
|
|
||||||
pixman_image_t *image;
|
pixman_image_t *image;
|
||||||
uint8_t flags;
|
uint8_t flags;
|
||||||
#ifdef CONFIG_OPENGL
|
#ifdef CONFIG_OPENGL
|
||||||
@ -436,23 +435,23 @@ static inline int surface_height(DisplaySurface *s)
|
|||||||
return pixman_image_get_height(s->image);
|
return pixman_image_get_height(s->image);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline pixman_format_code_t surface_format(DisplaySurface *s)
|
||||||
|
{
|
||||||
|
return pixman_image_get_format(s->image);
|
||||||
|
}
|
||||||
|
|
||||||
static inline int surface_bits_per_pixel(DisplaySurface *s)
|
static inline int surface_bits_per_pixel(DisplaySurface *s)
|
||||||
{
|
{
|
||||||
int bits = PIXMAN_FORMAT_BPP(s->format);
|
int bits = PIXMAN_FORMAT_BPP(surface_format(s));
|
||||||
return bits;
|
return bits;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int surface_bytes_per_pixel(DisplaySurface *s)
|
static inline int surface_bytes_per_pixel(DisplaySurface *s)
|
||||||
{
|
{
|
||||||
int bits = PIXMAN_FORMAT_BPP(s->format);
|
int bits = PIXMAN_FORMAT_BPP(surface_format(s));
|
||||||
return DIV_ROUND_UP(bits, 8);
|
return DIV_ROUND_UP(bits, 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline pixman_format_code_t surface_format(DisplaySurface *s)
|
|
||||||
{
|
|
||||||
return s->format;
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef uint32_t console_ch_t;
|
typedef uint32_t console_ch_t;
|
||||||
|
|
||||||
static inline void console_write_ch(console_ch_t *dest, uint32_t ch)
|
static inline void console_write_ch(console_ch_t *dest, uint32_t ch)
|
||||||
|
@ -53,7 +53,7 @@ void surface_gl_create_texture(QemuGLShader *gls,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (surface->format) {
|
switch (surface_format(surface)) {
|
||||||
case PIXMAN_BE_b8g8r8x8:
|
case PIXMAN_BE_b8g8r8x8:
|
||||||
case PIXMAN_BE_b8g8r8a8:
|
case PIXMAN_BE_b8g8r8a8:
|
||||||
surface->glformat = GL_BGRA_EXT;
|
surface->glformat = GL_BGRA_EXT;
|
||||||
|
@ -1493,8 +1493,7 @@ DisplaySurface *qemu_create_displaysurface_from(int width, int height,
|
|||||||
DisplaySurface *surface = g_new0(DisplaySurface, 1);
|
DisplaySurface *surface = g_new0(DisplaySurface, 1);
|
||||||
|
|
||||||
trace_displaysurface_create_from(surface, width, height, format);
|
trace_displaysurface_create_from(surface, width, height, format);
|
||||||
surface->format = format;
|
surface->image = pixman_image_create_bits(format,
|
||||||
surface->image = pixman_image_create_bits(surface->format,
|
|
||||||
width, height,
|
width, height,
|
||||||
(void *)data, linesize);
|
(void *)data, linesize);
|
||||||
assert(surface->image != NULL);
|
assert(surface->image != NULL);
|
||||||
@ -1511,7 +1510,6 @@ DisplaySurface *qemu_create_displaysurface_pixman(pixman_image_t *image)
|
|||||||
DisplaySurface *surface = g_new0(DisplaySurface, 1);
|
DisplaySurface *surface = g_new0(DisplaySurface, 1);
|
||||||
|
|
||||||
trace_displaysurface_create_pixman(surface);
|
trace_displaysurface_create_pixman(surface);
|
||||||
surface->format = pixman_image_get_format(image);
|
|
||||||
surface->image = pixman_image_ref(image);
|
surface->image = pixman_image_ref(image);
|
||||||
|
|
||||||
return surface;
|
return surface;
|
||||||
|
2
ui/gtk.c
2
ui/gtk.c
@ -514,7 +514,7 @@ static void gd_switch(DisplayChangeListener *dcl,
|
|||||||
}
|
}
|
||||||
vc->gfx.ds = surface;
|
vc->gfx.ds = surface;
|
||||||
|
|
||||||
if (surface->format == PIXMAN_x8r8g8b8) {
|
if (surface_format(surface) == PIXMAN_x8r8g8b8) {
|
||||||
/*
|
/*
|
||||||
* PIXMAN_x8r8g8b8 == CAIRO_FORMAT_RGB24
|
* PIXMAN_x8r8g8b8 == CAIRO_FORMAT_RGB24
|
||||||
*
|
*
|
||||||
|
@ -437,7 +437,7 @@ void qemu_spice_display_switch(SimpleSpiceDisplay *ssd,
|
|||||||
}
|
}
|
||||||
if (ssd->ds) {
|
if (ssd->ds) {
|
||||||
ssd->surface = pixman_image_ref(ssd->ds->image);
|
ssd->surface = pixman_image_ref(ssd->ds->image);
|
||||||
ssd->mirror = qemu_pixman_mirror_create(ssd->ds->format,
|
ssd->mirror = qemu_pixman_mirror_create(surface_format(ssd->ds),
|
||||||
ssd->ds->image);
|
ssd->ds->image);
|
||||||
qemu_spice_create_host_primary(ssd);
|
qemu_spice_create_host_primary(ssd);
|
||||||
}
|
}
|
||||||
|
2
ui/vnc.c
2
ui/vnc.c
@ -833,7 +833,7 @@ static void vnc_dpy_switch(DisplayChangeListener *dcl,
|
|||||||
/* guest surface */
|
/* guest surface */
|
||||||
qemu_pixman_image_unref(vd->guest.fb);
|
qemu_pixman_image_unref(vd->guest.fb);
|
||||||
vd->guest.fb = pixman_image_ref(surface->image);
|
vd->guest.fb = pixman_image_ref(surface->image);
|
||||||
vd->guest.format = surface->format;
|
vd->guest.format = surface_format(surface);
|
||||||
|
|
||||||
|
|
||||||
if (pageflip) {
|
if (pageflip) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user