2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Add hardware acceleartion video decoding setting.

This commit is contained in:
John Preston
2022-03-30 15:20:11 +04:00
parent 27d9f78566
commit 5167eb47ae
6 changed files with 39 additions and 4 deletions

View File

@@ -582,6 +582,23 @@ void SetupAnimations(not_null<Ui::VerticalLayout*> container) {
}, container->lifetime());
}
void SetupHardwareAcceleration(not_null<Ui::VerticalLayout*> container) {
const auto settings = &Core::App().settings();
AddButton(
container,
tr::lng_settings_enable_hwaccel(),
st::settingsButtonNoIcon
)->toggleOn(
rpl::single(settings->hardwareAcceleratedVideo())
)->toggledValue(
) | rpl::filter([=](bool enabled) {
return (enabled != settings->hardwareAcceleratedVideo());
}) | rpl::start_with_next([=](bool enabled) {
settings->setHardwareAcceleratedVideo(enabled);
Core::App().saveSettingsDelayed();
}, container->lifetime());
}
#ifdef Q_OS_WIN
void SetupANGLE(
not_null<Window::SessionController*> controller,
@@ -695,6 +712,7 @@ void SetupPerformance(
not_null<Window::SessionController*> controller,
not_null<Ui::VerticalLayout*> container) {
SetupAnimations(container);
SetupHardwareAcceleration(container);
#ifdef Q_OS_WIN
SetupANGLE(controller, container);
#else // Q_OS_WIN