summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbwindow.cpp
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@nokia.com>2011-03-01 09:06:31 (GMT)
committerJørgen Lind <jorgen.lind@nokia.com>2011-03-01 09:06:31 (GMT)
commit93e0fc1476757331d25b9fe2d357e930eda55331 (patch)
treedccd8f7dc0428af62f51d7d948eb2d3390bd4468 /src/plugins/platforms/xcb/qxcbwindow.cpp
parent7629130b24c01d406f5dee8e6600538db666cfa8 (diff)
downloadQt-93e0fc1476757331d25b9fe2d357e930eda55331.zip
Qt-93e0fc1476757331d25b9fe2d357e930eda55331.tar.gz
Qt-93e0fc1476757331d25b9fe2d357e930eda55331.tar.bz2
Lighthouse: Xcb. implement dri2 context handling
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbwindow.cpp')
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index bb856f2..005aa0e 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -43,6 +43,9 @@
#include "qxcbconnection.h"
#include "qxcbscreen.h"
+#ifdef XCB_USE_DRI2
+#include "qdri2context.h"
+#endif
#include <xcb/xcb_icccm.h>
@@ -137,7 +140,7 @@ QXcbWindow::QXcbWindow(QWidget *tlw)
qFatal("no window!");
}
} else
-#endif
+#endif //defined(XCB_USE_GLX) || defined(XCB_USE_EGL)
{
m_window = xcb_generate_id(xcb_connection());
@@ -437,6 +440,12 @@ QPlatformGLContext *QXcbWindow::glContext() const
QXcbWindow *that = const_cast<QXcbWindow *>(this);
that->m_context = new QEGLPlatformContext(display, config, eglContextAttrs.data(), eglSurface, EGL_OPENGL_ES_API);
}
+#elif defined(XCB_USE_DRI2)
+ if (!m_context) {
+ QXcbWindow *that = const_cast<QXcbWindow *>(this);
+ that->m_context = new QDri2Context(that);
+ }
+
#endif
return m_context;
}
@@ -474,6 +483,11 @@ void QXcbWindow::handleConfigureNotifyEvent(const xcb_configure_notify_event_t *
QPlatformWindow::setGeometry(rect);
QWindowSystemInterface::handleGeometryChange(widget(), rect);
+
+#if XCB_USE_DRI2
+ if (m_context)
+ static_cast<QDri2Context *>(m_context)->resize(rect.size());
+#endif
}
static Qt::MouseButtons translateMouseButtons(int s)