summaryrefslogtreecommitdiffstats
path: root/src/core
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
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')
-rw-r--r--src/core/core_module.pro4
-rw-r--r--src/core/resource_bundle_qt.cpp4
-rw-r--r--src/core/resources/repack_resources.gypi12
-rw-r--r--src/core/resources/resources.gyp50
-rw-r--r--src/core/web_engine_library_info.cpp20
-rw-r--r--src/core/web_engine_library_info.h4
6 files changed, 74 insertions, 20 deletions
diff --git a/src/core/core_module.pro b/src/core/core_module.pro
index df868949e..e6a36332f 100644
--- a/src/core/core_module.pro
+++ b/src/core/core_module.pro
@@ -27,7 +27,9 @@ LOCALE_LIST = am ar bg bn ca cs da de el en-GB en-US es-419 es et fa fi fil fr g
for(LOC, LOCALE_LIST) {
locales.files += $$REPACK_DIR/qtwebengine_locales/$${LOC}.pak
}
-resources.files = $$REPACK_DIR/qtwebengine_resources.pak
+resources.files = $$REPACK_DIR/qtwebengine_resources.pak \
+ $$REPACK_DIR/qtwebengine_resources_100p.pak \
+ $$REPACK_DIR/qtwebengine_resources_200p.pak
PLUGIN_EXTENSION = .so
PLUGIN_PREFIX = lib
diff --git a/src/core/resource_bundle_qt.cpp b/src/core/resource_bundle_qt.cpp
index 3e9c6ad43..932f40af8 100644
--- a/src/core/resource_bundle_qt.cpp
+++ b/src/core/resource_bundle_qt.cpp
@@ -44,7 +44,9 @@ namespace ui {
void ResourceBundle::LoadCommonResources()
{
// We repacked the resources we need and installed them. now let chromium mmap that file.
- AddDataPackFromPath(WebEngineLibraryInfo::getPath(QT_RESOURCES_PAK), SCALE_FACTOR_100P);
+ AddDataPackFromPath(WebEngineLibraryInfo::getPath(QT_RESOURCES_PAK), SCALE_FACTOR_NONE);
+ AddDataPackFromPath(WebEngineLibraryInfo::getPath(QT_RESOURCES_100P_PAK), SCALE_FACTOR_100P);
+ AddDataPackFromPath(WebEngineLibraryInfo::getPath(QT_RESOURCES_200P_PAK), SCALE_FACTOR_200P);
}
gfx::Image& ResourceBundle::GetNativeImageNamed(int resource_id, ImageRTL rtl)
diff --git a/src/core/resources/repack_resources.gypi b/src/core/resources/repack_resources.gypi
index b5d8c9d91..ce224e625 100644
--- a/src/core/resources/repack_resources.gypi
+++ b/src/core/resources/repack_resources.gypi
@@ -4,23 +4,13 @@
{
'variables': {
'repack_path': '<(chromium_src_dir)/tools/grit/grit/format/repack.py',
- 'pak_inputs': [
- '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.pak',
- '<(SHARED_INTERMEDIATE_DIR)/webkit/devtools_resources.pak',
- '<(SHARED_INTERMEDIATE_DIR)/content/content_resources.pak',
- '<(SHARED_INTERMEDIATE_DIR)/ui/resources/ui_resources_100_percent.pak',
- '<(SHARED_INTERMEDIATE_DIR)/blink/public/resources/blink_resources.pak',
- '<(SHARED_INTERMEDIATE_DIR)/content/app/resources/content_resources_100_percent.pak',
- '<(SHARED_INTERMEDIATE_DIR)/ui/resources/webui_resources.pak',
- '<(SHARED_INTERMEDIATE_DIR)/chrome/renderer_resources_100_percent.pak',
- ],
},
'inputs': [
'<(repack_path)',
'<@(pak_inputs)',
],
'outputs': [
- '<(SHARED_INTERMEDIATE_DIR)/repack/qtwebengine_resources.pak',
+ '<@(pak_outputs)',
],
'action': ['python', '<(repack_path)', '<@(_outputs)', '<@(pak_inputs)'],
}
diff --git a/src/core/resources/resources.gyp b/src/core/resources/resources.gyp
index 5d4d83c05..4d653df12 100644
--- a/src/core/resources/resources.gyp
+++ b/src/core/resources/resources.gyp
@@ -26,6 +26,46 @@
'actions' : [
{
'action_name': 'repack_resources',
+ 'variables': {
+ 'pak_inputs': [
+ '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.pak',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/devtools_resources.pak',
+ '<(SHARED_INTERMEDIATE_DIR)/content/content_resources.pak',
+ '<(SHARED_INTERMEDIATE_DIR)/blink/public/resources/blink_resources.pak',
+ '<(SHARED_INTERMEDIATE_DIR)/ui/resources/webui_resources.pak',
+ ],
+ 'pak_outputs': [
+ '<(SHARED_INTERMEDIATE_DIR)/repack/qtwebengine_resources.pak'
+ ]
+ },
+ 'includes': [ 'repack_resources.gypi' ],
+ },
+ {
+ 'action_name': 'repack_resources_100_percent',
+ 'variables': {
+ 'pak_inputs': [
+ '<(SHARED_INTERMEDIATE_DIR)/ui/resources/ui_resources_100_percent.pak',
+ '<(SHARED_INTERMEDIATE_DIR)/content/app/resources/content_resources_100_percent.pak',
+ '<(SHARED_INTERMEDIATE_DIR)/chrome/renderer_resources_100_percent.pak',
+ ],
+ 'pak_outputs': [
+ '<(SHARED_INTERMEDIATE_DIR)/repack/qtwebengine_resources_100p.pak'
+ ]
+ },
+ 'includes': [ 'repack_resources.gypi' ],
+ },
+ {
+ 'action_name': 'repack_resources_200_percent',
+ 'variables': {
+ 'pak_inputs': [
+ '<(SHARED_INTERMEDIATE_DIR)/ui/resources/ui_resources_200_percent.pak',
+ '<(SHARED_INTERMEDIATE_DIR)/content/app/resources/content_resources_200_percent.pak',
+ '<(SHARED_INTERMEDIATE_DIR)/chrome/renderer_resources_200_percent.pak',
+ ],
+ 'pak_outputs': [
+ '<(SHARED_INTERMEDIATE_DIR)/repack/qtwebengine_resources_200p.pak'
+ ]
+ },
'includes': [ 'repack_resources.gypi' ],
},
{
@@ -40,7 +80,15 @@
'destination': '<(qt_install_data)',
'files': [ '<(SHARED_INTERMEDIATE_DIR)/repack/qtwebengine_resources.pak' ],
},
- ],
+ {
+ 'destination': '<(qt_install_data)',
+ 'files': [ '<(SHARED_INTERMEDIATE_DIR)/repack/qtwebengine_resources_100p.pak' ],
+ },
+ {
+ 'destination': '<(qt_install_data)',
+ 'files': [ '<(SHARED_INTERMEDIATE_DIR)/repack/qtwebengine_resources_200p.pak' ],
+ },
+ ],
}],
['qt_install_translations != ""', {
'copies': [
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());
diff --git a/src/core/web_engine_library_info.h b/src/core/web_engine_library_info.h
index e85258078..cd3e5be94 100644
--- a/src/core/web_engine_library_info.h
+++ b/src/core/web_engine_library_info.h
@@ -41,7 +41,9 @@
#include "base/files/file_path.h"
#include "base/strings/string16.h"
enum {
- QT_RESOURCES_PAK = 5000
+ QT_RESOURCES_PAK = 5000,
+ QT_RESOURCES_100P_PAK = 5001,
+ QT_RESOURCES_200P_PAK = 5002
};
class WebEngineLibraryInfo {