diff options
author | runge <runge> | 2006-12-17 23:34:25 +0000 |
---|---|---|
committer | runge <runge> | 2006-12-17 23:34:25 +0000 |
commit | 8aa6fb9523957c7f4a3f14fb2c90ea9f9292a41f (patch) | |
tree | 82a97c679b609325b8df6c2c9a00a85525fde0a1 /x11vnc/xinerama.c | |
parent | 399a175f0bb44865cbf3d6762ad081e2a49cd4c4 (diff) | |
download | libtdevnc-8aa6fb9523957c7f4a3f14fb2c90ea9f9292a41f.tar.gz libtdevnc-8aa6fb9523957c7f4a3f14fb2c90ea9f9292a41f.zip |
x11vnc: first pass at client-side caching, -ncache option.
Diffstat (limited to 'x11vnc/xinerama.c')
-rw-r--r-- | x11vnc/xinerama.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/x11vnc/xinerama.c b/x11vnc/xinerama.c index 43d8061..7c36c93 100644 --- a/x11vnc/xinerama.c +++ b/x11vnc/xinerama.c @@ -382,11 +382,17 @@ void push_sleep(int n) { * try to forcefully push a black screen to all connected clients */ void push_black_screen(int n) { + int Lx = dpy_x, Ly = dpy_y; if (!screen) { return; } - zero_fb(0, 0, dpy_x, dpy_y); - mark_rect_as_modified(0, 0, dpy_x, dpy_y, 0); +#ifndef NO_NCACHE + if (ncache > 0) { + Ly = dpy_y * (1+ncache); + } +#endif + zero_fb(0, 0, Lx, Ly); + mark_rect_as_modified(0, 0, Lx, Ly, 0); push_sleep(n); } @@ -406,13 +412,19 @@ void refresh_screen(int push) { */ void zero_fb(int x1, int y1, int x2, int y2) { int pixelsize = bpp/8; - int line, fill = 0; + int line, fill = 0, yfac = 1; char *dst; + +#ifndef NO_NCACHE + if (ncache > 0) { + yfac = 1+ncache; + } +#endif if (x1 < 0 || x2 <= x1 || x2 > dpy_x) { return; } - if (y1 < 0 || y2 <= y1 || y2 > dpy_y) { + if (y1 < 0 || y2 <= y1 || y2 > yfac * dpy_y) { return; } if (! main_fb) { |