[Spice-devel] [PATCH spice-gtk] display: blank surface on creation

Marc-André Lureau marcandre.lureau at gmail.com
Wed Oct 16 21:08:47 CEST 2013


In theory, zero-ing the surface shouldn't be necessary, as only
invalidated/painted region should be shown. However, this results in
less artifacts on resolution changes (probably some regions are painted,
but with masks, blend, copy etc), in particular on console after VM
reboot.
---
 gtk/channel-display.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/gtk/channel-display.c b/gtk/channel-display.c
index a57453f..96b311d 100644
--- a/gtk/channel-display.c
+++ b/gtk/channel-display.c
@@ -723,7 +723,11 @@ static int create_canvas(SpiceChannel *channel, display_surface *surface)
     }
 
     if (surface->shmid == -1) {
-        surface->data = spice_malloc(surface->size);
+        /* in theory, zero-ing the surface shouldn't be necessary, as
+           only invalidated/painted region should be shown however,
+           this shows less artifact on resolution changes (probably
+           some regions are painted, but with masks etc) */
+        surface->data = g_malloc0(surface->size);
     }
 
     g_return_val_if_fail(c->glz_window, 0);
-- 
1.8.3.1



More information about the Spice-devel mailing list