summaryrefslogtreecommitdiffstats
path: root/src/core/web_engine_library_info.cpp
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@theqtcompany.com>2015-07-09 14:34:50 +0200
committerKai Koehne <kai.koehne@theqtcompany.com>2015-07-14 09:28:38 +0000
commit7345ef65af262eb0b958905d7175cc836821cf25 (patch)
treea344fd1c56a8c6eb12aa77d4fc1d26e151f57eb1 /src/core/web_engine_library_info.cpp
parentc6f3565ed92d9f7fabd9403d70076a109b263065 (diff)
Add 200 percent image resources
Move out the resources intended for 100% scale factor from qtwebengine_resources.pak into a separate _100p.pak, and add also a _200p.pak. This fixes crashes and artifacts on Windows with high-DPI setups. [ChangeLog] qtwebengine_resources_100p.pak and qtwebengine_resources_200p.pak have been added alongside qtwebengine_resources.pak. Depending on the target environment either one or both have to be deployed. Task-number: QTBUG-47018 Change-Id: I1f305ada3ca4e4ae356276a59e0e92c94cca2d3f Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Diffstat (limited to 'src/core/web_engine_library_info.cpp')
-rw-r--r--src/core/web_engine_library_info.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/core/web_engine_library_info.cpp b/src/core/web_engine_library_info.cpp
index 4a12e732c..4710b0266 100644
--- a/src/core/web_engine_library_info.cpp
+++ b/src/core/web_engine_library_info.cpp
@@ -214,16 +214,26 @@ QString libraryDataPath()
}
} // namespace
+static QString pakResourcesDir()
+{
+#if defined(OS_MACOSX) && defined(QT_MAC_FRAMEWORK_BUILD)
+ static QString dir = getResourcesPath(frameworkBundle());
+#else
+ static QString dir = QLibraryInfo::location(QLibraryInfo::DataPath);
+#endif
+ return dir;
+}
+
base::FilePath WebEngineLibraryInfo::getPath(int key)
{
QString directory;
switch (key) {
case QT_RESOURCES_PAK:
-#if defined(OS_MACOSX) && defined(QT_MAC_FRAMEWORK_BUILD)
- return toFilePath(getResourcesPath(frameworkBundle()) % QLatin1String("/qtwebengine_resources.pak"));
-#else
- return toFilePath(QLibraryInfo::location(QLibraryInfo::DataPath) % QDir::separator() % QLatin1String("qtwebengine_resources.pak"));
-#endif
+ return toFilePath(pakResourcesDir() % QLatin1String("/qtwebengine_resources.pak"));
+ case QT_RESOURCES_100P_PAK:
+ return toFilePath(pakResourcesDir() % QLatin1String("/qtwebengine_resources_100p.pak"));
+ case QT_RESOURCES_200P_PAK:
+ return toFilePath(pakResourcesDir() % QLatin1String("/qtwebengine_resources_200p.pak"));
case base::FILE_EXE:
case content::CHILD_PROCESS_EXE:
return toFilePath(subProcessPath());