summaryrefslogtreecommitdiffstats
path: root/x11vnc/screen.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/screen.c
parent5b607a444900246dfcc8497da4d8ef1e41bedda6 (diff)
downloadlibtdevnc-c9e24e5b8b9dd903a393f6b6e2176545fa2c93a8.tar.gz
libtdevnc-c9e24e5b8b9dd903a393f6b6e2176545fa2c93a8.zip
more speed and accuracy improvements to -ncache mode.
Diffstat (limited to 'x11vnc/screen.c')
-rw-r--r--x11vnc/screen.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/x11vnc/screen.c b/x11vnc/screen.c
index dc0a604..1768b60 100644
--- a/x11vnc/screen.c
+++ b/x11vnc/screen.c
@@ -2059,23 +2059,28 @@ void initialize_screen(int *argc, char **argv, XImage *fb) {
#ifndef NO_NCACHE
if (ncache > 0 && !nofb) {
-#ifdef MACOSX
+# ifdef MACOSX
if (! raw_fb_str || macosx_console) {
-#else
+# else
if (! raw_fb_str) {
-#endif
+# endif
char *new_fb;
int sz = fb->height * fb->bytes_per_line;
+ int ns = 1+ncache;
+
+ if (ncache_xrootpmap) {
+ ns++;
+ }
- new_fb = (char *) calloc((size_t) (sz * (1+ncache)), 1);
+ new_fb = (char *) calloc((size_t) (sz * ns), 1);
if (fb->data) {
memcpy(new_fb, fb->data, sz);
free(fb->data);
}
fb->data = new_fb;
- fb->height *= (1+ncache);
- height *= (1+ncache);
+ fb->height *= (ns);
+ height *= (ns);
ncache0 = ncache;
}
}