diff options
author | Gatis Paeglis <gatis.paeglis@qt.io> | 2018-12-27 01:10:29 +0100 |
---|---|---|
committer | Gatis Paeglis <gatis.paeglis@qt.io> | 2019-01-03 10:09:34 +0000 |
commit | 6899117a59256082f37492d81ecaf56a0844690e (patch) | |
tree | 8f286d43fdb671952bf61a84cbe9bdb74b99d731 | |
parent | ceddc14af17df166d05d98cfa76256bfc0b34183 (diff) |
configure: properly atomize render vs. renderutil
xcb-render is a C interface for X11 extension. xcb-render-util is a
utility library that complements xcb-render by providing convenience
functions and interfaces which make the raw X protocol more usable.
Bumped xcb-render-util version to avoid having include hacks. We were
bundling 8 years old release 0.3.8 (Apr, 2011). 0.3.9 is the latest
release and it was relesed 4,5 years ago (Jun, 2014). All CI machines
have 0.3.9. The only thing that have changed in xcb-render-util sources
since 2011 is that we don't need to have various hacks to include
xcb_renderutil.h in C++ files. Upgrading bundled XCB libs was also
requested in QTBUG-71109.
Task-number: QTBUG-71109
Change-Id: Ib261f7584ad81be95660123b007e2200a3042f4c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
-rw-r--r-- | src/3rdparty/xcb/README | 2 | ||||
-rw-r--r-- | src/3rdparty/xcb/include/xcb/xcb_renderutil.h | 10 | ||||
-rw-r--r-- | src/3rdparty/xcb/xcb-util-renderutil/util.c | 30 | ||||
-rw-r--r-- | src/gui/configure.json | 35 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbbackingstore.cpp | 6 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbimage.cpp | 6 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/xcb_qpa_lib.pro | 2 |
7 files changed, 46 insertions, 45 deletions
diff --git a/src/3rdparty/xcb/README b/src/3rdparty/xcb/README index 9e8ea30b51..2f1ee24079 100644 --- a/src/3rdparty/xcb/README +++ b/src/3rdparty/xcb/README @@ -8,7 +8,7 @@ Contains the header and sources files from selected xcb libraries: Pointer Barriers API and SendExtensionEvent API) libxcb-util-image-0.3.9 libxcb-util-keysyms-0.3.9 - libxcb-util-renderutil-0.3.8 + libxcb-util-renderutil-0.3.9 libxcb-util-wm-0.3.9 The 'include' directory was obtained by compiling and installing all of the modules. diff --git a/src/3rdparty/xcb/include/xcb/xcb_renderutil.h b/src/3rdparty/xcb/include/xcb/xcb_renderutil.h index 6eb5923236..77c5b7f054 100644 --- a/src/3rdparty/xcb/include/xcb/xcb_renderutil.h +++ b/src/3rdparty/xcb/include/xcb/xcb_renderutil.h @@ -27,6 +27,10 @@ #define XCB_RENDERUTIL #include <xcb/render.h> +#ifdef __cplusplus +extern "C" { +#endif + typedef enum xcb_pict_format_t { XCB_PICT_FORMAT_ID = (1 << 0), XCB_PICT_FORMAT_TYPE = (1 << 1), @@ -58,7 +62,7 @@ xcb_render_util_find_visual_format (const xcb_render_query_pict_formats_reply_t xcb_render_pictforminfo_t * xcb_render_util_find_format (const xcb_render_query_pict_formats_reply_t *formats, unsigned long mask, - const xcb_render_pictforminfo_t *template, + const xcb_render_pictforminfo_t *ptemplate, int count); xcb_render_pictforminfo_t * @@ -139,4 +143,8 @@ void xcb_render_util_composite_text_free ( xcb_render_util_composite_text_stream_t *stream ); +#ifdef __cplusplus +} +#endif + #endif /* XCB_RENDERUTIL */ diff --git a/src/3rdparty/xcb/xcb-util-renderutil/util.c b/src/3rdparty/xcb/xcb-util-renderutil/util.c index 2d8840d204..7666c433dd 100644 --- a/src/3rdparty/xcb/xcb-util-renderutil/util.c +++ b/src/3rdparty/xcb/xcb-util-renderutil/util.c @@ -19,6 +19,10 @@ * PERFORMANCE OF THIS SOFTWARE. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "xcb_renderutil.h" xcb_render_pictvisual_t * @@ -41,7 +45,7 @@ xcb_render_util_find_visual_format (const xcb_render_query_pict_formats_reply_t xcb_render_pictforminfo_t * xcb_render_util_find_format (const xcb_render_query_pict_formats_reply_t *formats, unsigned long mask, - const xcb_render_pictforminfo_t *template, + const xcb_render_pictforminfo_t *ptemplate, int count) { xcb_render_pictforminfo_iterator_t i; @@ -50,40 +54,40 @@ xcb_render_util_find_format (const xcb_render_query_pict_formats_reply_t *format for (i = xcb_render_query_pict_formats_formats_iterator(formats); i.rem; xcb_render_pictforminfo_next(&i)) { if (mask & XCB_PICT_FORMAT_ID) - if (template->id != i.data->id) + if (ptemplate->id != i.data->id) continue; if (mask & XCB_PICT_FORMAT_TYPE) - if (template->type != i.data->type) + if (ptemplate->type != i.data->type) continue; if (mask & XCB_PICT_FORMAT_DEPTH) - if (template->depth != i.data->depth) + if (ptemplate->depth != i.data->depth) continue; if (mask & XCB_PICT_FORMAT_RED) - if (template->direct.red_shift != i.data->direct.red_shift) + if (ptemplate->direct.red_shift != i.data->direct.red_shift) continue; if (mask & XCB_PICT_FORMAT_RED_MASK) - if (template->direct.red_mask != i.data->direct.red_mask) + if (ptemplate->direct.red_mask != i.data->direct.red_mask) continue; if (mask & XCB_PICT_FORMAT_GREEN) - if (template->direct.green_shift != i.data->direct.green_shift) + if (ptemplate->direct.green_shift != i.data->direct.green_shift) continue; if (mask & XCB_PICT_FORMAT_GREEN_MASK) - if (template->direct.green_mask != i.data->direct.green_mask) + if (ptemplate->direct.green_mask != i.data->direct.green_mask) continue; if (mask & XCB_PICT_FORMAT_BLUE) - if (template->direct.blue_shift != i.data->direct.blue_shift) + if (ptemplate->direct.blue_shift != i.data->direct.blue_shift) continue; if (mask & XCB_PICT_FORMAT_BLUE_MASK) - if (template->direct.blue_mask != i.data->direct.blue_mask) + if (ptemplate->direct.blue_mask != i.data->direct.blue_mask) continue; if (mask & XCB_PICT_FORMAT_ALPHA) - if (template->direct.alpha_shift != i.data->direct.alpha_shift) + if (ptemplate->direct.alpha_shift != i.data->direct.alpha_shift) continue; if (mask & XCB_PICT_FORMAT_ALPHA_MASK) - if (template->direct.alpha_mask != i.data->direct.alpha_mask) + if (ptemplate->direct.alpha_mask != i.data->direct.alpha_mask) continue; if (mask & XCB_PICT_FORMAT_COLORMAP) - if (template->colormap != i.data->colormap) + if (ptemplate->colormap != i.data->colormap) continue; if (count-- == 0) return i.data; diff --git a/src/gui/configure.json b/src/gui/configure.json index caa6f065f0..7b861c80fe 100644 --- a/src/gui/configure.json +++ b/src/gui/configure.json @@ -615,6 +615,20 @@ ], "use": "xcb" }, + "xcb_renderutil": { + "label": "XCB Renderutil >= 0.3.9", + "test": { + "main": [ + "xcb_render_util_find_standard_format(nullptr, XCB_PICT_STANDARD_ARGB_32);" + ] + }, + "headers": "xcb/xcb_renderutil.h", + "sources": [ + { "type": "pkgConfig", "args": "xcb-renderutil >= 0.3.9" }, + "-lxcb-render-util" + ], + "use": "xcb xcb_render" + }, "xcb_randr": { "label": "XCB RandR", "headers": "xcb/randr.h", @@ -704,32 +718,20 @@ "xcb_render": { "label": "XCB XRender", "test": { - "tail": [ - "// 'template' is used as a function argument name in xcb_renderutil.h", - "#define template template_param", - "// extern \"C\" is missing, too", - "extern \"C\" {", - "#include <xcb/xcb_renderutil.h>", - "}", - "#undef template" - ], "main": [ - "int primaryScreen = 0;", "xcb_generic_error_t *error = 0;", "xcb_connection_t *connection = 0;", "xcb_render_query_pict_formats_cookie_t formatsCookie =", " xcb_render_query_pict_formats(connection);", "xcb_render_query_pict_formats_reply_t *formatsReply =", " xcb_render_query_pict_formats_reply(", - " connection, formatsCookie, &error);", - "xcb_render_util_find_standard_format(", - " formatsReply, XCB_PICT_STANDARD_ARGB_32);" + " connection, formatsCookie, &error);" ] }, "headers": "xcb/render.h", "sources": [ - { "type": "pkgConfig", "args": "xcb-renderutil xcb-render" }, - "-lxcb-render-util -lxcb-render" + { "type": "pkgConfig", "args": "xcb-render" }, + "-lxcb-render" ], "use": "xcb" }, @@ -737,7 +739,6 @@ "label": "XCB GLX", "test": { "main": [ - "int primaryScreen = 0;", "xcb_connection_t *connection = 0;", "xcb_generic_error_t *error = 0;", "xcb_glx_query_version_cookie_t xglx_query_cookie = xcb_glx_query_version(", @@ -1555,7 +1556,7 @@ "xcb-render": { "label": "XCB render", "emitIf": "features.xcb", - "condition": "!features.system-xcb || libs.xcb_render", + "condition": "!features.system-xcb || (libs.xcb_render && libs.xcb_renderutil)", "output": [ "privateFeature" ] }, "xkb": { diff --git a/src/plugins/platforms/xcb/qxcbbackingstore.cpp b/src/plugins/platforms/xcb/qxcbbackingstore.cpp index ba9a3e68ee..e446933dac 100644 --- a/src/plugins/platforms/xcb/qxcbbackingstore.cpp +++ b/src/plugins/platforms/xcb/qxcbbackingstore.cpp @@ -47,13 +47,7 @@ #include <xcb/xcb_image.h> #if QT_CONFIG(xcb_render) #include <xcb/render.h> -// 'template' is used as a function argument name in xcb_renderutil.h -#define template template_param -// extern "C" is missing too -extern "C" { #include <xcb/xcb_renderutil.h> -} -#undef template #endif #include <sys/ipc.h> diff --git a/src/plugins/platforms/xcb/qxcbimage.cpp b/src/plugins/platforms/xcb/qxcbimage.cpp index 44c7d22344..31c24f40b4 100644 --- a/src/plugins/platforms/xcb/qxcbimage.cpp +++ b/src/plugins/platforms/xcb/qxcbimage.cpp @@ -44,13 +44,7 @@ #include <QtGui/private/qdrawhelper_p.h> #if QT_CONFIG(xcb_render) #include <xcb/render.h> -// 'template' is used as a function argument name in xcb_renderutil.h -#define template template_param -// extern "C" is missing too -extern "C" { #include <xcb/xcb_renderutil.h> -} -#undef template #endif #include "qxcbconnection.h" diff --git a/src/plugins/platforms/xcb/xcb_qpa_lib.pro b/src/plugins/platforms/xcb/xcb_qpa_lib.pro index f4ca9cc81d..1369d3496e 100644 --- a/src/plugins/platforms/xcb/xcb_qpa_lib.pro +++ b/src/plugins/platforms/xcb/xcb_qpa_lib.pro @@ -97,7 +97,7 @@ qtConfig(vulkan) { !qtConfig(system-xcb) { QMAKE_USE += xcb-static } else { - qtConfig(xcb-render): QMAKE_USE += xcb_render + qtConfig(xcb-render): QMAKE_USE += xcb_render xcb_renderutil qtConfig(xcb-xinput): QMAKE_USE += xcb_xinput QMAKE_USE += xcb_icccm xcb_image xcb_keysyms xcb_randr xcb_shape xcb_shm xcb_sync xcb_xfixes xcb_xinerama } |