From c9e24e5b8b9dd903a393f6b6e2176545fa2c93a8 Mon Sep 17 00:00:00 2001 From: runge Date: Tue, 9 Jan 2007 04:55:37 +0000 Subject: more speed and accuracy improvements to -ncache mode. --- x11vnc/screen.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'x11vnc/screen.c') 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; } } -- cgit v1.2.1