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>
This commit is contained in:
parent
cdc2161b6f
commit
9b2e4cd5a8
@ -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());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user