diff options
author | Pierre Ossman <ossman@cendio.se> | 2009-04-01 14:42:34 +0000 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2009-04-01 14:42:34 +0000 |
commit | 42d20e75c4f1b44ea2728f02c18f140611e92b44 (patch) | |
tree | 3b7b7439a676fdf3769e357c19cf9e8b58b86427 | |
parent | b900e369697423e214f2a9d3223924a4519bf90d (diff) | |
download | tigervnc-42d20e75c4f1b44ea2728f02c18f140611e92b44.tar.gz tigervnc-42d20e75c4f1b44ea2728f02c18f140611e92b44.zip |
Try to increase the update rate by requesting a new update in parallel with
decoding the current one.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3733 3789f03b-4d11-0410-bbf8-ca57d06f2519
-rw-r--r-- | unix/vncviewer/CConn.cxx | 22 | ||||
-rw-r--r-- | unix/vncviewer/CConn.h | 1 |
2 files changed, 22 insertions, 1 deletions
diff --git a/unix/vncviewer/CConn.cxx b/unix/vncviewer/CConn.cxx index 135794ae..8a9dfcff 100644 --- a/unix/vncviewer/CConn.cxx +++ b/unix/vncviewer/CConn.cxx @@ -300,6 +300,16 @@ void CConn::setName(const char* name) { } } +// framebufferUpdateStart() is called at the beginning of an update. +// Here we try to send out a new framebuffer update request so that the +// next update can be sent out in parallel with us decoding the current +// one. We cannot do this if we're in the middle of a format change +// though. +void CConn::framebufferUpdateStart() { + if (!formatChange) + requestNewUpdate(); +} + // framebufferUpdateEnd() is called at the end of an update. // For each rectangle, the FdInStream will have timed the speed // of the connection, allowing us to select format and encoding @@ -355,9 +365,19 @@ void CConn::framebufferUpdateEnd() { firstUpdate = false; } + // A format change prevented us from sending this before the update, + // so make sure to send it now. + if (formatChange) + requestNewUpdate(); + + // Compute new settings based on updated bandwidth values if (autoSelect) autoSelectFormatAndEncoding(); - requestNewUpdate(); + + // Make sure that the X11 handling and the timers gets some CPU time + // in case of back to back framebuffer updates. + TXWindow::handleXEvents(dpy); + Timer::checkTimeouts(); } // The rest of the callbacks are fairly self-explanatory... diff --git a/unix/vncviewer/CConn.h b/unix/vncviewer/CConn.h index 96a76fe4..3bf0a82e 100644 --- a/unix/vncviewer/CConn.h +++ b/unix/vncviewer/CConn.h @@ -81,6 +81,7 @@ public: void setColourMapEntries(int firstColour, int nColours, rdr::U16* rgbs); void bell(); void serverCutText(const char* str, int len); + void framebufferUpdateStart(); void framebufferUpdateEnd(); void beginRect(const rfb::Rect& r, unsigned int encoding); void endRect(const rfb::Rect& r, unsigned int encoding); |