diff options
author | Samuel Rødal <samuel.rodal@digia.com> | 2012-10-02 09:30:18 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-10-19 20:24:03 +0200 |
commit | 9b2e4cd5a8cac007aa702ce5f822e78e54707a07 (patch) | |
tree | 5ccaeb63f74fa166de1dc23fb27350b982a8b96e /src/plugins/platforms | |
parent | cdc2161b6f87deaac6a256885fd6ecdccad6eb82 (diff) |
Small xcb startup performance optimization.
Prefetch all the extensions, to avoid having to do blocking calls later.
Change-Id: I1527dbf03d76372ec88bc0d5d9f7af18a4cc2a26
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbconnection.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp index bb5f301fea..3261bd189d 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection.cpp @@ -60,6 +60,8 @@ #include <stdio.h> #include <errno.h> +#include <xcb/shm.h> +#include <xcb/sync.h> #include <xcb/xfixes.h> #ifdef XCB_USE_XLIB @@ -308,7 +310,19 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, const char connect(dispatcher, SIGNAL(awake()), this, SLOT(processXcbEvents())); #endif - xcb_prefetch_extension_data (m_connection, &xcb_xfixes_id); + xcb_extension_t *extensions[] = { + &xcb_shm_id, &xcb_xfixes_id, &xcb_randr_id, &xcb_shape_id, &xcb_sync_id, +#ifdef XCB_USE_RENDER + &xcb_render_id, +#endif +#ifdef XCB_HAS_XCB_GLX + &xcb_glx_id, +#endif + 0 + }; + + for (xcb_extension_t **ext_it = extensions; *ext_it; ++ext_it) + xcb_prefetch_extension_data (m_connection, *ext_it); m_setup = xcb_get_setup(xcb_connection()); |