diff options
author | Constantin Kaplinsky <const@tightvnc.com> | 2007-12-28 08:44:59 +0000 |
---|---|---|
committer | Constantin Kaplinsky <const@tightvnc.com> | 2007-12-28 08:44:59 +0000 |
commit | bd390358b9cc66de0da15816dd80be1c8d6ed801 (patch) | |
tree | 42df7fd7221bf3bf10521f0033a49e8c845bccbe /unix/x0vncserver | |
parent | 936c36902aea31e661c750256e452f24a10d6369 (diff) | |
download | tigervnc-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')
-rw-r--r-- | unix/x0vncserver/PollingManager.cxx | 18 | ||||
-rw-r--r-- | unix/x0vncserver/PollingManager.h | 12 |
2 files changed, 17 insertions, 13 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() { diff --git a/unix/x0vncserver/PollingManager.h b/unix/x0vncserver/PollingManager.h index e3a29b0b..fd2c2e05 100644 --- a/unix/x0vncserver/PollingManager.h +++ b/unix/x0vncserver/PollingManager.h @@ -97,14 +97,14 @@ private: m_offsetLeft + x, m_offsetTop + y, 1, h); } - int checkRow(int x, int y, int w, bool *pmxChanged); - void sendChanges(bool *pmxChanged); - bool handleVideo(bool *pmxChanged); - void detectVideo(); + int checkRow(int x, int y, int w, bool *pChangeFlags); + void sendChanges(bool *pChangeFlags); + bool handleVideo(bool *pChangeFlags); + void flagVideoArea(bool *pChangeFlags, bool value); + // Video detection functions. + void detectVideo(); void getVideoAreaRect(Rect *result); - - // Functions called by getVideoAreaRect(). void constructLengthMatrices(int **pmx_h, int **pmx_v); void destroyLengthMatrices(int *mx_h, int *mx_v); void findMaxLocalRect(Rect *r, int *mx_h, int *mx_v); |