Code refactoring - PollingManager's constructor is given an XPixelBuffer*
instead of an Image*.


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2567 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/unix/x0vncserver/PollingManager.cxx b/unix/x0vncserver/PollingManager.cxx
index bcc9547..71b5d66 100644
--- a/unix/x0vncserver/PollingManager.cxx
+++ b/unix/x0vncserver/PollingManager.cxx
@@ -43,27 +43,25 @@
 //
 // Constructor.
 //
-// Note that dpy and image should remain valid during the object
+// Note that dpy and buffer should remain valid during the object
 // lifetime, while factory is used only in the constructor itself.
 //
-// FIXME: Pass XPixelBuffer* instead of Image*.
-//
 
-PollingManager::PollingManager(Display *dpy, Image *image,
+PollingManager::PollingManager(Display *dpy, XPixelBuffer *buffer,
                                ImageFactory *factory,
                                int offsetLeft, int offsetTop)
   : m_dpy(dpy),
     m_server(0),
-    m_image(image),
-    m_bytesPerPixel(image->xim->bits_per_pixel / 8),
+    m_image(buffer->getImage()),
+    m_bytesPerPixel(buffer->getPF().bpp / 8),
     m_offsetLeft(offsetLeft),
     m_offsetTop(offsetTop),
-    m_width(image->xim->width),
-    m_height(image->xim->height),
-    m_widthTiles((image->xim->width + 31) / 32),
-    m_heightTiles((image->xim->height + 31) / 32),
-    m_numTiles(((image->xim->width + 31) / 32) *
-               ((image->xim->height + 31) / 32)),
+    m_width(buffer->width()),
+    m_height(buffer->height()),
+    m_widthTiles((buffer->width() + 31) / 32),
+    m_heightTiles((buffer->height() + 31) / 32),
+    m_numTiles(((buffer->width() + 31) / 32) *
+               ((buffer->height() + 31) / 32)),
     m_pollingStep(0)
 {
   // Get initial screen image.