From 46312b611b4aa04d32eab05668d84f09e6aa6670 Mon Sep 17 00:00:00 2001 From: Alexander Volkov Date: Wed, 22 Feb 2017 14:33:56 +0300 Subject: xcb: Use QT_CONFIG macro to check for xcb-sm, xcb-render, and xcb-glx And remove the corresponding defines. Note that XCB_USE_GLX and XCB_HAS_XCB_GLX were used as synonyms because QGLXBufferSwapComplete was wrapped in #if defined(XCB_USE_GLX) and at the same time it was used only when XCB_HAS_XCB_GLX was defined. Change-Id: I6c04b0ccfd5369b78b3e8af2ec39d38ae5c311dc Reviewed-by: Gatis Paeglis --- .../gl_integrations/xcb_glx/qxcbglxintegration.cpp | 65 +++++++++++----------- 1 file changed, 31 insertions(+), 34 deletions(-) (limited to 'src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.cpp') diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.cpp index a283d451f8..fea365cabc 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.cpp +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.cpp @@ -39,7 +39,7 @@ #include "qxcbglxintegration.h" -#if defined(XCB_HAS_XCB_GLX) +#if QT_CONFIG(xcb_glx) #include #endif @@ -56,37 +56,34 @@ QT_BEGIN_NAMESPACE -#if defined(XCB_HAS_XCB_GLX) && XCB_GLX_MAJOR_VERSION == 1 && XCB_GLX_MINOR_VERSION < 4 - -#define XCB_GLX_BUFFER_SWAP_COMPLETE 1 - -typedef struct xcb_glx_buffer_swap_complete_event_t { - uint8_t response_type; - uint8_t pad0; - uint16_t sequence; - uint16_t event_type; - uint8_t pad1[2]; - xcb_glx_drawable_t drawable; - uint32_t ust_hi; - uint32_t ust_lo; - uint32_t msc_hi; - uint32_t msc_lo; - uint32_t sbc; -} xcb_glx_buffer_swap_complete_event_t; -#endif - -#if defined(XCB_USE_GLX) -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Drawable drawable; /* drawable on which event was requested in event mask */ - int event_type; - int64_t ust; - int64_t msc; - int64_t sbc; -} QGLXBufferSwapComplete; +#if QT_CONFIG(xcb_glx) + #if XCB_GLX_MAJOR_VERSION == 1 && XCB_GLX_MINOR_VERSION < 4 + #define XCB_GLX_BUFFER_SWAP_COMPLETE 1 + typedef struct xcb_glx_buffer_swap_complete_event_t { + uint8_t response_type; + uint8_t pad0; + uint16_t sequence; + uint16_t event_type; + uint8_t pad1[2]; + xcb_glx_drawable_t drawable; + uint32_t ust_hi; + uint32_t ust_lo; + uint32_t msc_hi; + uint32_t msc_lo; + uint32_t sbc; + } xcb_glx_buffer_swap_complete_event_t; + #endif + typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Drawable drawable; /* drawable on which event was requested in event mask */ + int event_type; + int64_t ust; + int64_t msc; + int64_t sbc; + } QGLXBufferSwapComplete; #endif QXcbGlxIntegration::QXcbGlxIntegration() @@ -103,7 +100,7 @@ QXcbGlxIntegration::~QXcbGlxIntegration() bool QXcbGlxIntegration::initialize(QXcbConnection *connection) { m_connection = connection; -#ifdef XCB_HAS_XCB_GLX +#if QT_CONFIG(xcb_glx) const xcb_query_extension_reply_t *reply = xcb_get_extension_data(m_connection->xcb_connection(), &xcb_glx_id); if (!reply || !reply->present) @@ -145,7 +142,7 @@ bool QXcbGlxIntegration::handleXcbEvent(xcb_generic_event_t *event, uint respons XEvent dummy; event->sequence = LastKnownRequestProcessed(xdisplay); if (proc(xdisplay, &dummy, (xEvent*)event)) { -#ifdef XCB_HAS_XCB_GLX +#if QT_CONFIG(xcb_glx) // DRI2 clients don't receive GLXBufferSwapComplete events on the wire. // Instead the GLX event is synthesized from the DRI2BufferSwapComplete event // by DRI2WireToEvent(). For an application to be able to see the event -- cgit v1.2.3