diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2016-09-28 17:15:43 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2016-09-28 17:15:43 +0100 |
commit | 79907e688d07cd3a43c28c563968b57697b6a9cf (patch) | |
tree | 37639d9515677bbb299614ac3545afecc50ea2f0 /ui/console.c | |
parent | 3c87fafb90c108b1adb7451f6cc036480698e6f8 (diff) | |
parent | d9d2663c336b4ff7af9528f2cd3736791f4c0da5 (diff) |
Merge remote-tracking branch 'remotes/kraxel/tags/pull-ui-20160928-1' into staging
ui: console+vnc fixes, switch spice to pure opengl with gl=on.
# gpg: Signature made Wed 28 Sep 2016 11:57:35 BST
# gpg: using RSA key 0x4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg: aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>"
# Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138
* remotes/kraxel/tags/pull-ui-20160928-1:
ui/vnc-enc-tight: remove switch and have single return
spice/gl: render DisplaySurface via opengl
console: track gl_block state in QemuConsole
console: skip same-size resize
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'ui/console.c')
-rw-r--r-- | ui/console.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/ui/console.c b/ui/console.c index 3940762851..fa3e658edd 100644 --- a/ui/console.c +++ b/ui/console.c @@ -123,6 +123,7 @@ struct QemuConsole { DisplaySurface *surface; int dcls; DisplayChangeListener *gl; + bool gl_block; /* Graphic console state. */ Object *device; @@ -264,10 +265,10 @@ void graphic_hw_update(QemuConsole *con) void graphic_hw_gl_block(QemuConsole *con, bool block) { - if (!con) { - con = active_console; - } - if (con && con->hw_ops->gl_block) { + assert(con != NULL); + + con->gl_block = block; + if (con->hw_ops->gl_block) { con->hw_ops->gl_block(con->hw, block); } } @@ -1879,6 +1880,12 @@ bool qemu_console_is_fixedsize(QemuConsole *con) return con && (con->console_type != TEXT_CONSOLE); } +bool qemu_console_is_gl_blocked(QemuConsole *con) +{ + assert(con != NULL); + return con->gl_block; +} + char *qemu_console_get_label(QemuConsole *con) { if (con->console_type == GRAPHIC_CONSOLE) { @@ -2101,6 +2108,13 @@ void qemu_console_resize(QemuConsole *s, int width, int height) DisplaySurface *surface; assert(s->console_type == GRAPHIC_CONSOLE); + + if (s->surface && + pixman_image_get_width(s->surface->image) == width && + pixman_image_get_height(s->surface->image) == height) { + return; + } + surface = qemu_create_displaysurface(width, height); dpy_gfx_replace_surface(s, surface); } |