summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xlib
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@nokia.com>2011-04-14 15:48:36 +0200
committerJørgen Lind <jorgen.lind@nokia.com>2011-04-14 15:48:36 +0200
commitc7537e30ba4698b52d90b68875af16285785bf70 (patch)
treeca0f839784bf0447a0d619b21582b4d2642e4053 /src/plugins/platforms/xlib
parentb56444d86aa449e2da15d9b9fd08001f09ac9b25 (diff)
Remove hasOpenGL. This changes breaks binary compatibillity
so you will need to use $QTBUILDDIR/bin/syncqt and recompile all applications
Diffstat (limited to 'src/plugins/platforms/xlib')
-rw-r--r--src/plugins/platforms/xlib/qxlibintegration.cpp9
-rw-r--r--src/plugins/platforms/xlib/qxlibintegration.h3
-rw-r--r--src/plugins/platforms/xlib/qxlibwindow.cpp4
3 files changed, 13 insertions, 3 deletions
diff --git a/src/plugins/platforms/xlib/qxlibintegration.cpp b/src/plugins/platforms/xlib/qxlibintegration.cpp
index 8deb2f3e77..78f907abd2 100644
--- a/src/plugins/platforms/xlib/qxlibintegration.cpp
+++ b/src/plugins/platforms/xlib/qxlibintegration.cpp
@@ -73,6 +73,15 @@ QXlibIntegration::QXlibIntegration(bool useOpenGL)
mScreens.append(mPrimaryScreen);
}
+bool QXlibIntegration::hasCapability(QPlatformIntegration::Capability cap) const
+{
+ switch (cap) {
+ case ThreadedPixmaps: return true;
+ case OpenGL: return hasOpenGL();
+ default: return QPlatformIntegration::hasCapability(cap);
+ }
+}
+
QPixmapData *QXlibIntegration::createPixmapData(QPixmapData::PixelType type) const
{
#ifndef QT_NO_OPENGL
diff --git a/src/plugins/platforms/xlib/qxlibintegration.h b/src/plugins/platforms/xlib/qxlibintegration.h
index f8efae01e5..1a2515a08d 100644
--- a/src/plugins/platforms/xlib/qxlibintegration.h
+++ b/src/plugins/platforms/xlib/qxlibintegration.h
@@ -60,6 +60,7 @@ class QXlibIntegration : public QPlatformIntegration
public:
QXlibIntegration(bool useOpenGL = false);
+ bool hasCapability(Capability cap) const;
QPixmapData *createPixmapData(QPixmapData::PixelType type) const;
QPlatformWindow *createPlatformWindow(QWidget *widget, WId winId) const;
QWindowSurface *createWindowSurface(QWidget *widget, WId winId) const;
@@ -73,9 +74,9 @@ public:
QPlatformNativeInterface *nativeInterface() const;
+private:
bool hasOpenGL() const;
-private:
bool mUseOpenGL;
QXlibScreen *mPrimaryScreen;
QList<QPlatformScreen *> mScreens;
diff --git a/src/plugins/platforms/xlib/qxlibwindow.cpp b/src/plugins/platforms/xlib/qxlibwindow.cpp
index 82e377c91f..9a05fc620d 100644
--- a/src/plugins/platforms/xlib/qxlibwindow.cpp
+++ b/src/plugins/platforms/xlib/qxlibwindow.cpp
@@ -81,7 +81,7 @@ QXlibWindow::QXlibWindow(QWidget *window)
int h = window->height();
if(window->platformWindowFormat().windowApi() == QPlatformWindowFormat::OpenGL
- && QApplicationPrivate::platformIntegration()->hasOpenGL() ) {
+ && QApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::OpenGL) ) {
#if !defined(QT_NO_OPENGL)
#if !defined(QT_OPENGL_ES_2)
XVisualInfo *visualInfo = qglx_findVisualInfo(mScreen->display()->nativeDisplay(),mScreen->xScreenNumber(),window->platformWindowFormat());
@@ -656,7 +656,7 @@ void QXlibWindow::setCursor(const Cursor &cursor)
QPlatformGLContext *QXlibWindow::glContext() const
{
- if (!QApplicationPrivate::platformIntegration()->hasOpenGL())
+ if (!QApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::OpenGL))
return 0;
if (!mGLContext) {
QXlibWindow *that = const_cast<QXlibWindow *>(this);