diff options
author | marha <marha@users.sourceforge.net> | 2012-04-16 09:17:34 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-04-16 09:17:34 +0200 |
commit | d6d3999ccb2cb72d55820770260172eccbbb68d7 (patch) | |
tree | 568ce82dd1a8e2edbbe8cd4cb5ab5b14157f34f6 /xorg-server/glx/extension_string.c | |
parent | fffd436e9c2ec6f5aa501ee57d0e4ade7293ee60 (diff) | |
download | vcxsrv-d6d3999ccb2cb72d55820770260172eccbbb68d7.tar.gz vcxsrv-d6d3999ccb2cb72d55820770260172eccbbb68d7.tar.bz2 vcxsrv-d6d3999ccb2cb72d55820770260172eccbbb68d7.zip |
libX11 xserver pixman mesa git update 16 Apr 2012
Diffstat (limited to 'xorg-server/glx/extension_string.c')
-rw-r--r-- | xorg-server/glx/extension_string.c | 96 |
1 files changed, 45 insertions, 51 deletions
diff --git a/xorg-server/glx/extension_string.c b/xorg-server/glx/extension_string.c index 7721cb056..866f8bf45 100644 --- a/xorg-server/glx/extension_string.c +++ b/xorg-server/glx/extension_string.c @@ -45,10 +45,10 @@ #define EXT_ENABLED(bit,supported) (IS_SET(supported, bit)) struct extension_info { - const char * const name; - unsigned name_len; + const char *const name; + unsigned name_len; - unsigned char bit; + unsigned char bit; /** * This is the lowest version of GLX that "requires" this extension. @@ -56,37 +56,36 @@ struct extension_info { * SGI_make_current_read. If the extension is not required by any known * version of GLX, use 0, 0. */ - unsigned char version_major; - unsigned char version_minor; + unsigned char version_major; + unsigned char version_minor; /** * Is driver support forced by the ABI? */ - unsigned char driver_support; + unsigned char driver_support; }; static const struct extension_info known_glx_extensions[] = { /* GLX_ARB_get_proc_address is implemented on the client. */ - { GLX(ARB_multisample), VER(1,4), Y, }, - - { GLX(EXT_import_context), VER(0,0), Y, }, - { GLX(EXT_texture_from_pixmap), VER(0,0), Y, }, - { GLX(EXT_visual_info), VER(0,0), Y, }, - { GLX(EXT_visual_rating), VER(0,0), Y, }, - - { GLX(MESA_copy_sub_buffer), VER(0,0), N, }, - { GLX(OML_swap_method), VER(0,0), Y, }, - { GLX(SGI_make_current_read), VER(1,3), N, }, - { GLX(SGI_swap_control), VER(0,0), N, }, - { GLX(SGIS_multisample), VER(0,0), Y, }, - { GLX(SGIX_fbconfig), VER(1,3), Y, }, - { GLX(SGIX_pbuffer), VER(1,3), Y, }, - { GLX(SGIX_visual_select_group), VER(0,0), Y, }, - { GLX(INTEL_swap_event), VER(1,4), N, }, - { NULL } + {GLX(ARB_multisample), VER(1, 4), Y,}, + + {GLX(EXT_import_context), VER(0, 0), Y,}, + {GLX(EXT_texture_from_pixmap), VER(0, 0), Y,}, + {GLX(EXT_visual_info), VER(0, 0), Y,}, + {GLX(EXT_visual_rating), VER(0, 0), Y,}, + + {GLX(MESA_copy_sub_buffer), VER(0, 0), N,}, + {GLX(OML_swap_method), VER(0, 0), Y,}, + {GLX(SGI_make_current_read), VER(1, 3), N,}, + {GLX(SGI_swap_control), VER(0, 0), N,}, + {GLX(SGIS_multisample), VER(0, 0), Y,}, + {GLX(SGIX_fbconfig), VER(1, 3), Y,}, + {GLX(SGIX_pbuffer), VER(1, 3), Y,}, + {GLX(SGIX_visual_select_group), VER(0, 0), Y,}, + {GLX(INTEL_swap_event), VER(1, 4), N,}, + {NULL} }; - /** * Create a GLX extension string for a set of enable bits. * @@ -111,56 +110,51 @@ __glXGetExtensionString(const unsigned char *enable_bits, char *buffer) unsigned i; int length = 0; - for (i = 0; known_glx_extensions[i].name != NULL; i++) { - const unsigned bit = known_glx_extensions[i].bit; - const size_t len = known_glx_extensions[i].name_len; - - if (EXT_ENABLED(bit, enable_bits)) { - if (buffer != NULL) { - (void) memcpy(& buffer[length], known_glx_extensions[i].name, - len); - - buffer[length + len + 0] = ' '; - buffer[length + len + 1] = '\0'; - } - - length += len + 1; - } + const unsigned bit = known_glx_extensions[i].bit; + const size_t len = known_glx_extensions[i].name_len; + + if (EXT_ENABLED(bit, enable_bits)) { + if (buffer != NULL) { + (void) memcpy(&buffer[length], known_glx_extensions[i].name, + len); + + buffer[length + len + 0] = ' '; + buffer[length + len + 1] = '\0'; + } + + length += len + 1; + } } return length + 1; } - void __glXEnableExtension(unsigned char *enable_bits, const char *ext) { const size_t ext_name_len = strlen(ext); unsigned i; - for (i = 0; known_glx_extensions[i].name != NULL; i++) { - if ((ext_name_len == known_glx_extensions[i].name_len) - && (memcmp(ext, known_glx_extensions[i].name, ext_name_len) == 0)) { - SET_BIT(enable_bits, known_glx_extensions[i].bit); - break; - } + if ((ext_name_len == known_glx_extensions[i].name_len) + && (memcmp(ext, known_glx_extensions[i].name, ext_name_len) == 0)) { + SET_BIT(enable_bits, known_glx_extensions[i].bit); + break; + } } } - void __glXInitExtensionEnableBits(unsigned char *enable_bits) { unsigned i; - (void) memset(enable_bits, 0, __GLX_EXT_BYTES); for (i = 0; known_glx_extensions[i].name != NULL; i++) { - if (known_glx_extensions[i].driver_support) { - SET_BIT(enable_bits, known_glx_extensions[i].bit); - } + if (known_glx_extensions[i].driver_support) { + SET_BIT(enable_bits, known_glx_extensions[i].bit); + } } } |