diff options
author | Oswald Buddenhagen <oswald.buddenhagen@digia.com> | 2014-09-10 11:41:29 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@digia.com> | 2014-09-10 11:42:50 +0200 |
commit | d572ab1bb446e880fcb8d27294ba8149550f1659 (patch) | |
tree | d29c449b551e47569c6d9f146ba9e86810c05353 /src/platformsupport | |
parent | 211cef46f6d9d8738c09f906f9c0c3080b445dc8 (diff) | |
parent | 71df09b6cca7cd7a673bf39f49d0dda28b78a860 (diff) |
Merge remote-tracking branch 'origin/5.4' into dev
Change-Id: Id4997327cc01bd4bb397a463bdffbd15e80398ef
Diffstat (limited to 'src/platformsupport')
4 files changed, 18 insertions, 4 deletions
diff --git a/src/platformsupport/eglconvenience/qeglplatformcontext.cpp b/src/platformsupport/eglconvenience/qeglplatformcontext.cpp index 148c5d9b2f..dce8bd888c 100644 --- a/src/platformsupport/eglconvenience/qeglplatformcontext.cpp +++ b/src/platformsupport/eglconvenience/qeglplatformcontext.cpp @@ -249,6 +249,15 @@ void QEGLPlatformContext::adopt(const QVariant &nativeHandle, QPlatformOpenGLCon void QEGLPlatformContext::updateFormatFromGL() { #ifndef QT_NO_OPENGL + // Have to save & restore to prevent QOpenGLContext::currentContext() from becoming + // inconsistent after QOpenGLContext::create(). + EGLDisplay prevDisplay = eglGetCurrentDisplay(); + if (prevDisplay == EGL_NO_DISPLAY) // when no context is current + prevDisplay = m_eglDisplay; + EGLContext prevContext = eglGetCurrentContext(); + EGLSurface prevSurfaceDraw = eglGetCurrentSurface(EGL_DRAW); + EGLSurface prevSurfaceRead = eglGetCurrentSurface(EGL_READ); + // Make the context current to ensure the GL version query works. This needs a surface too. const EGLint pbufferAttributes[] = { EGL_WIDTH, 1, @@ -300,7 +309,7 @@ void QEGLPlatformContext::updateFormatFromGL() } } } - eglMakeCurrent(m_eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); + eglMakeCurrent(prevDisplay, prevSurfaceDraw, prevSurfaceRead, prevContext); } eglDestroySurface(m_eglDisplay, pbuffer); #endif // QT_NO_OPENGL diff --git a/src/platformsupport/eglconvenience/qeglplatformcursor.cpp b/src/platformsupport/eglconvenience/qeglplatformcursor.cpp index b6293e60ec..7198d7c6fb 100644 --- a/src/platformsupport/eglconvenience/qeglplatformcursor.cpp +++ b/src/platformsupport/eglconvenience/qeglplatformcursor.cpp @@ -343,6 +343,8 @@ void QEGLPlatformCursor::draw(const QRectF &r) { if (!m_program) { // one time initialization + initializeOpenGLFunctions(); + createShaderPrograms(); if (!m_cursorAtlas.texture) { @@ -387,6 +389,7 @@ void QEGLPlatformCursor::draw(const QRectF &r) }; glBindTexture(GL_TEXTURE_2D, m_cursor.texture); + glBindBuffer(GL_ARRAY_BUFFER, 0); m_program->enableAttributeArray(m_vertexCoordEntry); m_program->enableAttributeArray(m_textureCoordEntry); diff --git a/src/platformsupport/eglconvenience/qeglplatformcursor_p.h b/src/platformsupport/eglconvenience/qeglplatformcursor_p.h index 6f4216874a..440bcc40eb 100644 --- a/src/platformsupport/eglconvenience/qeglplatformcursor_p.h +++ b/src/platformsupport/eglconvenience/qeglplatformcursor_p.h @@ -44,6 +44,7 @@ #include <qpa/qplatformcursor.h> #include <qpa/qplatformscreen.h> +#include <QtGui/QOpenGLFunctions> QT_BEGIN_NAMESPACE @@ -86,7 +87,7 @@ private: bool m_active; }; -class QEGLPlatformCursor : public QPlatformCursor +class QEGLPlatformCursor : public QPlatformCursor, protected QOpenGLFunctions { public: QEGLPlatformCursor(QPlatformScreen *screen); @@ -113,7 +114,7 @@ private: void draw(const QRectF &rect); void update(const QRegion ®ion); void createShaderPrograms(); - static void createCursorTexture(uint *texture, const QImage &image); + void createCursorTexture(uint *texture, const QImage &image); void initCursorAtlas(); // current cursor information diff --git a/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp b/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp index 26ae0eb724..75359fbaa3 100644 --- a/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp +++ b/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp @@ -96,8 +96,9 @@ void QBasicFontDatabase::populateFontDatabase() QString fontpath = fontDir(); if(!QFile::exists(fontpath)) { - qFatal("QFontDatabase: Cannot find font directory %s - is Qt installed correctly?", + qWarning("QFontDatabase: Cannot find font directory %s - is Qt installed correctly?", qPrintable(fontpath)); + return; } QDir dir(fontpath); |