From ed3cf5d029e4554707cb63f87bb0836351e28d37 Mon Sep 17 00:00:00 2001 From: Constantin Kaplinsky Date: Fri, 28 Dec 2007 17:59:10 +0000 Subject: [PATCH] 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 --- unix/x0vncserver/PollingManager.cxx | 12 +++++++++--- unix/x0vncserver/PollingManager.h | 7 ++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/unix/x0vncserver/PollingManager.cxx b/unix/x0vncserver/PollingManager.cxx index ad6ac424..4d7221ad 100644 --- a/unix/x0vncserver/PollingManager.cxx +++ b/unix/x0vncserver/PollingManager.cxx @@ -76,9 +76,14 @@ PollingManager::PollingManager(Display *dpy, Image *image, // 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 @@ PollingManager::~PollingManager() delete[] m_rateMatrix; delete m_rowImage; + delete m_columnImage; } // diff --git a/unix/x0vncserver/PollingManager.h b/unix/x0vncserver/PollingManager.h index fd2c2e05..70c3d4c7 100644 --- a/unix/x0vncserver/PollingManager.h +++ b/unix/x0vncserver/PollingManager.h @@ -93,8 +93,8 @@ private: } 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 @@ private: 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; -- 2.39.5