Let CConnection intercept more callbacks
We need more callbacks for correct operation of multi-threaded
rect decoding.
diff --git a/common/rfb/CConnection.cxx b/common/rfb/CConnection.cxx
index 49b8a82..2ddfc33 100644
--- a/common/rfb/CConnection.cxx
+++ b/common/rfb/CConnection.cxx
@@ -301,6 +301,29 @@
writer_->writeClientInit(shared);
}
+void CConnection::setDesktopSize(int w, int h)
+{
+ CMsgHandler::setDesktopSize(w,h);
+}
+
+void CConnection::setExtendedDesktopSize(unsigned reason,
+ unsigned result,
+ int w, int h,
+ const ScreenSet& layout)
+{
+ CMsgHandler::setExtendedDesktopSize(reason, result, w, h, layout);
+}
+
+void CConnection::framebufferUpdateStart()
+{
+ CMsgHandler::framebufferUpdateStart();
+}
+
+void CConnection::framebufferUpdateEnd()
+{
+ CMsgHandler::framebufferUpdateEnd();
+}
+
void CConnection::dataRect(const Rect& r, int encoding)
{
decoder.decodeRect(r, encoding, framebuffer);
diff --git a/common/rfb/CConnection.h b/common/rfb/CConnection.h
index 7f8dbea..6bc7a38 100644
--- a/common/rfb/CConnection.h
+++ b/common/rfb/CConnection.h
@@ -92,6 +92,15 @@
// Methods overridden from CMsgHandler
+ // Note: These must be called by any deriving classes
+
+ virtual void setDesktopSize(int w, int h);
+ virtual void setExtendedDesktopSize(unsigned reason, unsigned result,
+ int w, int h,
+ const ScreenSet& layout);
+
+ virtual void framebufferUpdateStart();
+ virtual void framebufferUpdateEnd();
virtual void dataRect(const Rect& r, int encoding);
diff --git a/tests/decperf.cxx b/tests/decperf.cxx
index dfd8a90..a200e5b 100644
--- a/tests/decperf.cxx
+++ b/tests/decperf.cxx
@@ -99,11 +99,15 @@
void CConn::framebufferUpdateStart()
{
+ CConnection::framebufferUpdateStart();
+
startCpuCounter();
}
void CConn::framebufferUpdateEnd()
{
+ CConnection::framebufferUpdateEnd();
+
endCpuCounter();
cpuTime += getCpuCounter();
diff --git a/tests/encperf.cxx b/tests/encperf.cxx
index 06c878d..2111608 100644
--- a/tests/encperf.cxx
+++ b/tests/encperf.cxx
@@ -208,6 +208,8 @@
void CConn::framebufferUpdateStart()
{
+ CConnection::framebufferUpdateStart();
+
updates.clear();
startCpuCounter();
}
@@ -218,6 +220,8 @@
rfb::PixelBuffer* pb = getFramebuffer();
rfb::Region clip(pb->getRect());
+ CConnection::framebufferUpdateEnd();
+
endCpuCounter();
decodeTime += getCpuCounter();
diff --git a/vncviewer/CConn.cxx b/vncviewer/CConn.cxx
index 54716d3..78eadb5 100644
--- a/vncviewer/CConn.cxx
+++ b/vncviewer/CConn.cxx
@@ -342,6 +342,8 @@
// one.
void CConn::framebufferUpdateStart()
{
+ CConnection::framebufferUpdateStart();
+
// Note: This might not be true if sync fences are supported
pendingUpdate = false;
@@ -357,6 +359,8 @@
// appropriately, and then request another incremental update.
void CConn::framebufferUpdateEnd()
{
+ CConnection::framebufferUpdateEnd();
+
Fl::remove_timeout(handleUpdateTimeout, this);
desktop->updateWindow();