aboutsummaryrefslogtreecommitdiffstats
path: root/unix/x0vncserver/PollingManager.cxx
diff options
context:
space:
mode:
authorConstantin Kaplinsky <const@tightvnc.com>2008-01-09 10:25:34 +0000
committerConstantin Kaplinsky <const@tightvnc.com>2008-01-09 10:25:34 +0000
commit474b12f7b2476830c76bab455f06dcbc23748561 (patch)
tree0bdc864cbfbbd268396db270e90aeb779d828bcf /unix/x0vncserver/PollingManager.cxx
parent1a032112326b4a30c93c38ccde240c80fdcb4a7a (diff)
downloadtigervnc-474b12f7b2476830c76bab455f06dcbc23748561.tar.gz
tigervnc-474b12f7b2476830c76bab455f06dcbc23748561.zip
Checking neighbor pixels above and below changed tiles, as well as pixels at the left and at the right.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2396 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'unix/x0vncserver/PollingManager.cxx')
-rw-r--r--unix/x0vncserver/PollingManager.cxx50
1 files changed, 46 insertions, 4 deletions
diff --git a/unix/x0vncserver/PollingManager.cxx b/unix/x0vncserver/PollingManager.cxx
index 8c75b291..325bed1f 100644
--- a/unix/x0vncserver/PollingManager.cxx
+++ b/unix/x0vncserver/PollingManager.cxx
@@ -364,19 +364,61 @@ void PollingManager::flagVideoArea(bool *pChangeFlags, bool value)
void
PollingManager::checkNeighbors(bool *pChangeFlags)
{
- // Check neighboring pixels at the right of changed tiles.
- for (int x = 0; x < m_widthTiles - 1; x++) {
- for (int y = 0; y < m_heightTiles; y++) {
+ int x, y;
+
+ // Check neighboring pixels above and below changed tiles.
+ // FIXME: Fast skip to the first changed tile (and to the last, too).
+ // FIXME: Check the full-width line above the first changed tile?
+ for (y = 0; y < m_heightTiles; y++) {
+ bool doneAbove = false;
+ bool doneBelow = false;
+ for (x = 0; x < m_widthTiles; x++) {
+ if (!doneAbove && y > 0 &&
+ pChangeFlags[y * m_widthTiles + x] &&
+ !pChangeFlags[(y - 1) * m_widthTiles + x]) {
+ // FIXME: Check pChangeFlags[] to decrease height of the row.
+ checkRow(x * 32, y * 32 - 1, m_width - x * 32,
+ &pChangeFlags[(y - 1) * m_widthTiles + x]);
+ doneAbove = true;
+ }
+ if (!doneBelow && y < m_heightTiles - 1 &&
+ pChangeFlags[y * m_widthTiles + x] &&
+ !pChangeFlags[(y + 1) * m_widthTiles + x]) {
+ // FIXME: Check pChangeFlags[] to decrease height of the row.
+ checkRow(x * 32, (y + 1) * 32, m_width - x * 32,
+ &pChangeFlags[(y + 1) * m_widthTiles + x]);
+ doneBelow = true;
+ }
+ if (doneBelow && doneAbove)
+ break;
+ }
+ }
+
+ // Check neighboring pixels at the right side of changed tiles.
+ for (x = 0; x < m_widthTiles - 1; x++) {
+ for (y = 0; y < m_heightTiles; y++) {
if (pChangeFlags[y * m_widthTiles + x] &&
!pChangeFlags[y * m_widthTiles + x + 1]) {
// FIXME: Check pChangeFlags[] to decrease height of the column.
- // FIXME: Check _only_ the tiles neighboring to changed tiles?
checkColumn((x + 1) * 32, y * 32, m_height - y * 32,
&pChangeFlags[y * m_widthTiles + x + 1]);
break;
}
}
}
+
+ // Check neighboring pixels at the left side of changed tiles.
+ for (x = m_widthTiles - 1; x > 0; x--) {
+ for (y = 0; y < m_heightTiles; y++) {
+ if (pChangeFlags[y * m_widthTiles + x] &&
+ !pChangeFlags[y * m_widthTiles + x - 1]) {
+ // FIXME: Check pChangeFlags[] to decrease height of the column.
+ checkColumn(x * 32 - 1, y * 32, m_height - y * 32,
+ &pChangeFlags[y * m_widthTiles + x - 1]);
+ break;
+ }
+ }
+ }
}
void