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)];
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) {