1
mirror of https://invent.kde.org/network/falkon.git synced 2024-09-21 09:42:10 +02:00

Options to turn on hardware acceleration

This commit is contained in:
Hao Chi Kiang 2022-11-09 22:41:54 +01:00 committed by Juraj Oravec
parent c18fea707a
commit 9c1f946bad
Signed by: SGOrava
GPG Key ID: 13660A3F1D9F093B
3 changed files with 16 additions and 4 deletions

View File

@ -148,9 +148,9 @@ MainApplication::MainApplication(int &argc, char** argv)
}
#endif
QByteArray flags = qgetenv("QTWEBENGINE_CHROMIUM_FLAGS");
flags.append(" --enable-features=WebRTCPipeWireCapturer");
qputenv("QTWEBENGINE_CHROMIUM_FLAGS", flags);
QByteArray chromium_flags = qgetenv("QTWEBENGINE_CHROMIUM_FLAGS");
chromium_flags.append(" --enable-features=WebRTCPipeWireCapturer");
qputenv("QTWEBENGINE_CHROMIUM_FLAGS", chromium_flags);
QUrl startUrl;
QString startProfile;
@ -287,6 +287,10 @@ MainApplication::MainApplication(int &argc, char** argv)
profileManager.initCurrentProfile(startProfile);
Settings::createSettings(DataPaths::currentProfilePath() + QLatin1String("/settings.ini"));
if (Settings::globalSettings()->value("Web-Browser-Settings/hardwareAccel", false).toBool()) {
chromium_flags.append(" --enable-oop-rasterization --enable-gpu-rasterization --enable-native-gpu-memory-buffers --use-gl=desktop");
qputenv("QTWEBENGINE_CHROMIUM_FLAGS", chromium_flags);
}
NetworkManager::registerSchemes();

View File

@ -291,6 +291,7 @@ Preferences::Preferences(BrowserWindow* window)
ui->intPDFViewer->setChecked(settings.value("intPDFViewer", false).toBool());
ui->intPDFViewer->setEnabled(ui->allowPlugins->isChecked());
ui->screenCaptureEnabled->setChecked(settings.value("screenCaptureEnabled", false).toBool());
ui->hardwareAccel->setChecked(settings.value("hardwareAccel", false).toBool());
const auto levels = WebView::zoomLevels();
for (int level : levels) {
@ -967,7 +968,7 @@ void Preferences::saveSettings()
settings.setValue("DNSPrefetch", ui->dnsPrefetch->isChecked());
settings.setValue("intPDFViewer", ui->intPDFViewer->isChecked());
settings.setValue("screenCaptureEnabled", ui->screenCaptureEnabled->isChecked());
settings.setValue("hardwareAccel", ui->hardwareAccel->isChecked());
#ifdef Q_OS_WIN
settings.setValue("CheckDefaultBrowser", ui->checkDefaultBrowser->isChecked());
#endif

View File

@ -1096,6 +1096,13 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="hardwareAccel">
<property name="text">
<string>Use hardware acceleration (requires restart)</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="2" column="0">