[Spice-devel] RFC: client: don't invalidate unless primary surface

Alon Levy alevy at redhat.com
Sun May 23 11:40:23 PDT 2010


Izik suggested this, said it will save some performance - in bitmap operations on non primary surfaces no need to invalidate the rectangle. Did some very minimal tests on windows xp guest. Can anyone have a look?

Alon


diff --git a/client/display_channel.cpp b/client/display_channel.cpp
index abfe636..5d18517 100644
--- a/client/display_channel.cpp
+++ b/client/display_channel.cpp
@@ -1534,7 +1534,9 @@ void DisplayChannel::handle_surface_destroy(RedPeer::InMessage* message
     PRE_DRAW;                                       \
     canvas->draw_##type(*type, message->size());    \
     POST_DRAW;                                      \
-    invalidate(type->base.box, false);              \
+    if (type->base.surface_id == 0) {               \
+        invalidate(type->base.box, false);          \
+    }                                               \
 }
 
 void DisplayChannel::handle_copy_bits(RedPeer::InMessage* message)
@@ -1545,7 +1547,9 @@ void DisplayChannel::handle_copy_bits(RedPeer::InMessage* message)
     canvas = surfaces_mngr.get_canvas(copy_bits->base.surface_id);
     canvas->copy_bits(*copy_bits, message->size());
     POST_DRAW;
-    invalidate(copy_bits->base.box, false);
+    if (copy_bits->base.surface_id == 0) {
+        invalidate(copy_bits->base.box, false);
+    }
 }
 
 void DisplayChannel::handle_draw_fill(RedPeer::InMessage* message)


More information about the Spice-devel mailing list