]> source.dussan.org Git - tigervnc.git/commitdiff
Let CConnection intercept more callbacks
authorPierre Ossman <ossman@cendio.se>
Thu, 12 Nov 2015 11:20:05 +0000 (12:20 +0100)
committerPierre Ossman <ossman@cendio.se>
Fri, 27 Nov 2015 10:06:59 +0000 (11:06 +0100)
We need more callbacks for correct operation of multi-threaded
rect decoding.

common/rfb/CConnection.cxx
common/rfb/CConnection.h
tests/decperf.cxx
tests/encperf.cxx
vncviewer/CConn.cxx

index 49b8a82c88bb04552c110333370367b9e994593a..2ddfc3304f6468da82969608bd5d7b450eea005d 100644 (file)
@@ -301,6 +301,29 @@ void CConnection::securityCompleted()
   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);
index 7f8dbea0b8c3ef6c5511cf5a93f5db502803a8d1..6bc7a389083e4979dafc6c852acb22a410336437 100644 (file)
@@ -92,6 +92,15 @@ namespace rfb {
 
     // 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);
 
 
index dfd8a907ae6a27389d8ebc91797b7fa255549110..a200e5b4ce2762edf5855ba6f29cec9f44185d64 100644 (file)
@@ -99,11 +99,15 @@ void CConn::setCursor(int, int, const rfb::Point&, void*, void*)
 
 void CConn::framebufferUpdateStart()
 {
+  CConnection::framebufferUpdateStart();
+
   startCpuCounter();
 }
 
 void CConn::framebufferUpdateEnd()
 {
+  CConnection::framebufferUpdateEnd();
+
   endCpuCounter();
 
   cpuTime += getCpuCounter();
index 06c878d4da74411b77f3e1812f3346241670a1a6..211160896670a3047e0c2b903bd84d82069bbff7 100644 (file)
@@ -208,6 +208,8 @@ void CConn::setCursor(int, int, const rfb::Point&, void*, void*)
 
 void CConn::framebufferUpdateStart()
 {
+  CConnection::framebufferUpdateStart();
+
   updates.clear();
   startCpuCounter();
 }
@@ -218,6 +220,8 @@ void CConn::framebufferUpdateEnd()
   rfb::PixelBuffer* pb = getFramebuffer();
   rfb::Region clip(pb->getRect());
 
+  CConnection::framebufferUpdateEnd();
+
   endCpuCounter();
 
   decodeTime += getCpuCounter();
index 54716d3eb04c60114c980f16391fcbd5f85b0177..78eadb545e8f60232e5de9050def0f37b493b3ae 100644 (file)
@@ -342,6 +342,8 @@ void CConn::setName(const char* name)
 // one.
 void CConn::framebufferUpdateStart()
 {
+  CConnection::framebufferUpdateStart();
+
   // Note: This might not be true if sync fences are supported
   pendingUpdate = false;
 
@@ -357,6 +359,8 @@ void CConn::framebufferUpdateStart()
 // appropriately, and then request another incremental update.
 void CConn::framebufferUpdateEnd()
 {
+  CConnection::framebufferUpdateEnd();
+
   Fl::remove_timeout(handleUpdateTimeout, this);
   desktop->updateWindow();