summaryrefslogtreecommitdiffstats
path: root/common/rfb/ComparingUpdateTracker.h
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2011-11-20 15:36:11 +0000
committerPierre Ossman <ossman@cendio.se>2011-11-20 15:36:11 +0000
commitb114cec89edf6d69c545712f29decac1631c94a2 (patch)
treede7d752926e99c906db2e718703a7a8a59b475c4 /common/rfb/ComparingUpdateTracker.h
parent53fd544c2f68b2ff97fb3f5e60734b281ce75ad3 (diff)
downloadtigervnc-b114cec89edf6d69c545712f29decac1631c94a2.tar.gz
tigervnc-b114cec89edf6d69c545712f29decac1631c94a2.zip
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
Diffstat (limited to 'common/rfb/ComparingUpdateTracker.h')
-rw-r--r--common/rfb/ComparingUpdateTracker.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/common/rfb/ComparingUpdateTracker.h b/common/rfb/ComparingUpdateTracker.h
index 5d2e5edf..fccc2222 100644
--- a/common/rfb/ComparingUpdateTracker.h
+++ b/common/rfb/ComparingUpdateTracker.h
@@ -29,14 +29,23 @@ namespace rfb {
~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;
};
}