From 24a6479e901c2049c085e4e3065fefd6a27b8bb9 Mon Sep 17 00:00:00 2001 From: Carlos Zamora Date: Mon, 15 Aug 2022 15:54:12 -0700 Subject: [PATCH 1/3] Enable AtlasEngine by default in Preview --- src/cascadia/TerminalSettingsModel/MTSMSettings.h | 2 +- src/features.xml | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/cascadia/TerminalSettingsModel/MTSMSettings.h b/src/cascadia/TerminalSettingsModel/MTSMSettings.h index d95dbdfe43e..9a2c70fec82 100644 --- a/src/cascadia/TerminalSettingsModel/MTSMSettings.h +++ b/src/cascadia/TerminalSettingsModel/MTSMSettings.h @@ -77,7 +77,7 @@ Author(s): X(CloseOnExitMode, CloseOnExit, "closeOnExit", CloseOnExitMode::Automatic) \ X(hstring, TabTitle, "tabTitle") \ X(Model::BellStyle, BellStyle, "bellStyle", BellStyle::Audible) \ - X(bool, UseAtlasEngine, "experimental.useAtlasEngine", false) \ + X(bool, UseAtlasEngine, "experimental.useAtlasEngine", Feature_AtlasEngineByDefault::IsEnabled()) \ X(Windows::Foundation::Collections::IVector, BellSound, "bellSound", nullptr) \ X(bool, Elevate, "elevate", false) \ X(bool, VtPassthrough, "experimental.connection.passthroughMode", false) \ diff --git a/src/features.xml b/src/features.xml index 6e5dc85dfef..584b741f7b9 100644 --- a/src/features.xml +++ b/src/features.xml @@ -125,4 +125,15 @@ + + Feature_AtlasEngineByDefault + Enables the atlas rendering engine on profiles by default. + AlwaysDisabled + + + Dev + Preview + + + From 4d625641741ad4cc608ca573754c092bbad31143 Mon Sep 17 00:00:00 2001 From: Carlos Zamora Date: Tue, 16 Aug 2022 10:55:07 -0700 Subject: [PATCH 2/3] reuse old flag; remove gating --- src/cascadia/TerminalControl/ControlCore.cpp | 2 +- src/cascadia/TerminalControl/TermControl.cpp | 2 +- .../TerminalSettingsEditor/ProfileViewModel.cpp | 5 ----- .../TerminalSettingsEditor/ProfileViewModel.h | 1 - .../TerminalSettingsEditor/ProfileViewModel.idl | 1 - .../TerminalSettingsEditor/Profiles_Advanced.xaml | 3 +-- src/cascadia/TerminalSettingsModel/MTSMSettings.h | 2 +- src/features.xml | 13 +------------ src/interactivity/win32/window.cpp | 9 --------- src/interactivity/win32/window.hpp | 2 -- 10 files changed, 5 insertions(+), 35 deletions(-) diff --git a/src/cascadia/TerminalControl/ControlCore.cpp b/src/cascadia/TerminalControl/ControlCore.cpp index 2ed9f2d7efe..60776282cd8 100644 --- a/src/cascadia/TerminalControl/ControlCore.cpp +++ b/src/cascadia/TerminalControl/ControlCore.cpp @@ -256,7 +256,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation return false; } - if (Feature_AtlasEngine::IsEnabled() && _settings->UseAtlasEngine()) + if (_settings->UseAtlasEngine()) { _renderEngine = std::make_unique<::Microsoft::Console::Render::AtlasEngine>(); } diff --git a/src/cascadia/TerminalControl/TermControl.cpp b/src/cascadia/TerminalControl/TermControl.cpp index b3e7fd1e26d..db46f122c29 100644 --- a/src/cascadia/TerminalControl/TermControl.cpp +++ b/src/cascadia/TerminalControl/TermControl.cpp @@ -2087,7 +2087,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation // GH#10211 - UNDER NO CIRCUMSTANCE should this fail. If it does, the // whole app will crash instantaneously on launch, which is no good. double scale; - if (Feature_AtlasEngine::IsEnabled() && settings.UseAtlasEngine()) + if (settings.UseAtlasEngine()) { auto engine = std::make_unique<::Microsoft::Console::Render::AtlasEngine>(); LOG_IF_FAILED(engine->UpdateDpi(dpi)); diff --git a/src/cascadia/TerminalSettingsEditor/ProfileViewModel.cpp b/src/cascadia/TerminalSettingsEditor/ProfileViewModel.cpp index f733626b465..fadf3d0a6b6 100644 --- a/src/cascadia/TerminalSettingsEditor/ProfileViewModel.cpp +++ b/src/cascadia/TerminalSettingsEditor/ProfileViewModel.cpp @@ -293,11 +293,6 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation return _unfocusedAppearanceViewModel; } - bool ProfileViewModel::AtlasEngineAvailable() const noexcept - { - return Feature_AtlasEngine::IsEnabled(); - } - bool ProfileViewModel::VtPassthroughAvailable() const noexcept { return Feature_VtPassthroughMode::IsEnabled() && Feature_VtPassthroughModeSettingInUI::IsEnabled(); diff --git a/src/cascadia/TerminalSettingsEditor/ProfileViewModel.h b/src/cascadia/TerminalSettingsEditor/ProfileViewModel.h index a4bc0f22bcb..1b61c7062c7 100644 --- a/src/cascadia/TerminalSettingsEditor/ProfileViewModel.h +++ b/src/cascadia/TerminalSettingsEditor/ProfileViewModel.h @@ -72,7 +72,6 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation bool ShowUnfocusedAppearance(); void CreateUnfocusedAppearance(); void DeleteUnfocusedAppearance(); - bool AtlasEngineAvailable() const noexcept; bool VtPassthroughAvailable() const noexcept; VIEW_MODEL_OBSERVABLE_PROPERTY(ProfileSubPage, CurrentPage); diff --git a/src/cascadia/TerminalSettingsEditor/ProfileViewModel.idl b/src/cascadia/TerminalSettingsEditor/ProfileViewModel.idl index b05b76317a0..143fa3ca477 100644 --- a/src/cascadia/TerminalSettingsEditor/ProfileViewModel.idl +++ b/src/cascadia/TerminalSettingsEditor/ProfileViewModel.idl @@ -62,7 +62,6 @@ namespace Microsoft.Terminal.Settings.Editor Boolean EditableUnfocusedAppearance { get; }; Boolean ShowUnfocusedAppearance { get; }; AppearanceViewModel UnfocusedAppearance { get; }; - Boolean AtlasEngineAvailable { get; }; Boolean VtPassthroughAvailable { get; }; void CreateUnfocusedAppearance(); diff --git a/src/cascadia/TerminalSettingsEditor/Profiles_Advanced.xaml b/src/cascadia/TerminalSettingsEditor/Profiles_Advanced.xaml index 8b1cbea41bd..b17296fe0ae 100644 --- a/src/cascadia/TerminalSettingsEditor/Profiles_Advanced.xaml +++ b/src/cascadia/TerminalSettingsEditor/Profiles_Advanced.xaml @@ -122,8 +122,7 @@ + SettingOverrideSource="{x:Bind Profile.UseAtlasEngineOverrideSource, Mode=OneWay}"> diff --git a/src/cascadia/TerminalSettingsModel/MTSMSettings.h b/src/cascadia/TerminalSettingsModel/MTSMSettings.h index 9a2c70fec82..b6dcf7e37c6 100644 --- a/src/cascadia/TerminalSettingsModel/MTSMSettings.h +++ b/src/cascadia/TerminalSettingsModel/MTSMSettings.h @@ -77,7 +77,7 @@ Author(s): X(CloseOnExitMode, CloseOnExit, "closeOnExit", CloseOnExitMode::Automatic) \ X(hstring, TabTitle, "tabTitle") \ X(Model::BellStyle, BellStyle, "bellStyle", BellStyle::Audible) \ - X(bool, UseAtlasEngine, "experimental.useAtlasEngine", Feature_AtlasEngineByDefault::IsEnabled()) \ + X(bool, UseAtlasEngine, "experimental.useAtlasEngine", Feature_AtlasEngine::IsEnabled()) \ X(Windows::Foundation::Collections::IVector, BellSound, "bellSound", nullptr) \ X(bool, Elevate, "elevate", false) \ X(bool, VtPassthrough, "experimental.connection.passthroughMode", false) \ diff --git a/src/features.xml b/src/features.xml index 584b741f7b9..aa870b9487b 100644 --- a/src/features.xml +++ b/src/features.xml @@ -59,7 +59,7 @@ Feature_AtlasEngine - If enabled, AtlasEngine and the experimental.useAtlasEngine setting are compiled into the project + If enabled, AtlasEngine is used by default AlwaysEnabled Release @@ -125,15 +125,4 @@ - - Feature_AtlasEngineByDefault - Enables the atlas rendering engine on profiles by default. - AlwaysDisabled - - - Dev - Preview - - - diff --git a/src/interactivity/win32/window.cpp b/src/interactivity/win32/window.cpp index 7a8aad419a2..0fb04c64948 100644 --- a/src/interactivity/win32/window.cpp +++ b/src/interactivity/win32/window.cpp @@ -25,10 +25,7 @@ #include "../../renderer/base/renderer.hpp" #include "../../renderer/gdi/gdirenderer.hpp" - -#if TIL_FEATURE_ATLASENGINE_ENABLED #include "../../renderer/atlas/AtlasEngine.h" -#endif #if TIL_FEATURE_CONHOSTDXENGINE_ENABLED #include "../../renderer/dx/DxRenderer.hpp" #endif @@ -74,10 +71,8 @@ Window::~Window() #if TIL_FEATURE_CONHOSTDXENGINE_ENABLED delete pDxEngine; #endif -#if TIL_FEATURE_ATLASENGINE_ENABLED delete pAtlasEngine; #endif -#endif } // Routine Description: @@ -231,12 +226,10 @@ void Window::_UpdateSystemMetrics() const g.pRender->AddRenderEngine(pDxEngine); break; #endif -#if TIL_FEATURE_ATLASENGINE_ENABLED case UseDx::AtlasEngine: pAtlasEngine = new AtlasEngine(); g.pRender->AddRenderEngine(pAtlasEngine); break; -#endif default: pGdiEngine = new GdiEngine(); g.pRender->AddRenderEngine(pGdiEngine); @@ -344,13 +337,11 @@ void Window::_UpdateSystemMetrics() const } else #endif -#if TIL_FEATURE_ATLASENGINE_ENABLED if (pAtlasEngine) { status = NTSTATUS_FROM_WIN32(HRESULT_CODE((pAtlasEngine->SetHwnd(hWnd)))); } else -#endif { status = NTSTATUS_FROM_WIN32(HRESULT_CODE((pGdiEngine->SetHwnd(hWnd)))); } diff --git a/src/interactivity/win32/window.hpp b/src/interactivity/win32/window.hpp index ba00662cd1a..881a2771cc0 100644 --- a/src/interactivity/win32/window.hpp +++ b/src/interactivity/win32/window.hpp @@ -116,9 +116,7 @@ namespace Microsoft::Console::Interactivity::Win32 #if TIL_FEATURE_CONHOSTDXENGINE_ENABLED Render::DxEngine* pDxEngine = nullptr; #endif -#if TIL_FEATURE_ATLASENGINE_ENABLED Render::AtlasEngine* pAtlasEngine = nullptr; -#endif [[nodiscard]] NTSTATUS _InternalSetWindowSize(); void _UpdateWindowSize(const til::size sizeNew); From caf3f035ff1dab6d30a9ae3eeb9c94b7fa57648a Mon Sep 17 00:00:00 2001 From: Carlos Zamora Date: Tue, 16 Aug 2022 11:20:32 -0700 Subject: [PATCH 3/3] add ConhostAtlasEngine flag --- src/features.xml | 10 ++++++++++ src/interactivity/win32/window.cpp | 9 +++++++++ src/interactivity/win32/window.hpp | 2 ++ 3 files changed, 21 insertions(+) diff --git a/src/features.xml b/src/features.xml index aa870b9487b..beab19b0f2d 100644 --- a/src/features.xml +++ b/src/features.xml @@ -34,6 +34,16 @@ WindowsInbox + + + Feature_ConhostAtlasEngine + Controls whether conhost supports the Atlas engine + AlwaysEnabled + + WindowsInbox + + + Feature_DxEngineShaderSupport Controls whether the DX engine is built with shader support. diff --git a/src/interactivity/win32/window.cpp b/src/interactivity/win32/window.cpp index 0fb04c64948..ca2300e4ced 100644 --- a/src/interactivity/win32/window.cpp +++ b/src/interactivity/win32/window.cpp @@ -25,7 +25,10 @@ #include "../../renderer/base/renderer.hpp" #include "../../renderer/gdi/gdirenderer.hpp" + +#if TIL_FEATURE_CONHOSTATLASENGINE_ENABLED #include "../../renderer/atlas/AtlasEngine.h" +#endif #if TIL_FEATURE_CONHOSTDXENGINE_ENABLED #include "../../renderer/dx/DxRenderer.hpp" #endif @@ -71,8 +74,10 @@ Window::~Window() #if TIL_FEATURE_CONHOSTDXENGINE_ENABLED delete pDxEngine; #endif +#if TIL_FEATURE_CONHOSTATLASENGINE_ENABLED delete pAtlasEngine; #endif +#endif } // Routine Description: @@ -226,10 +231,12 @@ void Window::_UpdateSystemMetrics() const g.pRender->AddRenderEngine(pDxEngine); break; #endif +#if TIL_FEATURE_CONHOSTATLASENGINE_ENABLED case UseDx::AtlasEngine: pAtlasEngine = new AtlasEngine(); g.pRender->AddRenderEngine(pAtlasEngine); break; +#endif default: pGdiEngine = new GdiEngine(); g.pRender->AddRenderEngine(pGdiEngine); @@ -337,12 +344,14 @@ void Window::_UpdateSystemMetrics() const } else #endif +#if TIL_FEATURE_CONHOSTATLASENGINE_ENABLED if (pAtlasEngine) { status = NTSTATUS_FROM_WIN32(HRESULT_CODE((pAtlasEngine->SetHwnd(hWnd)))); } else { +#endif status = NTSTATUS_FROM_WIN32(HRESULT_CODE((pGdiEngine->SetHwnd(hWnd)))); } diff --git a/src/interactivity/win32/window.hpp b/src/interactivity/win32/window.hpp index 881a2771cc0..c7a53aa74cf 100644 --- a/src/interactivity/win32/window.hpp +++ b/src/interactivity/win32/window.hpp @@ -116,7 +116,9 @@ namespace Microsoft::Console::Interactivity::Win32 #if TIL_FEATURE_CONHOSTDXENGINE_ENABLED Render::DxEngine* pDxEngine = nullptr; #endif +#if TIL_FEATURE_CONHOSTATLASENGINE_ENABLED Render::AtlasEngine* pAtlasEngine = nullptr; +#endif [[nodiscard]] NTSTATUS _InternalSetWindowSize(); void _UpdateWindowSize(const til::size sizeNew);