From 75b3c471b3acea8fd0531dc38913181b1bcd941d Mon Sep 17 00:00:00 2001 From: Yuhang Zhao <2546789017@qq.com> Date: Mon, 18 Mar 2019 17:11:15 +0800 Subject: win32-clang-msvc: qmake.conf: Fix alignment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I62bff5e10c0dfb45078a9ff5a2378f251c6596aa Reviewed-by: Mårten Nordheim --- mkspecs/win32-clang-msvc/qmake.conf | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/mkspecs/win32-clang-msvc/qmake.conf b/mkspecs/win32-clang-msvc/qmake.conf index c639ad6f3d..4b9cac3e22 100644 --- a/mkspecs/win32-clang-msvc/qmake.conf +++ b/mkspecs/win32-clang-msvc/qmake.conf @@ -13,19 +13,19 @@ QMAKE_CFLAGS_SSE4_1 = -msse4.1 QMAKE_CFLAGS_SSE4_2 = -msse4.2 QMAKE_CFLAGS_AVX = -mavx QMAKE_CFLAGS_AVX2 = -mavx2 -QMAKE_CFLAGS_F16C = -mf16c -QMAKE_CFLAGS_RDRND = -mrdrnd -QMAKE_CFLAGS_AVX512F = -mavx512f -QMAKE_CFLAGS_AVX512ER = -mavx512er -QMAKE_CFLAGS_AVX512CD = -mavx512cd -QMAKE_CFLAGS_AVX512PF = -mavx512pf -QMAKE_CFLAGS_AVX512DQ = -mavx512dq -QMAKE_CFLAGS_AVX512BW = -mavx512bw -QMAKE_CFLAGS_AVX512VL = -mavx512vl +QMAKE_CFLAGS_F16C = -mf16c +QMAKE_CFLAGS_RDRND = -mrdrnd +QMAKE_CFLAGS_AVX512F = -mavx512f +QMAKE_CFLAGS_AVX512ER = -mavx512er +QMAKE_CFLAGS_AVX512CD = -mavx512cd +QMAKE_CFLAGS_AVX512PF = -mavx512pf +QMAKE_CFLAGS_AVX512DQ = -mavx512dq +QMAKE_CFLAGS_AVX512BW = -mavx512bw +QMAKE_CFLAGS_AVX512VL = -mavx512vl QMAKE_CFLAGS_AVX512IFMA = -mavx512ifma QMAKE_CFLAGS_AVX512VBMI = -mavx512vbmi -QMAKE_CFLAGS_AESNI = -maes -QMAKE_CFLAGS_SHANI = -msha +QMAKE_CFLAGS_AESNI = -maes +QMAKE_CFLAGS_SHANI = -msha QMAKE_COMPILER += clang_cl llvm -- cgit v1.2.3 From b4b8ea6181760ac3005868ed2f3b711ca29ca774 Mon Sep 17 00:00:00 2001 From: Timo Aarnipuro Date: Fri, 1 Feb 2019 15:20:20 +0200 Subject: configure: Allow libraries to be defined with exact filename INTEGRITY compiler searches for exact filename if the -l argument already contains .a suffix. GNU linker uses exact filename if -l argument begins with a colon. Change-Id: I62be8f1e6b9c7dc7eaa5ab3d4bfc55460d729737 Reviewed-by: Oswald Buddenhagen --- mkspecs/features/qt_configure.prf | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index e845bf1577..62ad972796 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -540,7 +540,15 @@ defineTest(qtConfResolveLibs) { } else: contains(l, "^-l.*") { lib = $$replace(l, "^-l", ) lcan = - unix { + integrity:contains(lib, "^.*\\.a") { + # INTEGRITY compiler searches for exact filename + # if -l argument has .a suffix + lcan += $${lib} + } else: contains(lib, "^:.*") { + # Use exact filename when -l:filename syntax is used. + lib ~= s/^:// + lcan += $${lib} + } else: unix { # Under UNIX, we look for actual shared libraries, in addition # to static ones. shexts = $$QMAKE_EXTENSION_SHLIB $$QMAKE_EXTENSIONS_AUX_SHLIB -- cgit v1.2.3 From 7c506150a52031877145daceb032ccb882fd0a1b Mon Sep 17 00:00:00 2001 From: Alexander Volkov Date: Tue, 19 Mar 2019 18:13:23 +0300 Subject: Force font antialiasing with highdpi scaling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fonts look ugly when they are drawn scaled without antialiasing. Change-Id: I64268db5b37d4bc763ffa23632aca2eaac5d8eae Reviewed-by: Morten Johan Sørvig --- src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp index aa8f9a892a..e545d54ec2 100644 --- a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp +++ b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp @@ -908,7 +908,7 @@ QFont QFontconfigDatabase::defaultFont() const void QFontconfigDatabase::setupFontEngine(QFontEngineFT *engine, const QFontDef &fontDef) const { bool antialias = !(fontDef.styleStrategy & QFont::NoAntialias); - bool forcedAntialiasSetting = !antialias; + bool forcedAntialiasSetting = !antialias || QHighDpiScaling::isActive(); const QPlatformServices *services = QGuiApplicationPrivate::platformIntegration()->services(); bool useXftConf = false; -- cgit v1.2.3 From c808a6978b0e99086b1e42b565afe957d7295a9d Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Fri, 1 Mar 2019 15:37:08 +0100 Subject: Add a means to handle dynamically created qmldir files This will enable modules like QtWebView which needs to generate its qmldir at qmake time since it changes depending on whether QtWebEngine is available or not. This ensures that it is not created in the sources directory and in the build directory and correctly picked up. Task-number: QTBUG-65092 Change-Id: Iac628b97145d29778f554510e8e07102d588df64 Reviewed-by: Joerg Bornemann --- mkspecs/features/qml_module.prf | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/mkspecs/features/qml_module.prf b/mkspecs/features/qml_module.prf index bd84ce597a..dbf5b74355 100644 --- a/mkspecs/features/qml_module.prf +++ b/mkspecs/features/qml_module.prf @@ -13,7 +13,14 @@ equals(TEMPLATE, app): TEMPLATE = aux isEmpty(TARGETPATH): error("Must set TARGETPATH (QML import name)") -qmldir_file = $$_PRO_FILE_PWD_/qmldir +!isEmpty(DYNAMIC_QMLDIR) { + qmldir_path = $$OUT_PWD + write_file($${qmldir_path}/qmldir, DYNAMIC_QMLDIR)|error("Aborting.") +} else { + qmldir_path = $$_PRO_FILE_PWD_ +} + +qmldir_file = $${qmldir_path}/qmldir fq_qml_files = for(qmlf, QML_FILES): fq_qml_files += $$absolute_path($$qmlf, $$_PRO_FILE_PWD_) @@ -42,13 +49,20 @@ builtin_resources { } # Install rules -qmldir.base = $$_PRO_FILE_PWD_ +qmldir.base = $$qmldir_path # Tools need qmldir and plugins.qmltypes always installed on the file system -qmldir.files = $$qmldir_file $$fq_aux_qml_files + +qmldir.files = $$qmldir_file install_qml_files: qmldir.files += $$fq_qml_files qmldir.path = $$[QT_INSTALL_QML]/$$TARGETPATH INSTALLS += qmldir +qmlfiles.base = $$_PRO_FILE_PWD_ +qmlfiles.files = $$fq_aux_qml_files +install_qml_files: qmlfiles.files += $$fq_qml_files +qmlfiles.path = $${qmldir.path} +INSTALLS += qmlfiles + !debug_and_release|!build_all|CONFIG(release, debug|release) { !prefix_build { COPIES += qmldir -- cgit v1.2.3 From 2abd969ef6f5841526c48da2e54fe47a001e8d69 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 12 Mar 2019 09:03:13 +0100 Subject: tst_qmake: Keep the source dir clean Copy the test data into a temporary directory and do all the work there without tainting the source directory. More importantly, do not pull in any settings from the Qt build to test what actual users will encounter. Change-Id: I793b86bfadb7597efb47c8f2d3fc863384c78a79 Reviewed-by: Oliver Wolff --- tests/auto/tools/qmake/testcompiler.cpp | 4 +- tests/auto/tools/qmake/testcompiler.h | 3 +- .../testdata/subdirs/simple_dll/simple_dll.pro | 1 - tests/auto/tools/qmake/tst_qmake.cpp | 86 ++++++++++++++++++---- 4 files changed, 75 insertions(+), 19 deletions(-) diff --git a/tests/auto/tools/qmake/testcompiler.cpp b/tests/auto/tools/qmake/testcompiler.cpp index da76b3f2ca..3276d97354 100644 --- a/tests/auto/tools/qmake/testcompiler.cpp +++ b/tests/auto/tools/qmake/testcompiler.cpp @@ -67,7 +67,9 @@ static QString targetName( BuildType buildMode, const QString& target, const QSt break; case Dll: // dll targetName.prepend("lib"); - targetName.append("." + version + ".dylib"); + if (!version.isEmpty()) + targetName.append('.' + version); + targetName.append(".dylib"); break; case Lib: // lib targetName.prepend("lib"); diff --git a/tests/auto/tools/qmake/testcompiler.h b/tests/auto/tools/qmake/testcompiler.h index a46c9b6b6a..d3fe6d88f8 100644 --- a/tests/auto/tools/qmake/testcompiler.h +++ b/tests/auto/tools/qmake/testcompiler.h @@ -60,7 +60,8 @@ public: // executes a make in the specified workPath, with an optional target (eg. install) bool make( const QString &workPath, const QString &target = QString(), bool expectFail = false ); // checks if the executable exists in destDir - bool exists( const QString &destDir, const QString &exeName, BuildType buildType, const QString &version ); + bool exists(const QString &destDir, const QString &exeName, BuildType buildType, + const QString &version = QString()); // removes the makefile bool removeMakefile( const QString &workPath ); // removes the project file specified by 'project' on the 'workPath' diff --git a/tests/auto/tools/qmake/testdata/subdirs/simple_dll/simple_dll.pro b/tests/auto/tools/qmake/testdata/subdirs/simple_dll/simple_dll.pro index 4e362bb918..d13f49bb89 100644 --- a/tests/auto/tools/qmake/testdata/subdirs/simple_dll/simple_dll.pro +++ b/tests/auto/tools/qmake/testdata/subdirs/simple_dll/simple_dll.pro @@ -6,7 +6,6 @@ DEFINES += SIMPLEDLL_MAKEDLL HEADERS = simple.h SOURCES = simple.cpp -VERSION = 1.0.0 INCLUDEPATH += . tmp MOC_DIR = tmp OBJECTS_DIR = tmp diff --git a/tests/auto/tools/qmake/tst_qmake.cpp b/tests/auto/tools/qmake/tst_qmake.cpp index 10aabcf196..2b822e682f 100644 --- a/tests/auto/tools/qmake/tst_qmake.cpp +++ b/tests/auto/tools/qmake/tst_qmake.cpp @@ -30,9 +30,11 @@ #include "testcompiler.h" +#include +#include #include #include -#include +#include #if defined(DEBUG_BUILD) # define DIR_INFIX "debug/" @@ -46,8 +48,12 @@ class tst_qmake : public QObject { Q_OBJECT +public: + tst_qmake(); + private slots: void initTestCase(); + void cleanupTestCase(); void cleanup(); void simple_app(); void simple_app_shadowbuild(); @@ -78,11 +84,41 @@ private slots: private: TestCompiler test_compiler; + QTemporaryDir tempWorkDir; QString base_path; + const QString origCurrentDirPath; }; +tst_qmake::tst_qmake() + : tempWorkDir(QDir::tempPath() + "/tst_qmake"), + origCurrentDirPath(QDir::currentPath()) +{ +} + +static void copyDir(const QString &sourceDirPath, const QString &targetDirPath) +{ + QDir currentDir; + QDirIterator dit(sourceDirPath, QDir::Dirs | QDir::NoDotAndDotDot | QDir::Hidden); + while (dit.hasNext()) { + dit.next(); + const QString targetPath = targetDirPath + QLatin1Char('/') + dit.fileName(); + currentDir.mkpath(targetPath); + copyDir(dit.filePath(), targetPath); + } + + QDirIterator fit(sourceDirPath, QDir::Files | QDir::Hidden); + while (fit.hasNext()) { + fit.next(); + const QString targetPath = targetDirPath + QLatin1Char('/') + fit.fileName(); + QFile::remove(targetPath); // allowed to fail + QFile src(fit.filePath()); + QVERIFY2(src.copy(targetPath), qPrintable(src.errorString())); + } +} + void tst_qmake::initTestCase() { + QVERIFY2(tempWorkDir.isValid(), qPrintable(tempWorkDir.errorString())); QString binpath = QLibraryInfo::location(QLibraryInfo::BinariesPath); QString cmd = QString("%1/qmake").arg(binpath); #ifdef Q_CC_MSVC @@ -99,13 +135,31 @@ void tst_qmake::initTestCase() #else test_compiler.setBaseCommands( "make", cmd ); #endif - //Detect the location of the testdata - QString subProgram = QLatin1String("testdata/simple_app/main.cpp"); - base_path = QFINDTESTDATA(subProgram); - if (base_path.lastIndexOf(subProgram) > 0) - base_path = base_path.left(base_path.lastIndexOf(subProgram)); - else - base_path = QCoreApplication::applicationDirPath(); + const QString testDataSubDir = QStringLiteral("testdata"); + const QString subProgram = testDataSubDir + QLatin1String("/simple_app/main.cpp"); + QString testDataPath = QFINDTESTDATA(subProgram); + if (!testDataPath.endsWith(subProgram)) + QFAIL("Cannot find test data directory."); + testDataPath.chop(subProgram.length() - testDataSubDir.length()); + + QString userWorkDir = qgetenv("TST_QMAKE_BUILD_DIR"); + if (userWorkDir.isEmpty()) { + base_path = tempWorkDir.path(); + } else { + if (!QFile::exists(userWorkDir)) { + QFAIL(qUtf8Printable(QStringLiteral("TST_QMAKE_BUILD_DIR %1 does not exist.") + .arg(userWorkDir))); + } + base_path = userWorkDir; + } + + copyDir(testDataPath, base_path + QLatin1Char('/') + testDataSubDir); +} + +void tst_qmake::cleanupTestCase() +{ + // On Windows, ~QTemporaryDir fails to remove the directory if we're still in there. + QDir::setCurrent(origCurrentDirPath); } void tst_qmake::cleanup() @@ -205,12 +259,12 @@ void tst_qmake::subdirs() D.remove( workDir + "/simple_dll/Makefile"); QVERIFY( test_compiler.qmake( workDir, "subdirs" )); QVERIFY( test_compiler.make( workDir )); - QVERIFY( test_compiler.exists( workDir + "/simple_app/dest dir", "simple app", Exe, "1.0.0" )); - QVERIFY( test_compiler.exists( workDir + "/simple_dll/dest dir", "simple dll", Dll, "1.0.0" )); + QVERIFY( test_compiler.exists(workDir + "/simple_app/dest dir", "simple app", Exe)); + QVERIFY( test_compiler.exists(workDir + "/simple_dll/dest dir", "simple dll", Dll)); QVERIFY( test_compiler.makeClean( workDir )); // Should still exist after a make clean - QVERIFY( test_compiler.exists( workDir + "/simple_app/dest dir", "simple app", Exe, "1.0.0" )); - QVERIFY( test_compiler.exists( workDir + "/simple_dll/dest dir", "simple dll", Dll, "1.0.0" )); + QVERIFY( test_compiler.exists(workDir + "/simple_app/dest dir", "simple app", Exe)); + QVERIFY( test_compiler.exists(workDir + "/simple_dll/dest dir", "simple dll", Dll)); // Since subdirs templates do not have a make dist clean, we should clean up ourselves // properly QVERIFY( test_compiler.makeDistClean( workDir )); @@ -500,8 +554,8 @@ void tst_qmake::resources() QVERIFY(test_compiler.qmake(workDir, "resources")); { - QFile qrcFile(workDir + "/.rcc/" DIR_INFIX "qmake_pro_file.qrc"); - QVERIFY(qrcFile.exists()); + QFile qrcFile(workDir + '/' + DIR_INFIX "qmake_pro_file.qrc"); + QVERIFY2(qrcFile.exists(), qPrintable(qrcFile.fileName())); QVERIFY(qrcFile.open(QFile::ReadOnly)); QByteArray qrcXml = qrcFile.readAll(); QVERIFY(qrcXml.contains("alias=\"resources.pro\"")); @@ -509,7 +563,7 @@ void tst_qmake::resources() } { - QFile qrcFile(workDir + "/.rcc/" DIR_INFIX "qmake_subdir.qrc"); + QFile qrcFile(workDir + '/' + DIR_INFIX "qmake_subdir.qrc"); QVERIFY(qrcFile.exists()); QVERIFY(qrcFile.open(QFile::ReadOnly)); QByteArray qrcXml = qrcFile.readAll(); @@ -517,7 +571,7 @@ void tst_qmake::resources() } { - QFile qrcFile(workDir + "/.rcc/" DIR_INFIX "qmake_qmake_immediate.qrc"); + QFile qrcFile(workDir + '/' + DIR_INFIX "qmake_qmake_immediate.qrc"); QVERIFY(qrcFile.exists()); QVERIFY(qrcFile.open(QFile::ReadOnly)); QByteArray qrcXml = qrcFile.readAll(); -- cgit v1.2.3 From f48a76bbbfb5823fb98d17a042bb00ad7c9da174 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Wed, 20 Mar 2019 10:10:28 +0100 Subject: Revert "Fix compilation with icc, converting between egl's and gl's Error types" The patch causes an Assert on close and thus cannot be used as is. I do not have ICC available to try to come up with an alternative solution so the patch is reverted for the time being. This reverts commit 93a78799c3df7c8859b2d9addad45bb4a535dc97. Fixes: QTBUG-74467 Change-Id: Ic572dfa667a479686675eb3f9066d133657b4499 Reviewed-by: Friedemann Kleint Reviewed-by: Yuhang Zhao <2546789017@qq.com> --- src/3rdparty/angle/src/libANGLE/Context.cpp | 3 +- src/3rdparty/angle/src/libANGLE/Stream.cpp | 8 +- src/3rdparty/angle/src/libANGLE/Texture.cpp | 3 +- .../src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp | 3 +- ...tion-with-icc-converting-between-egl-s-an.patch | 93 ---------------------- 5 files changed, 6 insertions(+), 104 deletions(-) delete mode 100644 src/angle/patches/0013-Fix-compilation-with-icc-converting-between-egl-s-an.patch diff --git a/src/3rdparty/angle/src/libANGLE/Context.cpp b/src/3rdparty/angle/src/libANGLE/Context.cpp index 84f7936feb..f638beda58 100644 --- a/src/3rdparty/angle/src/libANGLE/Context.cpp +++ b/src/3rdparty/angle/src/libANGLE/Context.cpp @@ -451,8 +451,7 @@ egl::Error Context::onDestroy(const egl::Display *display) for (auto &zeroTexture : mZeroTextures) { - auto result = zeroTexture.second->onDestroy(this); - ANGLE_TRY(egl::Error(result)); + ANGLE_TRY(zeroTexture.second->onDestroy(this)); zeroTexture.second.set(this, nullptr); } mZeroTextures.clear(); diff --git a/src/3rdparty/angle/src/libANGLE/Stream.cpp b/src/3rdparty/angle/src/libANGLE/Stream.cpp index e384c7d486..68279976b7 100644 --- a/src/3rdparty/angle/src/libANGLE/Stream.cpp +++ b/src/3rdparty/angle/src/libANGLE/Stream.cpp @@ -192,9 +192,8 @@ Error Stream::consumerAcquire(const gl::Context *context) { if (mPlanes[i].texture != nullptr) { - auto result = mPlanes[i].texture->acquireImageFromStream( - context, mProducerImplementation->getGLFrameDescription(i)); - ANGLE_TRY(Error(result)); + ANGLE_TRY(mPlanes[i].texture->acquireImageFromStream( + context, mProducerImplementation->getGLFrameDescription(i))); } } @@ -214,8 +213,7 @@ Error Stream::consumerRelease(const gl::Context *context) { if (mPlanes[i].texture != nullptr) { - auto result = mPlanes[i].texture->releaseImageFromStream(context); - ANGLE_TRY(Error(result)); + ANGLE_TRY(mPlanes[i].texture->releaseImageFromStream(context)); } } diff --git a/src/3rdparty/angle/src/libANGLE/Texture.cpp b/src/3rdparty/angle/src/libANGLE/Texture.cpp index 7447604fe6..da92e65916 100644 --- a/src/3rdparty/angle/src/libANGLE/Texture.cpp +++ b/src/3rdparty/angle/src/libANGLE/Texture.cpp @@ -550,8 +550,7 @@ Error Texture::onDestroy(const Context *context) { if (mBoundSurface) { - auto result = mBoundSurface->releaseTexImage(context, EGL_BACK_BUFFER); - ANGLE_TRY(Error(result)); + ANGLE_TRY(mBoundSurface->releaseTexImage(context, EGL_BACK_BUFFER)); mBoundSurface = nullptr; } if (mBoundStream) diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp index b583273641..75c6298868 100644 --- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp +++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp @@ -376,8 +376,7 @@ egl::Error Renderer9::initializeDevice() ASSERT(!mBlit); mBlit = new Blit9(this); - auto result = mBlit->initialize(); - ANGLE_TRY(egl::Error(result)); + ANGLE_TRY(mBlit->initialize()); ASSERT(!mVertexDataManager && !mIndexDataManager); mVertexDataManager = new VertexDataManager(this); diff --git a/src/angle/patches/0013-Fix-compilation-with-icc-converting-between-egl-s-an.patch b/src/angle/patches/0013-Fix-compilation-with-icc-converting-between-egl-s-an.patch deleted file mode 100644 index 6d3b1cac08..0000000000 --- a/src/angle/patches/0013-Fix-compilation-with-icc-converting-between-egl-s-an.patch +++ /dev/null @@ -1,93 +0,0 @@ -From 2d8118620d4871f74a3ddca233529ff540384477 Mon Sep 17 00:00:00 2001 -From: Yuhang Zhao <2546789017@qq.com> -Date: Wed, 13 Feb 2019 23:26:55 +0800 -Subject: [PATCH] Fix compilation with icc, converting between egl's and gl's - Error types - -Each has two constructors from the other, one copying the other -moving; and this leads to an ambiguous overload when converting -Texture::onDestroy()'s gl::error to the egl::Error that -gl::Context::onDestroy() returns. Passing the value through a -temporary prevents the move-constructor from being attempted and saves -the day. Thanks to Ville Voutilainen for suggesting the fix. - -Fixes: QTBUG-73698 -Change-Id: I628173399a73cee2e253201bc3e8d3e6477a2fbf ---- - src/3rdparty/angle/src/libANGLE/Context.cpp | 3 ++- - src/3rdparty/angle/src/libANGLE/Stream.cpp | 8 +++++--- - src/3rdparty/angle/src/libANGLE/Texture.cpp | 3 ++- - .../angle/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp | 3 ++- - 4 files changed, 11 insertions(+), 6 deletions(-) - -diff --git a/src/3rdparty/angle/src/libANGLE/Context.cpp b/src/3rdparty/angle/src/libANGLE/Context.cpp -index f638beda58..84f7936feb 100644 ---- a/src/3rdparty/angle/src/libANGLE/Context.cpp -+++ b/src/3rdparty/angle/src/libANGLE/Context.cpp -@@ -451,7 +451,8 @@ egl::Error Context::onDestroy(const egl::Display *display) - - for (auto &zeroTexture : mZeroTextures) - { -- ANGLE_TRY(zeroTexture.second->onDestroy(this)); -+ auto result = zeroTexture.second->onDestroy(this); -+ ANGLE_TRY(egl::Error(result)); - zeroTexture.second.set(this, nullptr); - } - mZeroTextures.clear(); -diff --git a/src/3rdparty/angle/src/libANGLE/Stream.cpp b/src/3rdparty/angle/src/libANGLE/Stream.cpp -index 68279976b7..e384c7d486 100644 ---- a/src/3rdparty/angle/src/libANGLE/Stream.cpp -+++ b/src/3rdparty/angle/src/libANGLE/Stream.cpp -@@ -192,8 +192,9 @@ Error Stream::consumerAcquire(const gl::Context *context) - { - if (mPlanes[i].texture != nullptr) - { -- ANGLE_TRY(mPlanes[i].texture->acquireImageFromStream( -- context, mProducerImplementation->getGLFrameDescription(i))); -+ auto result = mPlanes[i].texture->acquireImageFromStream( -+ context, mProducerImplementation->getGLFrameDescription(i)); -+ ANGLE_TRY(Error(result)); - } - } - -@@ -213,7 +214,8 @@ Error Stream::consumerRelease(const gl::Context *context) - { - if (mPlanes[i].texture != nullptr) - { -- ANGLE_TRY(mPlanes[i].texture->releaseImageFromStream(context)); -+ auto result = mPlanes[i].texture->releaseImageFromStream(context); -+ ANGLE_TRY(Error(result)); - } - } - -diff --git a/src/3rdparty/angle/src/libANGLE/Texture.cpp b/src/3rdparty/angle/src/libANGLE/Texture.cpp -index da92e65916..7447604fe6 100644 ---- a/src/3rdparty/angle/src/libANGLE/Texture.cpp -+++ b/src/3rdparty/angle/src/libANGLE/Texture.cpp -@@ -550,7 +550,8 @@ Error Texture::onDestroy(const Context *context) - { - if (mBoundSurface) - { -- ANGLE_TRY(mBoundSurface->releaseTexImage(context, EGL_BACK_BUFFER)); -+ auto result = mBoundSurface->releaseTexImage(context, EGL_BACK_BUFFER); -+ ANGLE_TRY(Error(result)); - mBoundSurface = nullptr; - } - if (mBoundStream) -diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp -index 75c6298868..b583273641 100644 ---- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp -+++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp -@@ -376,7 +376,8 @@ egl::Error Renderer9::initializeDevice() - - ASSERT(!mBlit); - mBlit = new Blit9(this); -- ANGLE_TRY(mBlit->initialize()); -+ auto result = mBlit->initialize(); -+ ANGLE_TRY(egl::Error(result)); - - ASSERT(!mVertexDataManager && !mIndexDataManager); - mVertexDataManager = new VertexDataManager(this); --- -2.20.1.windows.1 - -- cgit v1.2.3 From b0145f029cdde7ae8475b85a20099f115879496e Mon Sep 17 00:00:00 2001 From: Alexander Volkov Date: Mon, 18 Mar 2019 16:03:59 +0300 Subject: Handle device pixel ratio in QIconLoaderEngine::paint() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QIcon::paint() paints blurry icons on HighDPI screens. In particular, it is called by QCommonStyle to paint icons for CE_ItemViewItem's. Change-Id: Iffe6bd01a8756e617656195ef63fe13c968e0832 Reviewed-by: Morten Johan Sørvig --- src/gui/image/qiconloader.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/image/qiconloader.cpp b/src/gui/image/qiconloader.cpp index a9adde8c8d..1d0c93f26f 100644 --- a/src/gui/image/qiconloader.cpp +++ b/src/gui/image/qiconloader.cpp @@ -629,7 +629,10 @@ void QIconLoaderEngine::ensureLoaded() void QIconLoaderEngine::paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state) { - QSize pixmapSize = rect.size(); + const qreal dpr = !qApp->testAttribute(Qt::AA_UseHighDpiPixmaps) ? + qreal(1.0) : painter->device()->devicePixelRatioF(); + + QSize pixmapSize = rect.size() * dpr; painter->drawPixmap(rect, pixmap(pixmapSize, mode, state)); } -- cgit v1.2.3 From 26462f9c4c31a691cf98526c4cea23afee79bcc6 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 7 Mar 2019 09:54:30 +0100 Subject: X11PaintEngine: Don't use system clip for non-system painting When painting into a pixmap, we would apply the system clip, which is a rectangle that starts at the position of the current widget relative to the window. If the widget was not positioned at (0,0), we would therefore clip the top left part of the drawing when drawing into a pixmap, which is obviously not intentional. The solution is in accordance with how it is done in e.g. the OpenGL paint engine, where useSystemClip is set to true only if we are drawing to a widget. The system clip should otherwise be ignored, so we do that in the X11 paint engine as well. Task-number: QTBUG-70387 Change-Id: I9cad26019970280a8a452dc6f1015d229120cac5 Reviewed-by: Eskil Abrahamsen Blomfeldt --- .../platforms/xcb/nativepainting/qbackingstore_x11.cpp | 4 ++++ .../platforms/xcb/nativepainting/qpaintengine_x11.cpp | 10 +++++++--- src/plugins/platforms/xcb/nativepainting/qpixmap_x11.cpp | 14 ++++++++++++++ src/plugins/platforms/xcb/nativepainting/qpixmap_x11_p.h | 5 ++++- 4 files changed, 29 insertions(+), 4 deletions(-) diff --git a/src/plugins/platforms/xcb/nativepainting/qbackingstore_x11.cpp b/src/plugins/platforms/xcb/nativepainting/qbackingstore_x11.cpp index ed482e5dae..bbc156fc53 100644 --- a/src/plugins/platforms/xcb/nativepainting/qbackingstore_x11.cpp +++ b/src/plugins/platforms/xcb/nativepainting/qbackingstore_x11.cpp @@ -192,6 +192,10 @@ bool QXcbNativeBackingStore::scroll(const QRegion &area, int dx, int dy) void QXcbNativeBackingStore::beginPaint(const QRegion ®ion) { + QX11PlatformPixmap *x11pm = qt_x11Pixmap(m_pixmap); + if (x11pm) + x11pm->setIsBackingStore(true); + #if QT_CONFIG(xrender) if (m_translucentBackground) { const QVector xrects = qt_region_to_xrectangles(region); diff --git a/src/plugins/platforms/xcb/nativepainting/qpaintengine_x11.cpp b/src/plugins/platforms/xcb/nativepainting/qpaintengine_x11.cpp index a3e6cedecd..d43b273f4d 100644 --- a/src/plugins/platforms/xcb/nativepainting/qpaintengine_x11.cpp +++ b/src/plugins/platforms/xcb/nativepainting/qpaintengine_x11.cpp @@ -200,6 +200,7 @@ public: uint has_pattern : 1; uint has_alpha_pen : 1; uint has_alpha_brush : 1; + uint use_sysclip : 1; uint render_hints; const QXcbX11Info *xinfo; @@ -701,6 +702,9 @@ bool QX11PaintEngine::begin(QPaintDevice *pdev) d->xlibMaxLinePoints = 32762; // a safe number used to avoid, call to XMaxRequestSize(d->dpy) - 3; d->opacity = 1; + QX11PlatformPixmap *x11pm = paintDevice()->devType() == QInternal::Pixmap ? qt_x11Pixmap(*static_cast(paintDevice())) : nullptr; + d->use_sysclip = paintDevice()->devType() == QInternal::Widget || (x11pm ? x11pm->isBackingStore() : false); + // Set up the polygon clipper. Note: This will only work in // polyline mode as long as we have a buffer zone, since a // polyline may be clipped into several non-connected polylines. @@ -1472,7 +1476,7 @@ void QX11PaintEngine::updatePen(const QPen &pen) } if (!d->has_clipping) { // if clipping is set the paintevent clip region is merged with the clip region - QRegion sysClip = systemClip(); + QRegion sysClip = d->use_sysclip ? systemClip() : QRegion(); if (!sysClip.isEmpty()) x11SetClipRegion(d->dpy, d->gc, 0, d->picture, sysClip); else @@ -1603,7 +1607,7 @@ void QX11PaintEngine::updateBrush(const QBrush &brush, const QPointF &origin) vals.fill_style = s; XChangeGC(d->dpy, d->gc_brush, mask, &vals); if (!d->has_clipping) { - QRegion sysClip = systemClip(); + QRegion sysClip = d->use_sysclip ? systemClip() : QRegion(); if (!sysClip.isEmpty()) x11SetClipRegion(d->dpy, d->gc_brush, 0, d->picture, sysClip); else @@ -2223,7 +2227,7 @@ void QX11PaintEngine::updateMatrix(const QTransform &mtx) void QX11PaintEngine::updateClipRegion_dev(const QRegion &clipRegion, Qt::ClipOperation op) { Q_D(QX11PaintEngine); - QRegion sysClip = systemClip(); + QRegion sysClip = d->use_sysclip ? systemClip() : QRegion(); if (op == Qt::NoClip) { d->has_clipping = false; d->crgn = sysClip; diff --git a/src/plugins/platforms/xcb/nativepainting/qpixmap_x11.cpp b/src/plugins/platforms/xcb/nativepainting/qpixmap_x11.cpp index 86c87e5e30..b1ce39f363 100644 --- a/src/plugins/platforms/xcb/nativepainting/qpixmap_x11.cpp +++ b/src/plugins/platforms/xcb/nativepainting/qpixmap_x11.cpp @@ -1772,6 +1772,20 @@ XID QX11PlatformPixmap::createBitmapFromImage(const QImage &image) return hd; } +bool QX11PlatformPixmap::isBackingStore() const +{ + return (flags & IsBackingStore); +} + +void QX11PlatformPixmap::setIsBackingStore(bool on) +{ + if (on) + flags |= IsBackingStore; + else { + flags &= ~IsBackingStore; + } +} + #if QT_CONFIG(xrender) void QX11PlatformPixmap::convertToARGB32(bool preserveContents) { diff --git a/src/plugins/platforms/xcb/nativepainting/qpixmap_x11_p.h b/src/plugins/platforms/xcb/nativepainting/qpixmap_x11_p.h index 7392cbfccf..9c0ba98300 100644 --- a/src/plugins/platforms/xcb/nativepainting/qpixmap_x11_p.h +++ b/src/plugins/platforms/xcb/nativepainting/qpixmap_x11_p.h @@ -90,6 +90,8 @@ public: void convertToARGB32(bool preserveContents = true); #endif + bool isBackingStore() const; + void setIsBackingStore(bool on); private: friend class QX11PaintEngine; friend const QXcbX11Info &qt_x11Info(const QPixmap &pixmap); @@ -110,7 +112,8 @@ private: Uninitialized = 0x1, Readonly = 0x2, InvertedWhenBoundToTexture = 0x4, - GlSurfaceCreatedWithAlpha = 0x8 + GlSurfaceCreatedWithAlpha = 0x8, + IsBackingStore = 0x10 }; uint flags; -- cgit v1.2.3 From 12978d4ad03af753130ba7c40b6203491cd86cd5 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Mon, 18 Mar 2019 14:02:26 +0100 Subject: Android: Support for separate landscape/portrait splash screens To get appropriate aspect ratios for the splash screen, you usually need separate drawables for the portrait and landscape versions. We support this by adding two new meta data entries that can be used. If they are not available, we will fall back to the generic one, so we are still compatible with existing AndroidManifest.xmls. [ChangeLog][Android] Added entries in the AndroidManifest.xml for specific portrait and landscape splash screens. If one is present for the current orientation, it will be preferred over the generic one. Task-number: QTBUG-74029 Change-Id: I5ffea56320aef85f62f21a59df4d077b4163a65a Reviewed-by: Andy Shaw --- .../src/org/qtproject/qt5/android/QtActivityDelegate.java | 13 ++++++++++--- src/android/templates/AndroidManifest.xml | 6 ++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java index 350c6eee96..5fef1eccad 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java @@ -744,11 +744,19 @@ public class QtActivityDelegate } m_layout = new QtLayout(m_activity, startApplication); + int orientation = m_activity.getResources().getConfiguration().orientation; + try { ActivityInfo info = m_activity.getPackageManager().getActivityInfo(m_activity.getComponentName(), PackageManager.GET_META_DATA); - if (info.metaData.containsKey("android.app.splash_screen_drawable")) { + + String splashScreenKey = "android.app.splash_screen_drawable_" + + (orientation == Configuration.ORIENTATION_LANDSCAPE ? "landscape" : "portrait"); + if (!info.metaData.containsKey(splashScreenKey)) + splashScreenKey = "android.app.splash_screen_drawable"; + + if (info.metaData.containsKey(splashScreenKey)) { m_splashScreenSticky = info.metaData.containsKey("android.app.splash_screen_sticky") && info.metaData.getBoolean("android.app.splash_screen_sticky"); - int id = info.metaData.getInt("android.app.splash_screen_drawable"); + int id = info.metaData.getInt(splashScreenKey); m_splashScreen = new ImageView(m_activity); m_splashScreen.setImageDrawable(m_activity.getResources().getDrawable(id)); m_splashScreen.setScaleType(ImageView.ScaleType.FIT_XY); @@ -768,7 +776,6 @@ public class QtActivityDelegate new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); - int orientation = m_activity.getResources().getConfiguration().orientation; int rotation = m_activity.getWindowManager().getDefaultDisplay().getRotation(); boolean rot90 = (rotation == Surface.ROTATION_90 || rotation == Surface.ROTATION_270); boolean currentlyLandscape = (orientation == Configuration.ORIENTATION_LANDSCAPE); diff --git a/src/android/templates/AndroidManifest.xml b/src/android/templates/AndroidManifest.xml index cb97002560..b5b26758d9 100644 --- a/src/android/templates/AndroidManifest.xml +++ b/src/android/templates/AndroidManifest.xml @@ -52,6 +52,12 @@ + + + -- cgit v1.2.3