Skip to content

Commit 7970728

Browse files
committed
Merge branch 'font-families-cache' into asset-api-v2-font-families-cache
2 parents 5c119fe + 95e5e41 commit 7970728

4 files changed

Lines changed: 17 additions & 4 deletions

File tree

.github/workflows/build_cmake.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,17 +195,17 @@ jobs:
195195
- name: Build (Linux)
196196
if: runner.os == 'Linux'
197197
shell: bash --noprofile --norc -eo pipefail -x {0}
198-
run: ninja -C build -j $HOST_N_CORES -v
198+
run: ninja -C build -j $HOST_N_CORES
199199

200200
- name: Build (MSVC/Conan)
201201
if: runner.os == 'Windows' && matrix.config.environment_script != ''
202202
shell: cmd
203-
run: py Tools\qt\build-qtwebkit-conan.py --build --install --ninjaargs="-j %HOST_N_CORES% -v" || exit /b 1
203+
run: py Tools\qt\build-qtwebkit-conan.py --build --install --ninjaargs="-j %HOST_N_CORES%" || exit /b 1
204204

205205
- name: Build (macOS/Conan)
206206
if: runner.os == 'macOS'
207207
shell: bash --noprofile --norc -eo pipefail -x {0}
208-
run: Tools/qt/build-qtwebkit-conan.py --build --install --ninjaargs="-j $HOST_N_CORES -v"
208+
run: Tools/qt/build-qtwebkit-conan.py --build --install --ninjaargs="-j $HOST_N_CORES"
209209

210210
# - name: Verify (Linux)
211211
# if: runner.os == 'Linux'

Source/WebCore/platform/graphics/FontCache.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,10 @@ class FontCache : public CanMakeCheckedPtr<FontCache> {
257257
UncheckedKeyHashSet<AtomString> m_knownFamilies;
258258
#endif
259259

260+
#if PLATFORM(QT)
261+
UncheckedKeyHashMap<AtomString, bool> m_fontFamilyCache;
262+
#endif
263+
260264
#if PLATFORM(COCOA)
261265
FontDatabase m_databaseAllowingUserInstalledFonts { AllowUserInstalledFonts::Yes };
262266
FontDatabase m_databaseDisallowingUserInstalledFonts { AllowUserInstalledFonts::No };

Source/WebCore/platform/graphics/qt/FontCacheQt.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,11 @@ Ref<Font> FontCache::lastResortFallbackFont(const FontDescription& fontDescripti
9696

9797
std::unique_ptr<FontPlatformData> FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomString& family, const FontCreationContext&, OptionSet<FontLookupOptions>)
9898
{
99-
if (!QFontDatabase::hasFamily(family.string()))
99+
auto addResult = m_fontFamilyCache.ensure(family, [&family] {
100+
return QFontDatabase::hasFamily(family.string());
101+
});
102+
103+
if (!addResult.iterator->value)
100104
return nullptr;
101105
return std::make_unique<FontPlatformData>(fontDescription, family);
102106
}

Tools/QtTestBrowser/launcherwindow.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
#include <QFileInfo>
6868
#include <QMessageBox>
6969
#include <QNetworkReply>
70+
#include <QSslError>
7071
#endif
7172

7273
#if !defined(QT_NO_NETWORKDISKCACHE) && !defined(QT_NO_DESKTOPSERVICES)
@@ -107,8 +108,10 @@ LauncherWindow::LauncherWindow(WindowOptions* data, QGraphicsScene* sharedScene)
107108
createChrome();
108109
#if !defined(QT_NO_FILEDIALOG) && !defined(QT_NO_MESSAGEBOX)
109110
connect(page(), SIGNAL(downloadRequested(const QNetworkRequest&)), this, SLOT(downloadRequest(const QNetworkRequest&)));
111+
#if !defined(QT_NO_SSL)
110112
connect(page()->networkAccessManager(), SIGNAL(sslErrors(QNetworkReply*, const QList<QSslError>&)),
111113
this, SLOT(showSSLErrorConfirmation(QNetworkReply*, const QList<QSslError>&)));
114+
#endif // QT_NO_SSL
112115
#endif
113116
}
114117

@@ -1160,6 +1163,7 @@ void LauncherWindow::showUserAgentDialog()
11601163

11611164
void LauncherWindow::showSSLErrorConfirmation(QNetworkReply* reply, const QList<QSslError>& errors)
11621165
{
1166+
#ifndef QT_NO_SSL
11631167
QString errorStrings = "<ul>";
11641168
for (const QSslError& error : errors)
11651169
errorStrings += "<li>" + error.errorString() + "</li>";
@@ -1173,6 +1177,7 @@ void LauncherWindow::showSSLErrorConfirmation(QNetworkReply* reply, const QList<
11731177
sslWarningBox.setIcon(QMessageBox::Warning);
11741178
if (sslWarningBox.exec() == QMessageBox::Ignore)
11751179
reply->ignoreSslErrors();
1180+
#endif
11761181
}
11771182

11781183
void LauncherWindow::loadURLListFromFile()

0 commit comments

Comments
 (0)