From 174201a37022b64e0d0bc93cc7571b3db7688a01 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Mon, 31 Aug 2009 17:32:02 +0200 Subject: [PATCH] Use XCB_REQUEST_RAW flag for performance Bugzilla #6686 Signed-off-by: Julien Danjou --- src/c_client.py | 26 +++++++++++++++++++++++--- 1 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/c_client.py b/src/c_client.py index d86d05e..e6a8c87 100755 --- a/src/c_client.py +++ b/src/c_client.py @@ -17,6 +17,20 @@ _cplusplus_annoyances = {'class' : '_class', 'new' : '_new', 'delete': '_delete'} +_func_raw_list = [ 'xcb_grab_server', + 'xcb_ungrab_server', + 'xcb_get_input_focus', + 'xcb_query_keymap', + 'xcb_get_font_path', + 'xcb_list_extensions', + 'xcb_get_keyboard_control', + 'xcb_get_pointer_control', + 'xcb_get_screen_saver', + 'xcb_list_hosts', + 'xcb_get_pointer_mapping', + 'xcb_get_modifier_mapping', + 'xcb_no_operation' ] + _hlines = [] _hlevel = 0 _clines = [] @@ -716,9 +730,6 @@ def _c_request_helper(self, name, cookie_type, void, regular): # What kind of cookie we return func_cookie = 'xcb_void_cookie_t' if void else self.c_cookie_type - # What flag is passed to xcb_request - func_flags = '0' if (void and regular) or (not void and not regular) else 'XCB_REQUEST_CHECKED' - # Global extension id variable or NULL for xproto func_ext_global = '&' + _ns.c_ext_global_name if _ns.is_ext else '0' @@ -729,6 +740,15 @@ def _c_request_helper(self, name, cookie_type, void, regular): if unchecked: func_name = self.c_unchecked_name + func_flags = '0' + + # What flag is passed to xcb_request + if func_name in _func_raw_list: + func_flags += ' | XCB_REQUEST_RAW' + + if (void and not regular) or (not void and regular): + func_flags += ' | XCB_REQUEST_CHECKED' + param_fields = [] wire_fields = [] maxtypelen = len('xcb_connection_t') -- 1.6.3.3