Make the comparing update tracker a bit more flexible. It can now be in an
"auto" state where it will be enabled until we deem that the client is better
of without it (currently triggered by explicitly stating a low compression
level).


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4809 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/common/rfb/ComparingUpdateTracker.h b/common/rfb/ComparingUpdateTracker.h
index 5d2e5ed..fccc222 100644
--- a/common/rfb/ComparingUpdateTracker.h
+++ b/common/rfb/ComparingUpdateTracker.h
@@ -29,14 +29,23 @@
     ~ComparingUpdateTracker();
 
     // compare() does the comparison and reduces its changed and copied regions
-    // as appropriate.
+    // as appropriate. Returns true if the regions were altered.
 
-    virtual void compare();
+    virtual bool compare();
+
+    // enable()/disable() turns the comparing functionality on/off. With it
+    // disabled, the object will behave like a dumb update tracker (i.e.
+    // compare() will be a no-op). It is harmless to repeatedly call these
+    // methods.
+
+    virtual void enable();
+    virtual void disable();
   private:
     void compareRect(const Rect& r, Region* newchanged);
     PixelBuffer* fb;
     ManagedPixelBuffer oldFb;
     bool firstCompare;
+    bool enabled;
   };
 
 }