summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUli Schlachter <psychon@znc.in>2013-12-30 12:42:56 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-06 12:56:37 +0100
commitae56140b50bccde9e6cfdc6757f345c989ccd755 (patch)
treeb4be64ef1e301c3bc4d3503d690a4a4d363d5cc1
parenta34f37cc712a69f74477c16cb8c83730ea599608 (diff)
xcb: Remove useless flushes
Calling xcb_flush() right before QXcbConnection::sync() is pointless. The flush sends all requests that were already queued to the server and the call to sync() then just sends another request, flushes it and waits for its reply. Having just sync() implicitly flush for us means less overhead and has the same effect. Another useless flush is in QXcbShmImage::put(). The only caller is QXcbBackingStore::flush() and this calls put() in a loop. If we just call xcb_flush() from flush(), then xcb can send more requests in a single write() call again. Finally, calling Q_XCB_NOOP() twice in a row without doing any interaction with xcb in between doesn't help much, so remove one of the two calls from QXcbShmImage::put() Change-Id: Ia3d6945b8d961e2844fc3e31fdf8189c47b534d1 Signed-off-by: Uli Schlachter <psychon@znc.in> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
-rw-r--r--src/plugins/platforms/xcb/qxcbbackingstore.cpp6
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp3
2 files changed, 2 insertions, 7 deletions
diff --git a/src/plugins/platforms/xcb/qxcbbackingstore.cpp b/src/plugins/platforms/xcb/qxcbbackingstore.cpp
index e93b36cb99..366e043e98 100644
--- a/src/plugins/platforms/xcb/qxcbbackingstore.cpp
+++ b/src/plugins/platforms/xcb/qxcbbackingstore.cpp
@@ -232,9 +232,6 @@ void QXcbShmImage::put(xcb_window_t window, const QPoint &target, const QRect &s
Q_XCB_NOOP(connection());
m_dirty = m_dirty | source;
-
- xcb_flush(xcb_connection());
- Q_XCB_NOOP(connection());
}
void QXcbShmImage::preparePaint(const QRegion &region)
@@ -314,10 +311,11 @@ void QXcbBackingStore::flush(QWindow *window, const QRegion &region, const QPoin
Q_XCB_NOOP(connection());
if (m_syncingResize) {
- xcb_flush(xcb_connection());
connection()->sync();
m_syncingResize = false;
platformWindow->updateSyncRequestCounter();
+ } else {
+ xcb_flush(xcb_connection());
}
}
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index 806f948cc2..81134ced49 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -668,8 +668,6 @@ void QXcbWindow::show()
m_screen->windowShown(this);
- xcb_flush(xcb_connection());
-
connection()->sync();
}
@@ -1889,7 +1887,6 @@ void QXcbWindow::updateSyncRequestCounter()
{
if (m_usingSyncProtocol && (m_syncValue.lo != 0 || m_syncValue.hi != 0)) {
Q_XCB_CALL(xcb_sync_set_counter(xcb_connection(), m_syncCounter, m_syncValue));
- xcb_flush(xcb_connection());
connection()->sync();
m_syncValue.lo = 0;