Commit 40419611 authored by Vincent Wei's avatar Vincent Wei
Browse files

debug

parent 08a8d9d5
......@@ -122,7 +122,7 @@ int save_dirty_pixels_to_png (const char* file_name, const USClient* us_client)
png_set_sBIT (png_ptr, info_ptr, &sig_bit);
for (int i = 0; i < height; i++) {
pixel_rows[i] = (png_bytep)(us_client->shadow_fb
+ us_client->vfb_info.rlen * (us_client->rc_dirty.top + i) + us_client->rc_dirty.left * bytes_per_pixel);
+ us_client->row_pitch * (us_client->rc_dirty.top + i) + us_client->rc_dirty.left * bytes_per_pixel);
}
}
......
......@@ -310,7 +310,7 @@ int us_on_client_data (USClient* us_client)
dst_pixel [x*3 + 0] = (uint8_t)((pixel&0xFF0000)>>16);
dst_pixel [x*3 + 1] = (uint8_t)((pixel&0xFF00)>>8);
dst_pixel [x*3 + 2] = (uint8_t)((pixel&0xFF));
src_pixel += us_client->bytes_per_pixel;
src_pixel += 4;
}
}
else {
......@@ -319,7 +319,7 @@ int us_on_client_data (USClient* us_client)
dst_pixel [x*3 + 0] = (((pixel&0xF800)>>11)<<3);
dst_pixel [x*3 + 1] = (((pixel&0x07E0)>>5)<<2);
dst_pixel [x*3 + 2] = ((pixel&0x001F)<<3);
src_pixel += us_client->bytes_per_pixel;
src_pixel += 2;
}
}
......@@ -329,10 +329,16 @@ int us_on_client_data (USClient* us_client)
free (buff);
/* merge the dirty rect to whole dirty rect */
us_client->rc_dirty.left = (us_client->rc_dirty.left < rc_dirty.left) ? us_client->rc_dirty.left : rc_dirty.left;
us_client->rc_dirty.top = (us_client->rc_dirty.top < rc_dirty.top) ? us_client->rc_dirty.top : rc_dirty.top;
us_client->rc_dirty.right = (us_client->rc_dirty.right > rc_dirty.right) ? us_client->rc_dirty.right : rc_dirty.right;
us_client->rc_dirty.bottom = (us_client->rc_dirty.bottom > rc_dirty.bottom) ? us_client->rc_dirty.bottom : rc_dirty.bottom;
if ((us_client->rc_dirty.right - us_client->rc_dirty.left) <= 0
&& (us_client->rc_dirty.bottom - us_client->rc_dirty.top) <= 0) {
us_client->rc_dirty = rc_dirty;
}
else {
us_client->rc_dirty.left = (us_client->rc_dirty.left < rc_dirty.left) ? us_client->rc_dirty.left : rc_dirty.left;
us_client->rc_dirty.top = (us_client->rc_dirty.top < rc_dirty.top) ? us_client->rc_dirty.top : rc_dirty.top;
us_client->rc_dirty.right = (us_client->rc_dirty.right > rc_dirty.right) ? us_client->rc_dirty.right : rc_dirty.right;
us_client->rc_dirty.bottom = (us_client->rc_dirty.bottom > rc_dirty.bottom) ? us_client->rc_dirty.bottom : rc_dirty.bottom;
}
}
else if (header.type == FT_PONG) {
LOG (("us_on_client_data: got FT_PONG from client: %d\n", us_client->fd));
......
......@@ -2446,7 +2446,9 @@ check_dirty_pixels (WSServer* server)
int retval;
char png_path [20];
printf ("check_dirty_pixels: UnixSocket Client #%d has dirty pixels to send.\n", us_client->pid);
printf ("check_dirty_pixels: UnixSocket Client #%d has dirty pixels (%d, %d, %d, %d) to send.\n",
us_client->pid, us_client->rc_dirty.left, us_client->rc_dirty.top, us_client->rc_dirty.right, us_client->rc_dirty.bottom);
sprintf (png_path, "/tmp/wds-%d.png", us_client->pid);
if ((retval = save_dirty_pixels_to_png (png_path, us_client))) {
printf ("check_dirty_pixels: failed when calling save_dirty_pixels_to_png: %d\n", retval);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment