Maintaining additional one-pixel-width image for using in upcoming polling improvements.


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2385 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/unix/x0vncserver/PollingManager.cxx b/unix/x0vncserver/PollingManager.cxx
index ad6ac42..4d7221a 100644
--- a/unix/x0vncserver/PollingManager.cxx
+++ b/unix/x0vncserver/PollingManager.cxx
@@ -76,9 +76,14 @@
   // underlying class names are different from the class name of the
   // primary image.
   m_rowImage = factory->newImage(m_dpy, m_width, 1);
-  if (strcmp(m_image->className(), m_rowImage->className()) != 0) {
-    vlog.error("Image types do not match (%s)",
-               m_rowImage->className());
+  m_columnImage = factory->newImage(m_dpy, 1, m_height);
+  const char *primaryImgClass = m_image->className();
+  const char *rowImgClass = m_rowImage->className();
+  const char *columnImgClass = m_columnImage->className();
+  if (strcmp(rowImgClass, primaryImgClass) != 0 ||
+      strcmp(columnImgClass, primaryImgClass) != 0) {
+    vlog.error("Image types do not match (%s, %s, %s)",
+               primaryImgClass, rowImgClass, columnImgClass);
   }
 
   int numTiles = m_widthTiles * m_heightTiles;
@@ -94,6 +99,7 @@
   delete[] m_rateMatrix;
 
   delete m_rowImage;
+  delete m_columnImage;
 }
 
 //
diff --git a/unix/x0vncserver/PollingManager.h b/unix/x0vncserver/PollingManager.h
index fd2c2e0..70c3d4c 100644
--- a/unix/x0vncserver/PollingManager.h
+++ b/unix/x0vncserver/PollingManager.h
@@ -93,8 +93,8 @@
   }
 
   inline void getColumn(int x, int y, int h) {
-    m_rowImage->get(DefaultRootWindow(m_dpy),
-                    m_offsetLeft + x, m_offsetTop + y, 1, h);
+    m_columnImage->get(DefaultRootWindow(m_dpy),
+                       m_offsetLeft + x, m_offsetTop + y, 1, h);
   }
 
   int checkRow(int x, int y, int w, bool *pChangeFlags);
@@ -110,7 +110,8 @@
   void findMaxLocalRect(Rect *r, int *mx_h, int *mx_v);
 
   // Additional images used in polling algorithms.
-  Image *m_rowImage;            // One row of the framebuffer
+  Image *m_rowImage;            // one row of the framebuffer
+  Image *m_columnImage;         // one column of the framebuffer
 
   char *m_rateMatrix;
   char *m_videoFlags;