Lets the platform plugin advertise whether it's safe to use OpenGL from
a different thread. With XCB we only advertise this if we have a
reasonably new XCB libary, as older versions suffer from the
xcb_wait_for_reply() blocking bug, which cause GL rendering in a
separate to stall when using Mesa drivers.
Change-Id: I4829df7e583a1c8aed218ae13a159d21266cc594
Reviewed-on: http://codereview.qt.nokia.com/3613
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
public:
enum Capability {
ThreadedPixmaps = 1,
- OpenGL = 2
+ OpenGL = 2,
+ ThreadedOpenGL = 3
};
virtual ~QPlatformIntegration() { }
switch (cap) {
case ThreadedPixmaps: return true;
case OpenGL : return true;
+ case ThreadedOpenGL : return true;
default: return QPlatformIntegration::hasCapability(cap);
}
}
{
switch (cap) {
case ThreadedPixmaps: return true;
+ case OpenGL: return true;
+ case ThreadedOpenGL: return true;
default: return QPlatformIntegration::hasCapability(cap);
}
}
switch (cap) {
case ThreadedPixmaps: return true;
case OpenGL: return true;
+ case ThreadedOpenGL: return true;
default: return QPlatformIntegration::hasCapability(cap);
}
}
#else
return false;
#endif
+ case ThreadedOpenGL:
+ return hasCapability(OpenGL);
default: return QPlatformIntegration::hasCapability(cap);
}
}
switch (cap) {
case ThreadedPixmaps:
return true;
+ case OpenGL:
+ return true;
+ case ThreadedOpenGL:
+ return true;
default:
return QPlatformIntegration::hasCapability(cap);
}
switch (cap) {
case ThreadedPixmaps: return true;
case OpenGL: return true;
+ case ThreadedOpenGL:
+#ifdef XCB_POLL_FOR_QUEUED_EVENT
+ return true;
+#else
+ return false;
+#endif
default: return QPlatformIntegration::hasCapability(cap);
}
}