summaryrefslogtreecommitdiffstats
path: root/x11vnc/screen.c
diff options
context:
space:
mode:
authorrunge <runge>2006-12-17 23:34:25 +0000
committerrunge <runge>2006-12-17 23:34:25 +0000
commit8aa6fb9523957c7f4a3f14fb2c90ea9f9292a41f (patch)
tree82a97c679b609325b8df6c2c9a00a85525fde0a1 /x11vnc/screen.c
parent399a175f0bb44865cbf3d6762ad081e2a49cd4c4 (diff)
downloadlibtdevnc-8aa6fb9523957c7f4a3f14fb2c90ea9f9292a41f.tar.gz
libtdevnc-8aa6fb9523957c7f4a3f14fb2c90ea9f9292a41f.zip
x11vnc: first pass at client-side caching, -ncache option.
Diffstat (limited to 'x11vnc/screen.c')
-rw-r--r--x11vnc/screen.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/x11vnc/screen.c b/x11vnc/screen.c
index 45e951d..57244a5 100644
--- a/x11vnc/screen.c
+++ b/x11vnc/screen.c
@@ -2033,6 +2033,23 @@ void initialize_screen(int *argc, char **argv, XImage *fb) {
}
}
+#ifndef NO_NCACHE
+ if (ncache > 0) {
+ char *new_fb;
+ int sz = fb->height * fb->bytes_per_line;
+
+ new_fb = (char *) calloc((size_t) (sz * (1+ncache)), 1);
+ if (fb->data) {
+ memcpy(new_fb, fb->data, sz);
+ free(fb->data);
+ }
+ fb->data = new_fb;
+ fb->height *= (1+ncache);
+ height *= (1+ncache);
+ ncache0 = ncache;
+ }
+#endif
+
if (cmap8to24 && depth == 8) {
rfb_bytes_per_line *= 4;
rot_bytes_per_line *= 4;