aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2023-08-30 13:38:21 +0400
committerMarc-André Lureau <marcandre.lureau@redhat.com>2023-09-12 10:37:02 +0400
commitff174c67dbe29ee2792cc020e077a0fff8af501c (patch)
tree6cded0d72e47f0e127e029784c4cc46a64786fa1 /ui
parentcc6ba2c6f53d9f6003a52845298807dac7709e0f (diff)
downloadqemu-ff174c67dbe29ee2792cc020e077a0fff8af501c.zip
qemu-ff174c67dbe29ee2792cc020e077a0fff8af501c.tar.gz
qemu-ff174c67dbe29ee2792cc020e077a0fff8af501c.tar.bz2
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>
Diffstat (limited to 'ui')
-rw-r--r--ui/console-gl.c2
-rw-r--r--ui/console.c4
-rw-r--r--ui/gtk.c2
-rw-r--r--ui/spice-display.c2
-rw-r--r--ui/vnc.c2
5 files changed, 5 insertions, 7 deletions
diff --git a/ui/console-gl.c b/ui/console-gl.c
index 8e3c9a3..103b954 100644
--- a/ui/console-gl.c
+++ b/ui/console-gl.c
@@ -53,7 +53,7 @@ void surface_gl_create_texture(QemuGLShader *gls,
return;
}
- switch (surface->format) {
+ switch (surface_format(surface)) {
case PIXMAN_BE_b8g8r8x8:
case PIXMAN_BE_b8g8r8a8:
surface->glformat = GL_BGRA_EXT;
diff --git a/ui/console.c b/ui/console.c
index 7c60fc7..4ff9f8b 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -1493,8 +1493,7 @@ DisplaySurface *qemu_create_displaysurface_from(int width, int height,
DisplaySurface *surface = g_new0(DisplaySurface, 1);
trace_displaysurface_create_from(surface, width, height, format);
- surface->format = format;
- surface->image = pixman_image_create_bits(surface->format,
+ surface->image = pixman_image_create_bits(format,
width, height,
(void *)data, linesize);
assert(surface->image != NULL);
@@ -1511,7 +1510,6 @@ DisplaySurface *qemu_create_displaysurface_pixman(pixman_image_t *image)
DisplaySurface *surface = g_new0(DisplaySurface, 1);
trace_displaysurface_create_pixman(surface);
- surface->format = pixman_image_get_format(image);
surface->image = pixman_image_ref(image);
return surface;
diff --git a/ui/gtk.c b/ui/gtk.c
index c05f9a3..e09f97a 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -514,7 +514,7 @@ static void gd_switch(DisplayChangeListener *dcl,
}
vc->gfx.ds = surface;
- if (surface->format == PIXMAN_x8r8g8b8) {
+ if (surface_format(surface) == PIXMAN_x8r8g8b8) {
/*
* PIXMAN_x8r8g8b8 == CAIRO_FORMAT_RGB24
*
diff --git a/ui/spice-display.c b/ui/spice-display.c
index 0e2fbfb..5cc47bd 100644
--- a/ui/spice-display.c
+++ b/ui/spice-display.c
@@ -437,7 +437,7 @@ void qemu_spice_display_switch(SimpleSpiceDisplay *ssd,
}
if (ssd->ds) {
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);
qemu_spice_create_host_primary(ssd);
}
diff --git a/ui/vnc.c b/ui/vnc.c
index 22894b7..6fd8699 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -833,7 +833,7 @@ static void vnc_dpy_switch(DisplayChangeListener *dcl,
/* guest surface */
qemu_pixman_image_unref(vd->guest.fb);
vd->guest.fb = pixman_image_ref(surface->image);
- vd->guest.format = surface->format;
+ vd->guest.format = surface_format(surface);
if (pageflip) {