Revision: 4805
          http://tigervnc.svn.sourceforge.net/tigervnc/?rev=4805&view=rev
Author:   ossman_
Date:     2011-11-15 12:13:37 +0000 (Tue, 15 Nov 2011)
Log Message:
-----------
Client side support for continuous updates.

Modified Paths:
--------------
    trunk/vncviewer/CConn.cxx
    trunk/vncviewer/CConn.h

Modified: trunk/vncviewer/CConn.cxx
===================================================================
--- trunk/vncviewer/CConn.cxx   2011-11-15 12:11:32 UTC (rev 4804)
+++ trunk/vncviewer/CConn.cxx   2011-11-15 12:13:37 UTC (rev 4805)
@@ -72,7 +72,7 @@
     pendingPFChange(false),
     currentEncoding(encodingTight), lastServerEncoding((unsigned int)-1),
     formatChange(false), encodingChange(false),
-    firstUpdate(true), pendingUpdate(false),
+    firstUpdate(true), pendingUpdate(false), continuousUpdates(false),
     forceNonincremental(true), supportsSyncFence(false)
 {
   setShared(::shared);
@@ -306,8 +306,8 @@
   if (firstUpdate) {
     int width, height;
 
-    // We need fences to make extra update requests "safe".
-    // See fence() for the next step.
+    // We need fences to make extra update requests and continuous
+    // updates "safe". See fence() for the next step.
     if (cp.supportsFence)
       writer()->writeFence(fenceFlagRequest | fenceFlagSyncNext, 0, NULL);
 
@@ -448,8 +448,15 @@
 
   if (len == 0) {
     // Initial probe
-    if (flags & fenceFlagSyncNext)
+    if (flags & fenceFlagSyncNext) {
       supportsSyncFence = true;
+
+      if (cp.supportsContinuousUpdates) {
+        vlog.info(_("Enabling continuous updates"));
+        continuousUpdates = true;
+        writer()->writeEnableContinuousUpdates(true, 0, 0, cp.width, 
cp.height);
+      }
+    }
   } else {
     // Pixel format change
     rdr::MemInStream memStream(data, len);
@@ -477,6 +484,9 @@
   if (!desktop)
     return;
 
+  if (continuousUpdates)
+    writer()->writeEnableContinuousUpdates(true, 0, 0, cp.width, cp.height);
+
   desktop->resizeFramebuffer(cp.width, cp.height);
 }
 
@@ -609,9 +619,11 @@
 
   checkEncodings();
 
-  pendingUpdate = true;
-  writer()->writeFramebufferUpdateRequest(Rect(0, 0, cp.width, cp.height),
-                                          !forceNonincremental);
+  if (forceNonincremental || !continuousUpdates) {
+    pendingUpdate = true;
+    writer()->writeFramebufferUpdateRequest(Rect(0, 0, cp.width, cp.height),
+                                            !forceNonincremental);
+  }
  
   forceNonincremental = false;
 }

Modified: trunk/vncviewer/CConn.h
===================================================================
--- trunk/vncviewer/CConn.h     2011-11-15 12:11:32 UTC (rev 4804)
+++ trunk/vncviewer/CConn.h     2011-11-15 12:13:37 UTC (rev 4805)
@@ -107,6 +107,7 @@
 
   bool firstUpdate;
   bool pendingUpdate;
+  bool continuousUpdates;
 
   bool forceNonincremental;
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Tigervnc-commits mailing list
Tigervnc-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tigervnc-commits

Reply via email to