]> source.dussan.org Git - tigervnc.git/commitdiff
Save a few X11 server roundtrips by ignoring empty damage regions. 763/head
authorChristian Authmann <8371862+cauthmann@users.noreply.github.com>
Sun, 11 Nov 2018 10:14:40 +0000 (11:14 +0100)
committerChristian Authmann <8371862+cauthmann@users.noreply.github.com>
Sun, 11 Nov 2018 10:14:40 +0000 (11:14 +0100)
Logging revealed that a few empty damage regions are emitted on startup. Those don't need to be rendered to the Surface pixmap.

vncviewer/PlatformPixelBuffer.cxx

index be6f70497f400d59f38502ad05e4440f541e5251..1e9803eb2c5f7e4d605131af19040ab0ef237d62 100644 (file)
@@ -104,6 +104,9 @@ rfb::Rect PlatformPixelBuffer::getDamage(void)
   mutex.unlock();
 
 #if !defined(WIN32) && !defined(__APPLE__)
+  if (r.width() == 0 || r.height() == 0)
+    return r;
+
   GC gc;
 
   gc = XCreateGC(fl_display, pixmap, 0, NULL);