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
diff --git a/unix/x0vncserver/PollingManager.cxx b/unix/x0vncserver/PollingManager.cxx
index da0f21b..ad6ac42 100644
--- a/unix/x0vncserver/PollingManager.cxx
+++ b/unix/x0vncserver/PollingManager.cxx
@@ -297,13 +297,7 @@
   // 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 @@
   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()
 {