summaryrefslogtreecommitdiffstats
path: root/x11vnc/xdamage.c
diff options
context:
space:
mode:
authorrunge <runge>2007-01-09 04:55:37 +0000
committerrunge <runge>2007-01-09 04:55:37 +0000
commitc9e24e5b8b9dd903a393f6b6e2176545fa2c93a8 (patch)
tree70fa77b47f34edf3091d6eb0b7a9c19f99a529d7 /x11vnc/xdamage.c
parent5b607a444900246dfcc8497da4d8ef1e41bedda6 (diff)
downloadlibtdevnc-c9e24e5b8b9dd903a393f6b6e2176545fa2c93a8.tar.gz
libtdevnc-c9e24e5b8b9dd903a393f6b6e2176545fa2c93a8.zip
more speed and accuracy improvements to -ncache mode.
Diffstat (limited to 'x11vnc/xdamage.c')
-rw-r--r--x11vnc/xdamage.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/x11vnc/xdamage.c b/x11vnc/xdamage.c
index 08e2278..5e9b4e1 100644
--- a/x11vnc/xdamage.c
+++ b/x11vnc/xdamage.c
@@ -546,6 +546,7 @@ int xdamage_hint_skip(int y) {
int ret, i, n, nreg;
static int ncache_no_skip = 0;
static double last_ncache_no_skip = 0.0;
+ static double last_ncache_no_skip_long = 0.0, ncache_fac = 0.25;
if (! xdamage_present || ! use_xdamage) {
return 0; /* cannot skip */
@@ -561,6 +562,7 @@ int xdamage_hint_skip(int y) {
nreg = (xdamage_memory * NSCAN) + 1;
+#ifndef NO_NCACHE
if (ncache > 0) {
if (ncache_no_skip == 0) {
double now = dnow();
@@ -575,16 +577,23 @@ int xdamage_hint_skip(int y) {
}
if (ncache_no_skip) {
last_ncache_no_skip = dnow();
+ if (now > last_ncache_no_skip_long + 60.0) {
+ ncache_fac = 2.0;
+ last_ncache_no_skip_long = now;
+ } else {
+ ncache_fac = 0.25;
+ }
return 0;
}
} else {
- if (ncache_no_skip++ >= 1*nreg + 4) {
+ if (ncache_no_skip++ >= ncache_fac*nreg + 4) {
ncache_no_skip = 0;
} else {
return 0;
}
}
}
+#endif
tmpl = sraRgnCreateRect(0, y, dpy_x, y+1);