Uncommented getNumRects.


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@165 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/rfb/TightEncoder.cxx b/rfb/TightEncoder.cxx
index fe23a97..fb19885 100644
--- a/rfb/TightEncoder.cxx
+++ b/rfb/TightEncoder.cxx
@@ -112,27 +112,27 @@
   }
 }
 
-//int TightEncoder::getNumRects(const Rect &r)
-//{
-//  const unsigned int w = r.width();
-//  const unsigned int h = r.height();
-//
-//  // Will this rectangle split into subrects?
-//  bool rectTooBig = w > pconf->maxRectWidth || w * h > pconf->maxRectSize;
-//  if (!rectTooBig)
-//    return 1;
-//
-//  // Compute max sub-rectangle size.
-//  const unsigned int subrectMaxWidth =
-//    (w > pconf->maxRectWidth) ? pconf->maxRectWidth : w;
-//  const unsigned int subrectMaxHeight =
-//    pconf->maxRectSize / subrectMaxWidth;
-//
-//  // Return the number of subrects.
-//  return (((w - 1) / pconf->maxRectWidth + 1) *
-//          ((h - 1) / subrectMaxHeight + 1));
-//}
-//
+int TightEncoder::getNumRects(const Rect &r)
+{
+  const unsigned int w = r.width();
+  const unsigned int h = r.height();
+
+  // Will this rectangle split into subrects?
+  bool rectTooBig = w > pconf->maxRectWidth || w * h > pconf->maxRectSize;
+  if (!rectTooBig)
+    return 1;
+
+  // Compute max sub-rectangle size.
+  const unsigned int subrectMaxWidth =
+    (w > pconf->maxRectWidth) ? pconf->maxRectWidth : w;
+  const unsigned int subrectMaxHeight =
+    pconf->maxRectSize / subrectMaxWidth;
+
+  // Return the number of subrects.
+  return (((w - 1) / pconf->maxRectWidth + 1) *
+          ((h - 1) / subrectMaxHeight + 1));
+}
+
 bool TightEncoder::writeRect(const Rect& r, ImageGetter* ig, Rect* actual)
 {
   // Shortcuts to rectangle coordinates and dimensions.
diff --git a/rfb/TightEncoder.h b/rfb/TightEncoder.h
index 181db72..b6e71a1 100644
--- a/rfb/TightEncoder.h
+++ b/rfb/TightEncoder.h
@@ -55,7 +55,7 @@
     static Encoder* create(SMsgWriter* writer);
     virtual void setCompressLevel(int level);
     virtual void setQualityLevel(int level);
-      //    virtual int getNumRects(const Rect &r);
+    virtual int getNumRects(const Rect &r);
     virtual bool writeRect(const Rect& r, ImageGetter* ig, Rect* actual);
     virtual ~TightEncoder();