diff options
author | enikey <enikey@3789f03b-4d11-0410-bbf8-ca57d06f2519> | 2008-12-24 09:09:31 +0000 |
---|---|---|
committer | enikey <enikey@3789f03b-4d11-0410-bbf8-ca57d06f2519> | 2008-12-24 09:09:31 +0000 |
commit | 191695b3115fe410392bb9f8c460819944b0af75 (patch) | |
tree | aa9bbc6594909c70ae8393ee7cd1cad4d2c262d1 /java | |
parent | 1214ab114395fe16d9c86fe273d51ad8f36751d6 (diff) | |
download | tigervnc-191695b3115fe410392bb9f8c460819944b0af75.tar.gz tigervnc-191695b3115fe410392bb9f8c460819944b0af75.zip |
[BugFix] Negative statistics (pixel data, update rectangles etc). Fixed by replacing statistics variables type from int to long.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3457 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'java')
-rw-r--r-- | java/src/com/tightvnc/decoder/TightDecoder.java | 8 | ||||
-rw-r--r-- | java/src/com/tightvnc/vncviewer/VncCanvas.java | 22 | ||||
-rw-r--r-- | java/src/com/tightvnc/vncviewer/VncViewer.java | 10 |
3 files changed, 20 insertions, 20 deletions
diff --git a/java/src/com/tightvnc/decoder/TightDecoder.java b/java/src/com/tightvnc/decoder/TightDecoder.java index 33ba7dbb..ef07f9c6 100644 --- a/java/src/com/tightvnc/decoder/TightDecoder.java +++ b/java/src/com/tightvnc/decoder/TightDecoder.java @@ -57,7 +57,7 @@ public class TightDecoder extends RawDecoder implements ImageObserver { // JPEG processing statistic methods // - public int getNumJPEGRects() { + public long getNumJPEGRects() { return statNumRectsTightJPEG; } @@ -69,7 +69,7 @@ public class TightDecoder extends RawDecoder implements ImageObserver { // Tight processing statistic methods // - public int getNumTightRects() { + public long getNumTightRects() { return statNumRectsTight; } @@ -489,7 +489,7 @@ public class TightDecoder extends RawDecoder implements ImageObserver { private Rectangle jpegRect; private Repaintable repainatableControl = null; // Jpeg decoding statistics - private int statNumRectsTightJPEG = 0; + private long statNumRectsTightJPEG = 0; // Tight decoding statistics - private int statNumRectsTight = 0; + private long statNumRectsTight = 0; } diff --git a/java/src/com/tightvnc/vncviewer/VncCanvas.java b/java/src/com/tightvnc/vncviewer/VncCanvas.java index 32d709a1..823f8996 100644 --- a/java/src/com/tightvnc/vncviewer/VncCanvas.java +++ b/java/src/com/tightvnc/vncviewer/VncCanvas.java @@ -76,17 +76,17 @@ class VncCanvas extends Canvas // Update statistics. long statStartTime; // time on first framebufferUpdateRequest - int statNumUpdates; // counter for FramebufferUpdate messages - int statNumTotalRects; // rectangles in FramebufferUpdate messages - int statNumPixelRects; // the same, but excluding pseudo-rectangles - int statNumRectsTight; // Tight-encoded rectangles (including JPEG) - int statNumRectsTightJPEG; // JPEG-compressed Tight-encoded rectangles - int statNumRectsZRLE; // ZRLE-encoded rectangles - int statNumRectsHextile; // Hextile-encoded rectangles - int statNumRectsRaw; // Raw-encoded rectangles - int statNumRectsCopy; // CopyRect rectangles - int statNumBytesEncoded; // number of bytes in updates, as received - int statNumBytesDecoded; // number of bytes, as if Raw encoding was used + long statNumUpdates; // counter for FramebufferUpdate messages + long statNumTotalRects; // rectangles in FramebufferUpdate messages + long statNumPixelRects; // the same, but excluding pseudo-rectangles + long statNumRectsTight; // Tight-encoded rectangles (including JPEG) + long statNumRectsTightJPEG; // JPEG-compressed Tight-encoded rectangles + long statNumRectsZRLE; // ZRLE-encoded rectangles + long statNumRectsHextile; // Hextile-encoded rectangles + long statNumRectsRaw; // Raw-encoded rectangles + long statNumRectsCopy; // CopyRect rectangles + long statNumBytesEncoded; // number of bytes in updates, as received + long statNumBytesDecoded; // number of bytes, as if Raw encoding was used // True if we process keyboard and mouse events. boolean inputEnabled; diff --git a/java/src/com/tightvnc/vncviewer/VncViewer.java b/java/src/com/tightvnc/vncviewer/VncViewer.java index 7b913b33..4ff85ffa 100644 --- a/java/src/com/tightvnc/vncviewer/VncViewer.java +++ b/java/src/com/tightvnc/vncviewer/VncViewer.java @@ -838,12 +838,12 @@ public class VncViewer extends java.applet.Applet if (vc != null) { double sec = (System.currentTimeMillis() - vc.statStartTime) / 1000.0; double rate = Math.round(vc.statNumUpdates / sec * 100) / 100.0; - int nRealRects = vc.statNumPixelRects; - int nPseudoRects = vc.statNumTotalRects - vc.statNumPixelRects; + long nRealRects = vc.statNumPixelRects; + long nPseudoRects = vc.statNumTotalRects - vc.statNumPixelRects; System.out.println("Updates received: " + vc.statNumUpdates + " (" + nRealRects + " rectangles + " + nPseudoRects + " pseudo), " + rate + " updates/sec"); - int numRectsOther = nRealRects - vc.statNumRectsTight + long numRectsOther = nRealRects - vc.statNumRectsTight - vc.statNumRectsZRLE - vc.statNumRectsHextile - vc.statNumRectsRaw - vc.statNumRectsCopy; System.out.println("Rectangles:" + @@ -855,8 +855,8 @@ public class VncViewer extends java.applet.Applet " CopyRect=" + vc.statNumRectsCopy + " other=" + numRectsOther); - int raw = vc.statNumBytesDecoded; - int compressed = vc.statNumBytesEncoded; + long raw = vc.statNumBytesDecoded; + long compressed = vc.statNumBytesEncoded; if (compressed > 0) { double ratio = Math.round((double)raw / compressed * 1000) / 1000.0; System.out.println("Pixel data: " + vc.statNumBytesDecoded + |