diff options
Diffstat (limited to 'src/plugins/platforms/mirclient')
3 files changed, 14 insertions, 5 deletions
diff --git a/src/plugins/platforms/mirclient/qmirclientclipboard.cpp b/src/plugins/platforms/mirclient/qmirclientclipboard.cpp index 53246f66c0..4cb2b5f740 100644 --- a/src/plugins/platforms/mirclient/qmirclientclipboard.cpp +++ b/src/plugins/platforms/mirclient/qmirclientclipboard.cpp @@ -100,7 +100,7 @@ void QMirClientClipboard::onDBusClipboardGetContentsFinished(QDBusPendingCallWat Q_ASSERT(call == mPendingGetContentsCall.data()); QDBusPendingReply<QByteArray> reply = *call; - if (reply.isError()) { + if (Q_UNLIKELY(reply.isError())) { qCritical("QMirClientClipboard - Failed to get system clipboard contents via D-Bus. %s, %s", qPrintable(reply.error().name()), qPrintable(reply.error().message())); // TODO: Might try again later a number of times... @@ -114,7 +114,7 @@ void QMirClientClipboard::onDBusClipboardGetContentsFinished(QDBusPendingCallWat void QMirClientClipboard::onDBusClipboardSetContentsFinished(QDBusPendingCallWatcher *call) { QDBusPendingReply<void> reply = *call; - if (reply.isError()) { + if (Q_UNLIKELY(reply.isError())) { qCritical("QMirClientClipboard - Failed to set the system clipboard contents via D-Bus. %s, %s", qPrintable(reply.error().name()), qPrintable(reply.error().message())); // TODO: Might try again later a number of times... @@ -148,9 +148,8 @@ void QMirClientClipboard::setupDBus() QStringLiteral("com.canonical.QtMir.Clipboard"), QStringLiteral("ContentsChanged"), this, SLOT(updateMimeData(QByteArray))); - if (!ok) { + if (Q_UNLIKELY(!ok)) qCritical("QMirClientClipboard - Failed to connect to ContentsChanged signal form the D-Bus system clipboard."); - } mDBusClipboard = new QDBusInterface(QStringLiteral("com.canonical.QtMir"), QStringLiteral("/com/canonical/QtMir/Clipboard"), diff --git a/src/plugins/platforms/mirclient/qmirclientglcontext.cpp b/src/plugins/platforms/mirclient/qmirclientglcontext.cpp index 01db3b8d61..e1e7727486 100644 --- a/src/plugins/platforms/mirclient/qmirclientglcontext.cpp +++ b/src/plugins/platforms/mirclient/qmirclientglcontext.cpp @@ -39,6 +39,7 @@ #include "qmirclientwindow.h" #include "qmirclientlogging.h" #include <QtPlatformSupport/private/qeglconvenience_p.h> +#include <QtGui/private/qopenglcontext_p.h> #if !defined(QT_NO_DEBUG) static void printOpenGLESConfig() { @@ -103,6 +104,15 @@ bool QMirClientOpenGLContext::makeCurrent(QPlatformSurface* surface) ASSERT(eglMakeCurrent(mEglDisplay, eglSurface, eglSurface, mEglContext) == EGL_TRUE); printOpenGLESConfig(); #endif + + // When running on the emulator, shaders will be compiled using a thin wrapper around the desktop drivers. + // These wrappers might not support the precision qualifiers, so set the workaround flag to true. + const char *rendererString = reinterpret_cast<const char *>(glGetString(GL_RENDERER)); + if (rendererString != 0 && qstrncmp(rendererString, "Android Emulator", 16) == 0) { + QOpenGLContextPrivate *ctx_d = QOpenGLContextPrivate::get(context()); + ctx_d->workaround_missingPrecisionQualifiers = true; + } + return true; } diff --git a/src/plugins/platforms/mirclient/qmirclientintegration.cpp b/src/plugins/platforms/mirclient/qmirclientintegration.cpp index 4b2572ce0d..592c2d803b 100644 --- a/src/plugins/platforms/mirclient/qmirclientintegration.cpp +++ b/src/plugins/platforms/mirclient/qmirclientintegration.cpp @@ -102,7 +102,7 @@ QMirClientClientIntegration::QMirClientClientIntegration() // Create new application instance mInstance = u_application_instance_new_from_description_with_options(mDesc, mOptions); - if (mInstance == nullptr) + if (Q_UNLIKELY(!mInstance)) qFatal("QMirClientClientIntegration: connection to Mir server failed. Check that a Mir server is\n" "running, and the correct socket is being used and is accessible. The shell may have\n" "rejected the incoming connection, so check its log file"); |