From 41de2425360458b04de453dbc4641c237fca3f18 Mon Sep 17 00:00:00 2001 From: Constantin Kaplinsky Date: Sat, 19 Jan 2008 09:03:47 +0000 Subject: [PATCH] Minor refactoring: removed getFullRow() function, added its code to getRow(). git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2414 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- unix/x0vncserver/PollingManager.cxx | 10 ++-------- unix/x0vncserver/PollingManager.h | 14 ++++++++------ 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/unix/x0vncserver/PollingManager.cxx b/unix/x0vncserver/PollingManager.cxx index b3934a25..dfddbee9 100644 --- a/unix/x0vncserver/PollingManager.cxx +++ b/unix/x0vncserver/PollingManager.cxx @@ -257,14 +257,8 @@ int PollingManager::checkRow(int x, int y, int w) w += correction; } - // Read a row from the screen. Note that getFullRow() may be more - // efficient than getRow() which is more general. - // FIXME: Move the logic to getRow()? - if (x == 0 && w == m_width) { - getFullRow(y); - } else { - getRow(x, y, w); - } + // Read a row from the screen into m_rowImage. + getRow(x, y, w); // Compute a pointer to the initial element of m_changeFlags. bool *pChangeFlags = &m_changeFlags[getTileIndex(x, y)]; diff --git a/unix/x0vncserver/PollingManager.h b/unix/x0vncserver/PollingManager.h index e54494e6..09cd5c3a 100644 --- a/unix/x0vncserver/PollingManager.h +++ b/unix/x0vncserver/PollingManager.h @@ -83,13 +83,15 @@ private: r.width(), r.height(), r.tl.x, r.tl.y); } - inline void getFullRow(int y) { - m_rowImage->get(DefaultRootWindow(m_dpy), m_offsetLeft, m_offsetTop + y); - } - inline void getRow(int x, int y, int w) { - m_rowImage->get(DefaultRootWindow(m_dpy), - m_offsetLeft + x, m_offsetTop + y, w, 1); + if (w == m_width) { + // Getting full row may be more efficient. + m_rowImage->get(DefaultRootWindow(m_dpy), + m_offsetLeft, m_offsetTop + y); + } else { + m_rowImage->get(DefaultRootWindow(m_dpy), + m_offsetLeft + x, m_offsetTop + y, w, 1); + } } inline void getColumn(int x, int y, int h) { -- 2.39.5