Mercurial > hg > Applications > TreeVNC
changeset 591:665d58cc7f1a
fix phase 1
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 13 Feb 2020 07:25:30 +0900 |
parents | 3accb09e430c |
children | 415fd7dd09f0 |
files | src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEDecoder.java src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java |
diffstat | 2 files changed, 7 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEDecoder.java Wed Feb 12 21:58:00 2020 +0900 +++ b/src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEDecoder.java Thu Feb 13 07:25:30 2020 +0900 @@ -157,6 +157,7 @@ int span = offset - prevoffset; deflater.setInput(bytes, prevoffset, span); width += tileW; + c1rect.width += tileW; do { deflater.deflate(c1, Deflater.SYNC_FLUSH); if (!deflater.needsInput()) { @@ -201,19 +202,21 @@ flushRectangle(c1rect); c1.position((c1.position()+16)); // make next header space c1rect = new FramebufferUpdateRectangle(rect.x,c1rect.y+tileH,0,0); + width = 0; } } else { // phase 1 if (width >= rect.width) { // next line prevC1LineOffset = c1.position(); - c1rect.width = rect.width; - width = tileH; + c1rect.width = 0; + width = 0; if (c0rect!=null) { // extend phase 1 c0rect.height += tileH; c0rect.width += tileW; c1rect = new FramebufferUpdateRectangle(rect.x, c0rect.y+c0rect.height,0,0); + width = 0; } else { // first phase 1 case c0rect = c1rect; - c1rect = new FramebufferUpdateRectangle(rect.x, c1rect.y, width, tileH); + c1rect = new FramebufferUpdateRectangle(rect.x, c1rect.y, 0, 0); } prevLineOffset = offset; } @@ -322,8 +325,6 @@ } for (int tileX = rect.x; tileX < maxX; tileX += MAX_TILE_SIZE) { int tileWidth = Math.min(maxX - tileX, MAX_TILE_SIZE); - if (tileloop.blocking && tileloop.c1rect.x + tileloop.c1rect.width < rect.x + rect.width) - tileloop.c1rect.width += tileWidth; int subencoding = bytes[offset++] & 0x0ff; if (subencoding != 0) System.out.println("----------------" + subencoding);
--- a/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Wed Feb 12 21:58:00 2020 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Thu Feb 13 07:25:30 2020 +0900 @@ -416,7 +416,7 @@ }else { System.out.println("Bytes is not equal length "+buf.remaining()+" - "+span + " = " + (buf.remaining() - span)); } - dump("in ",bytes,flushOffset,8); dump("... ",bytes,flushEnd-20,40); + dump("in ",bytes,flushOffset,8); dump("... ",bytes,flushEnd-8,8); System.out.println(); dump("out ",buf.array(),buf.position(),8); dump("... ",buf.array(),buf.limit()-8,8); System.out.println();