From 1214ab114395fe16d9c86fe273d51ad8f36751d6 Mon Sep 17 00:00:00 2001 From: enikey Date: Wed, 24 Dec 2008 09:01:19 +0000 Subject: [PATCH] [BugFix] Tight encoding statistics enabled. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3456 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- java/src/com/tightvnc/decoder/TightDecoder.java | 16 ++++++++++++++++ java/src/com/tightvnc/vncviewer/VncCanvas.java | 6 +++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/java/src/com/tightvnc/decoder/TightDecoder.java b/java/src/com/tightvnc/decoder/TightDecoder.java index a1d28d70..33ba7dbb 100644 --- a/java/src/com/tightvnc/decoder/TightDecoder.java +++ b/java/src/com/tightvnc/decoder/TightDecoder.java @@ -65,6 +65,18 @@ public class TightDecoder extends RawDecoder implements ImageObserver { statNumRectsTightJPEG = v; } + // + // Tight processing statistic methods + // + + public int getNumTightRects() { + return statNumRectsTight; + } + + public void setNumTightRects(int v) { + statNumRectsTight = v; + } + // // Handle a Tight-encoded rectangle. // @@ -166,6 +178,8 @@ public class TightDecoder extends RawDecoder implements ImageObserver { jpegRect = null; return; + } else { + statNumRectsTight++; } // Read filter id and parameters. @@ -476,4 +490,6 @@ public class TightDecoder extends RawDecoder implements ImageObserver { private Repaintable repainatableControl = null; // Jpeg decoding statistics private int statNumRectsTightJPEG = 0; + // Tight decoding statistics + private int statNumRectsTight = 0; } diff --git a/java/src/com/tightvnc/vncviewer/VncCanvas.java b/java/src/com/tightvnc/vncviewer/VncCanvas.java index 4cd2e935..32d709a1 100644 --- a/java/src/com/tightvnc/vncviewer/VncCanvas.java +++ b/java/src/com/tightvnc/vncviewer/VncCanvas.java @@ -523,7 +523,9 @@ class VncCanvas extends Canvas case RfbProto.EncodingTight: if (tightDecoder != null) { statNumRectsTightJPEG = tightDecoder.getNumJPEGRects(); + //statNumRectsTight = tightDecoder.getNumTightRects(); } + statNumRectsTight++; handleTightRect(rx, ry, rw, rh); break; default: @@ -858,8 +860,10 @@ class VncCanvas extends Canvas statNumRectsCopy = 0; statNumBytesEncoded = 0; statNumBytesDecoded = 0; - if (tightDecoder != null) + if (tightDecoder != null) { tightDecoder.setNumJPEGRects(0); + tightDecoder.setNumTightRects(0); + } } ////////////////////////////////////////////////////////////////// -- 2.39.5