summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2019-06-24 16:01:54 +0200
committerPierre Ossman <ossman@cendio.se>2019-06-24 16:01:54 +0200
commit1d696c6bfa2ccfd6a3655602593dd3dff968aebe (patch)
tree0a0a297856f467f6f054fad02170f6a95afe3f44
parent01dd7af4d25da5e3d2778ebcca32d0b98e1f05b3 (diff)
downloadtigervnc-1d696c6bfa2ccfd6a3655602593dd3dff968aebe.tar.gz
tigervnc-1d696c6bfa2ccfd6a3655602593dd3dff968aebe.zip
Remove max area parameter from Region::get_rects()
It was unused and added complexity and bugs to the code. So let's remove it rather than trying to clean up a function no one needed.
-rw-r--r--common/rfb/Region.cxx15
-rw-r--r--common/rfb/Region.h2
2 files changed, 5 insertions, 12 deletions
diff --git a/common/rfb/Region.cxx b/common/rfb/Region.cxx
index beca482d..e3d06428 100644
--- a/common/rfb/Region.cxx
+++ b/common/rfb/Region.cxx
@@ -185,7 +185,7 @@ int rfb::Region::numRects() const {
}
bool rfb::Region::get_rects(std::vector<Rect>* rects,
- bool left2right, bool topdown, int maxArea) const
+ bool left2right, bool topdown) const
{
int nRects = xrgn->numRects;
int xInc = left2right ? 1 : -1;
@@ -209,16 +209,9 @@ bool rfb::Region::get_rects(std::vector<Rect>* rects,
i = firstInNextBand - yInc;
while (nRectsInBand > 0) {
- int y = xrgn->rects[i].y1;
- int h = maxArea / (xrgn->rects[i].x2 - xrgn->rects[i].x1);
- if (!h) h = xrgn->rects[i].y2 - y;
- do {
- if (h > xrgn->rects[i].y2 - y)
- h = xrgn->rects[i].y2 - y;
- Rect r(xrgn->rects[i].x1, y, xrgn->rects[i].x2, y+h);
- rects->push_back(r);
- y += h;
- } while (y < xrgn->rects[i].y2);
+ Rect r(xrgn->rects[i].x1, xrgn->rects[i].y1,
+ xrgn->rects[i].x2, xrgn->rects[i].y2);
+ rects->push_back(r);
i += xInc;
nRectsInBand--;
}
diff --git a/common/rfb/Region.h b/common/rfb/Region.h
index 9e53d362..7cc0eaa8 100644
--- a/common/rfb/Region.h
+++ b/common/rfb/Region.h
@@ -68,7 +68,7 @@ namespace rfb {
bool is_empty() const { return numRects() == 0; }
bool get_rects(std::vector<Rect>* rects, bool left2right=true,
- bool topdown=true, int maxArea=0) const;
+ bool topdown=true) const;
Rect get_bounding_rect() const;
void debug_print(const char *prefix) const;