summaryrefslogtreecommitdiffstats
path: root/unix/x0vncserver/PollingManager.cxx
diff options
context:
space:
mode:
authorConstantin Kaplinsky <const@tightvnc.com>2007-12-28 08:44:59 +0000
committerConstantin Kaplinsky <const@tightvnc.com>2007-12-28 08:44:59 +0000
commitbd390358b9cc66de0da15816dd80be1c8d6ed801 (patch)
tree42df7fd7221bf3bf10521f0033a49e8c845bccbe /unix/x0vncserver/PollingManager.cxx
parent936c36902aea31e661c750256e452f24a10d6369 (diff)
downloadtigervnc-bd390358b9cc66de0da15816dd80be1c8d6ed801.tar.gz
tigervnc-bd390358b9cc66de0da15816dd80be1c8d6ed801.zip
Minor code refactoring -- new flagVideoArea() function, minor naming and formatting changes.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2384 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'unix/x0vncserver/PollingManager.cxx')
-rw-r--r--unix/x0vncserver/PollingManager.cxx18
1 files changed, 11 insertions, 7 deletions
diff --git a/unix/x0vncserver/PollingManager.cxx b/unix/x0vncserver/PollingManager.cxx
index da0f21bc..ad6ac424 100644
--- a/unix/x0vncserver/PollingManager.cxx
+++ b/unix/x0vncserver/PollingManager.cxx
@@ -297,13 +297,7 @@ bool PollingManager::handleVideo(bool *pChangeFlags)
// Grab the pixels of video area. Also, exclude video rectangle from
// pChangeFlags[], to prevent grabbing the same pixels twice.
if (!m_videoRect.is_empty()) {
- Rect r(m_videoRect.tl.x / 32, m_videoRect.tl.y / 32,
- m_videoRect.br.x / 32, m_videoRect.br.y / 32);
- for (int y = r.tl.y; y < r.br.y; y++) {
- for (int x = r.tl.x; x < r.br.x; x++) {
- pChangeFlags[y * m_widthTiles + x] = false;
- }
- }
+ flagVideoArea(pChangeFlags, false);
getScreenRect(m_videoRect);
return true; // we've got a video rectangle
}
@@ -311,6 +305,16 @@ bool PollingManager::handleVideo(bool *pChangeFlags)
return false; // video rectangle is empty
}
+void PollingManager::flagVideoArea(bool *pChangeFlags, bool value)
+{
+ Rect r(m_videoRect.tl.x / 32, m_videoRect.tl.y / 32,
+ m_videoRect.br.x / 32, m_videoRect.br.y / 32);
+
+ for (int y = r.tl.y; y < r.br.y; y++)
+ for (int x = r.tl.x; x < r.br.x; x++)
+ pChangeFlags[y * m_widthTiles + x] = value;
+}
+
void
PollingManager::detectVideo()
{