diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-11-26 22:30:27 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-11-26 22:35:48 +0100 |
commit | 4a8273a6fc2e741e811cf5dabc9a3c240306cf7f (patch) | |
tree | 2148abc88f8543eecdc0b97b2dd92594836af9b2 /src/platformsupport | |
parent | 036c5db468164297d213764c59a4b59daa76d90a (diff) | |
parent | 1c2be58fecaff1de5f2849192eb712984ebd59bd (diff) |
Merge remote-tracking branch 'origin/stable' into dev
For the conflicts in msvc_nmake.cpp the ifdefs are extended since we
need to support windows phone in the target branch while it is not there
in the current stable branch (as of Qt 5.2).
Conflicts:
configure
qmake/generators/win32/msvc_nmake.cpp
src/3rdparty/angle/src/libEGL/Surface.cpp
src/angle/src/common/common.pri
src/corelib/global/qglobal.h
src/corelib/io/qstandardpaths.cpp
src/plugins/platforms/qnx/qqnxintegration.cpp
src/plugins/platforms/qnx/qqnxscreeneventhandler.h
src/plugins/platforms/xcb/qglxintegration.h
src/widgets/kernel/win.pri
tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp
tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp
tools/configure/configureapp.cpp
Change-Id: I00b579eefebaf61d26ab9b00046d2b5bd5958812
Diffstat (limited to 'src/platformsupport')
6 files changed, 55 insertions, 20 deletions
diff --git a/src/platformsupport/eglconvenience/qeglconvenience.cpp b/src/platformsupport/eglconvenience/qeglconvenience.cpp index 50baf6f06d..fe6ba2b215 100644 --- a/src/platformsupport/eglconvenience/qeglconvenience.cpp +++ b/src/platformsupport/eglconvenience/qeglconvenience.cpp @@ -232,17 +232,28 @@ EGLConfig QEglConfigChooser::chooseConfig() configureAttributes.append(surfaceType()); configureAttributes.append(EGL_RENDERABLE_TYPE); - if (m_format.renderableType() == QSurfaceFormat::OpenVG) + switch (m_format.renderableType()) { + case QSurfaceFormat::OpenVG: configureAttributes.append(EGL_OPENVG_BIT); + break; #ifdef EGL_VERSION_1_4 - else if (m_format.renderableType() == QSurfaceFormat::OpenGL) +# if !defined(QT_OPENGL_ES_2) + case QSurfaceFormat::DefaultRenderableType: +# endif + case QSurfaceFormat::OpenGL: configureAttributes.append(EGL_OPENGL_BIT); + break; #endif - else if (m_format.majorVersion() == 1) - configureAttributes.append(EGL_OPENGL_ES_BIT); - else + case QSurfaceFormat::OpenGLES: + if (m_format.majorVersion() == 1) { + configureAttributes.append(EGL_OPENGL_ES_BIT); + break; + } + // fall through + default: configureAttributes.append(EGL_OPENGL_ES2_BIT); - + break; + } configureAttributes.append(EGL_NONE); EGLConfig cfg = 0; @@ -336,7 +347,11 @@ QSurfaceFormat q_glFormatFromConfig(EGLDisplay display, const EGLConfig config, if (referenceFormat.renderableType() == QSurfaceFormat::OpenVG && (renderableType & EGL_OPENVG_BIT)) format.setRenderableType(QSurfaceFormat::OpenVG); #ifdef EGL_VERSION_1_4 - else if (referenceFormat.renderableType() == QSurfaceFormat::OpenGL && (renderableType & EGL_OPENGL_BIT)) + else if ((referenceFormat.renderableType() == QSurfaceFormat::OpenGL +# if !defined(QT_OPENGL_ES_2) + || referenceFormat.renderableType() == QSurfaceFormat::DefaultRenderableType +# endif + ) && (renderableType & EGL_OPENGL_BIT)) format.setRenderableType(QSurfaceFormat::OpenGL); #endif else diff --git a/src/platformsupport/eglconvenience/qeglplatformcontext.cpp b/src/platformsupport/eglconvenience/qeglplatformcontext.cpp index 2bfa7a8a02..ec740b87db 100644 --- a/src/platformsupport/eglconvenience/qeglplatformcontext.cpp +++ b/src/platformsupport/eglconvenience/qeglplatformcontext.cpp @@ -49,14 +49,23 @@ static inline void bindApi(const QSurfaceFormat &format) { - if (format.renderableType() == QSurfaceFormat::OpenVG) + switch (format.renderableType()) { + case QSurfaceFormat::OpenVG: eglBindAPI(EGL_OPENVG_API); + break; #ifdef EGL_VERSION_1_4 - else if (format.renderableType() == QSurfaceFormat::OpenGL) +# if !defined(QT_OPENGL_ES_2) + case QSurfaceFormat::DefaultRenderableType: +# endif + case QSurfaceFormat::OpenGL: eglBindAPI(EGL_OPENGL_API); + break; #endif - else + case QSurfaceFormat::OpenGLES: + default: eglBindAPI(EGL_OPENGL_ES_API); + break; + } } QEGLPlatformContext::QEGLPlatformContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share, EGLDisplay display, diff --git a/src/platformsupport/fbconvenience/qfbwindow.cpp b/src/platformsupport/fbconvenience/qfbwindow.cpp index 8b6186db79..98c16e61c8 100644 --- a/src/platformsupport/fbconvenience/qfbwindow.cpp +++ b/src/platformsupport/fbconvenience/qfbwindow.cpp @@ -48,17 +48,14 @@ QT_BEGIN_NAMESPACE QFbWindow::QFbWindow(QWindow *window) - : QPlatformWindow(window), mBackingStore(0) + : QPlatformWindow(window), mBackingStore(0), mWindowState(Qt::WindowNoState) { static QAtomicInt winIdGenerator(1); mWindowId = winIdGenerator.fetchAndAddRelaxed(1); - - platformScreen()->addWindow(this); } QFbWindow::~QFbWindow() { - platformScreen()->removeWindow(this); } QFbScreen *QFbWindow::platformScreen() const @@ -86,6 +83,11 @@ void QFbWindow::setVisible(bool visible) setGeometry(platformScreen()->availableGeometry()); } QPlatformWindow::setVisible(visible); + + if (visible) + platformScreen()->addWindow(this); + else + platformScreen()->removeWindow(this); } diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm index 72486c097d..38c44e3f35 100644 --- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm +++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm @@ -305,12 +305,20 @@ QFontEngine *QCoreTextFontDatabase::fontEngine(const QFontDef &f, QChar::Script return NULL; } +static void releaseFontData(void* info, const void* data, size_t size) +{ + Q_UNUSED(data); + Q_UNUSED(size); + delete (QByteArray*)info; +} + QFontEngine *QCoreTextFontDatabase::fontEngine(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference) { Q_UNUSED(hintingPreference); - QCFType<CGDataProviderRef> dataProvider = CGDataProviderCreateWithData(NULL, - fontData.constData(), fontData.size(), NULL); + QByteArray* fontDataCopy = new QByteArray(fontData); + QCFType<CGDataProviderRef> dataProvider = CGDataProviderCreateWithData(fontDataCopy, + fontDataCopy->constData(), fontDataCopy->size(), releaseFontData); CGFontRef cgFont = CGFontCreateWithDataProvider(dataProvider); @@ -474,8 +482,9 @@ QStringList QCoreTextFontDatabase::addApplicationFont(const QByteArray &fontData CTFontRef font = NULL; if (!fontData.isEmpty()) { - QCFType<CGDataProviderRef> dataProvider = CGDataProviderCreateWithData(NULL, - fontData.constData(), fontData.size(), NULL); + QByteArray* fontDataCopy = new QByteArray(fontData); + QCFType<CGDataProviderRef> dataProvider = CGDataProviderCreateWithData(fontDataCopy, + fontDataCopy->constData(), fontDataCopy->size(), releaseFontData); CGFontRef cgFont = CGFontCreateWithDataProvider(dataProvider); if (cgFont) { CFErrorRef error; diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp index b97923c4b6..0841544208 100644 --- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp +++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp @@ -224,7 +224,7 @@ void QEvdevKeyboardHandler::processKeyEvent(int nativecode, int unicode, int qtc { QWindowSystemInterface::handleExtendedKeyEvent(0, (isPress ? QEvent::KeyPress : QEvent::KeyRelease), qtcode, modifiers, nativecode + 8, 0, int(modifiers), - QString(unicode), autoRepeat); + (unicode != 0xffff ) ? QString(unicode) : QString(), autoRepeat); } QEvdevKeyboardHandler::KeycodeAction QEvdevKeyboardHandler::processKeycode(quint16 keycode, bool pressed, bool autorepeat) diff --git a/src/platformsupport/input/evdevtouch/evdevtouch.pri b/src/platformsupport/input/evdevtouch/evdevtouch.pri index a6b90937f2..16e1a981fa 100644 --- a/src/platformsupport/input/evdevtouch/evdevtouch.pri +++ b/src/platformsupport/input/evdevtouch/evdevtouch.pri @@ -10,4 +10,4 @@ contains(QT_CONFIG, libudev) { # DEFINES += USE_MTDEV -contains(DEFINES, USE_MTDEV): LIBS += -lmtdev +contains(DEFINES, USE_MTDEV): LIBS_PRIVATE += -lmtdev |