diff options
author | runge <runge> | 2006-01-15 03:58:48 +0000 |
---|---|---|
committer | runge <runge> | 2006-01-15 03:58:48 +0000 |
commit | 5993dd757e5af00af6565b3411ea10fd46eafbdf (patch) | |
tree | 7450fdde25310857c88221a719f026a1a09336f7 /x11vnc/scan.c | |
parent | 60918e6664cd62ea3d71b48cdfda8b89ab82029c (diff) | |
download | libtdevnc-5993dd757e5af00af6565b3411ea10fd46eafbdf.tar.gz libtdevnc-5993dd757e5af00af6565b3411ea10fd46eafbdf.zip |
x11vnc: add -8to24 option for some multi-depth displays.
Diffstat (limited to 'x11vnc/scan.c')
-rw-r--r-- | x11vnc/scan.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/x11vnc/scan.c b/x11vnc/scan.c index 45fbd3f..e956dc9 100644 --- a/x11vnc/scan.c +++ b/x11vnc/scan.c @@ -6,6 +6,7 @@ #include "xdamage.h" #include "xrandr.h" #include "win_utils.h" +#include "8to24.h" #include "screen.h" #include "pointer.h" #include "cleanup.h" @@ -1158,6 +1159,7 @@ void scale_rect(double factor, int blend, int interpolate, int Bpp, } void scale_and_mark_rect(int X1, int Y1, int X2, int Y2) { + char *src_fb = main_fb; if (!screen || !rfb_fb || !main_fb) { return; @@ -1181,8 +1183,12 @@ void scale_and_mark_rect(int X1, int Y1, int X2, int Y2) { } } + if (cmap8to24 && cmap8to24_fb) { + src_fb = cmap8to24_fb; + } + scale_rect(scale_fac, scaling_blend, scaling_interpolate, bpp/8, - main_fb, main_bytes_per_line, rfb_fb, rfb_bytes_per_line, + src_fb, main_bytes_per_line, rfb_fb, rfb_bytes_per_line, dpy_x, dpy_y, scaled_x, scaled_y, X1, Y1, X2, Y2, 1); } @@ -1212,8 +1218,17 @@ void mark_rect_as_modified(int x1, int y1, int x2, int y2, int force) { if (rfb_fb == main_fb || force) { rfbMarkRectAsModified(screen, x1, y1, x2, y2); - } else if (scaling) { + return; + } + + if (cmap8to24) { + bpp8to24(x1, y1, x2, y2); + } + + if (scaling) { scale_and_mark_rect(x1, y1, x2, y2); + } else { + rfbMarkRectAsModified(screen, x1, y1, x2, y2); } } @@ -2416,6 +2431,9 @@ int scan_for_updates(int count_only) { /* check for changed colormap */ set_colormap(0); } + if (cmap8to24 && scan_count % 4 == 0) { + check_for_multivis(); + } if (use_xdamage) { /* first pass collecting DAMAGE events: */ collect_xdamage(scan_count, 0); |