summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGerry Boland <gerry.boland@canonical.com>2015-08-04 17:20:36 +0000
committerCI Train Bot <ci-train-bot@canonical.com>2015-08-04 17:20:36 +0000
commitf242e621ad7923a466e618b5a6128ac08987eb00 (patch)
tree870a7a2257bc9b4abca3180f2b96f6abadf6a32a /src
parent6ea9c52de88e1e2a12ab191fcadc1e2823f4427e (diff)
parent76fdf7180bff9add177b6a91334171428b3806f4 (diff)
We depend on Qt 5.4, remove compatibility code for older versions
Approved by: PS Jenkins bot, Daniel d'Andrada
Diffstat (limited to 'src')
-rw-r--r--src/platforms/mirserver/miropenglcontext.cpp6
-rw-r--r--src/platforms/mirserver/miropenglcontext.h9
-rw-r--r--src/platforms/mirserver/mirserverintegration.cpp17
-rw-r--r--src/platforms/mirserver/mirserverintegration.h8
4 files changed, 5 insertions, 35 deletions
diff --git a/src/platforms/mirserver/miropenglcontext.cpp b/src/platforms/mirserver/miropenglcontext.cpp
index cb84666..6c9360a 100644
--- a/src/platforms/mirserver/miropenglcontext.cpp
+++ b/src/platforms/mirserver/miropenglcontext.cpp
@@ -36,7 +36,7 @@
// (i.e. individual display output buffers) to use as a common base context.
MirOpenGLContext::MirOpenGLContext(const QSharedPointer<MirServer> &server, const QSurfaceFormat &format)
-#if GL_DEBUG
+#ifndef QT_NO_DEBUG
: m_logger(new QOpenGLDebugLogger(this))
#endif
{
@@ -96,10 +96,8 @@ MirOpenGLContext::MirOpenGLContext(const QSharedPointer<MirServer> &server, cons
qDebug() << "OpenGL ES extensions:" << qPrintable(string);
q_printEglConfig(eglDisplay, eglConfig);
-#if GL_DEBUG
QObject::connect(m_logger, &QOpenGLDebugLogger::messageLogged,
this, &MirOpenGLContext::onGlDebugMessageLogged, Qt::DirectConnection);
-#endif // Qt>=5.2
#endif // debug
}
@@ -122,7 +120,7 @@ bool MirOpenGLContext::makeCurrent(QPlatformSurface *surface)
if (displayBuffer) {
displayBuffer->makeCurrent();
-#if GL_DEBUG
+#ifndef QT_NO_DEBUG
if (!m_logger->isLogging() && m_logger->initialize()) {
m_logger->startLogging(QOpenGLDebugLogger::SynchronousLogging);
m_logger->enableMessages();
diff --git a/src/platforms/mirserver/miropenglcontext.h b/src/platforms/mirserver/miropenglcontext.h
index de3ec9c..c1d6274 100644
--- a/src/platforms/mirserver/miropenglcontext.h
+++ b/src/platforms/mirserver/miropenglcontext.h
@@ -21,9 +21,7 @@
#include <qpa/qplatformopenglcontext.h>
-#define GL_DEBUG (QT_VERSION >= QT_VERSION_CHECK(5, 2, 0) && !defined(QT_NO_DEBUG))
-
-#if GL_DEBUG
+#ifndef QT_NO_DEBUG
#include <QOpenGLDebugLogger>
#endif
@@ -46,14 +44,13 @@ public:
QFunctionPointer getProcAddress(const QByteArray &procName) override;
-// "#if GL_DEBUG" does not work as MOC does not understand #define
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 2, 0) && !defined(QT_NO_DEBUG))
+#ifndef QT_NO_DEBUG
Q_SLOT void onGlDebugMessageLogged(QOpenGLDebugMessage m) { qDebug() << m; }
#endif
private:
QSurfaceFormat m_format;
-#if GL_DEBUG
+#ifndef QT_NO_DEBUG
QOpenGLDebugLogger *m_logger;
#endif
};
diff --git a/src/platforms/mirserver/mirserverintegration.cpp b/src/platforms/mirserver/mirserverintegration.cpp
index ad33caa..28c8c9d 100644
--- a/src/platforms/mirserver/mirserverintegration.cpp
+++ b/src/platforms/mirserver/mirserverintegration.cpp
@@ -31,11 +31,6 @@
#include <QCoreApplication>
#include <QOpenGLContext>
-
-#if QT_VERSION < QT_VERSION_CHECK(5, 2, 0)
-#include <private/qguiapplication_p.h>
-#endif
-
#include <QDebug>
// Mir
@@ -59,9 +54,6 @@ MirServerIntegration::MirServerIntegration()
: m_accessibility(new QPlatformAccessibility())
, m_fontDb(new QGenericUnixFontDatabase())
, m_services(new Services)
-#if QT_VERSION < QT_VERSION_CHECK(5, 2, 0)
- , m_eventDispatcher(createUnixEventDispatcher())
-#endif
, m_mirServer(new QMirServer(QCoreApplication::arguments()))
, m_display(nullptr)
, m_nativeInterface(nullptr)
@@ -82,11 +74,6 @@ MirServerIntegration::MirServerIntegration()
QObject::connect(m_mirServer.data(), &QMirServer::stopped,
QCoreApplication::instance(), &QCoreApplication::quit);
-#if QT_VERSION < QT_VERSION_CHECK(5, 2, 0)
- QGuiApplicationPrivate::instance()->setEventDispatcher(eventDispatcher_);
- initialize();
-#endif
-
m_inputContext = QPlatformInputContextFactory::create();
}
@@ -105,10 +92,8 @@ bool MirServerIntegration::hasCapability(QPlatformIntegration::Capability cap) c
case SharedGraphicsCache: return true;
case BufferQueueingOpenGL: return true;
case MultipleWindows: return false; // multi-monitor support
-#if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)
case WindowManagement: return false; // platform has no WM, as this implements the WM!
case NonFullScreenWindows: return false;
-#endif
default: return QPlatformIntegration::hasCapability(cap);
}
}
@@ -158,12 +143,10 @@ QPlatformOpenGLContext *MirServerIntegration::createPlatformOpenGLContext(QOpenG
return new MirOpenGLContext(m_mirServer->mirServer(), context->format());
}
-#if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)
QAbstractEventDispatcher *MirServerIntegration::createEventDispatcher() const
{
return createUnixEventDispatcher();
}
-#endif
void MirServerIntegration::initialize()
{
diff --git a/src/platforms/mirserver/mirserverintegration.h b/src/platforms/mirserver/mirserverintegration.h
index a02405e..cc719e8 100644
--- a/src/platforms/mirserver/mirserverintegration.h
+++ b/src/platforms/mirserver/mirserverintegration.h
@@ -47,13 +47,8 @@ public:
QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override;
QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override;
-#if QT_VERSION < QT_VERSION_CHECK(5, 2, 0)
- QAbstractEventDispatcher* guiThreadEventDispatcher() const override { return eventDispatcher_; }
- void initialize();
-#else
QAbstractEventDispatcher *createEventDispatcher() const override;
void initialize() override;
-#endif
QPlatformClipboard *clipboard() const override;
@@ -72,9 +67,6 @@ private:
QScopedPointer<QPlatformAccessibility> m_accessibility;
QScopedPointer<QPlatformFontDatabase> m_fontDb;
QScopedPointer<QPlatformServices> m_services;
-#if QT_VERSION < QT_VERSION_CHECK(5, 2, 0)
- QScopedPointer<QAbstractEventDispatcher> m_eventDispatcher;
-#endif
QScopedPointer<QMirServer> m_mirServer;