From 52f3164d2fef7a8f757fead7fcda004ad094dc30 Mon Sep 17 00:00:00 2001 From: James Holderness Date: Tue, 16 Jun 2020 10:55:17 +0100 Subject: [PATCH] Update the BGFX and WDDM render engines to use the new interface. --- src/interactivity/onecore/BgfxEngine.cpp | 8 +++----- src/interactivity/onecore/BgfxEngine.hpp | 6 ++---- src/renderer/wddmcon/WddmConRenderer.cpp | 8 +++----- src/renderer/wddmcon/WddmConRenderer.hpp | 6 ++---- 4 files changed, 10 insertions(+), 18 deletions(-) diff --git a/src/interactivity/onecore/BgfxEngine.cpp b/src/interactivity/onecore/BgfxEngine.cpp index 715ebd31f5dd..8480540a65f2 100644 --- a/src/interactivity/onecore/BgfxEngine.cpp +++ b/src/interactivity/onecore/BgfxEngine.cpp @@ -194,13 +194,11 @@ BgfxEngine::BgfxEngine(PVOID SharedViewBase, LONG DisplayHeight, LONG DisplayWid return HRESULT_FROM_NT(Status); } -[[nodiscard]] HRESULT BgfxEngine::UpdateDrawingBrushes(COLORREF const /*colorForeground*/, - COLORREF const /*colorBackground*/, - const WORD legacyColorAttribute, - const ExtendedAttributes /*extendedAttrs*/, +[[nodiscard]] HRESULT BgfxEngine::UpdateDrawingBrushes(const TextAttribute& textAttributes, + const gsl::not_null /*pData*/, bool const /*isSettingDefaultBrushes*/) noexcept { - _currentLegacyColorAttribute = legacyColorAttribute; + _currentLegacyColorAttribute = textAttributes.GetLegacyAttributes(); return S_OK; } diff --git a/src/interactivity/onecore/BgfxEngine.hpp b/src/interactivity/onecore/BgfxEngine.hpp index d2fc5488bbf6..d68be91470ce 100644 --- a/src/interactivity/onecore/BgfxEngine.hpp +++ b/src/interactivity/onecore/BgfxEngine.hpp @@ -58,10 +58,8 @@ namespace Microsoft::Console::Render [[nodiscard]] HRESULT PaintCursor(const CursorOptions& options) noexcept override; - [[nodiscard]] HRESULT UpdateDrawingBrushes(COLORREF const colorForeground, - COLORREF const colorBackground, - const WORD legacyColorAttribute, - const ExtendedAttributes extendedAttrs, + [[nodiscard]] HRESULT UpdateDrawingBrushes(const TextAttribute& textAttributes, + const gsl::not_null pData, bool const isSettingDefaultBrushes) noexcept override; [[nodiscard]] HRESULT UpdateFont(const FontInfoDesired& fiFontInfoDesired, FontInfo& fiFontInfo) noexcept override; [[nodiscard]] HRESULT UpdateDpi(int const iDpi) noexcept override; diff --git a/src/renderer/wddmcon/WddmConRenderer.cpp b/src/renderer/wddmcon/WddmConRenderer.cpp index d2d1890581b9..77409bb6b03e 100644 --- a/src/renderer/wddmcon/WddmConRenderer.cpp +++ b/src/renderer/wddmcon/WddmConRenderer.cpp @@ -305,13 +305,11 @@ bool WddmConEngine::IsInitialized() return S_OK; } -[[nodiscard]] HRESULT WddmConEngine::UpdateDrawingBrushes(COLORREF const /*colorForeground*/, - COLORREF const /*colorBackground*/, - const WORD legacyColorAttribute, - const ExtendedAttributes /*extendedAttrs*/, +[[nodiscard]] HRESULT WddmConEngine::UpdateDrawingBrushes(const TextAttribute& textAttributes, + const gsl::not_null /*pData*/, bool const /*isSettingDefaultBrushes*/) noexcept { - _currentLegacyColorAttribute = legacyColorAttribute; + _currentLegacyColorAttribute = textAttributes.GetLegacyAttributes(); return S_OK; } diff --git a/src/renderer/wddmcon/WddmConRenderer.hpp b/src/renderer/wddmcon/WddmConRenderer.hpp index ad137131c77a..e4acac3fc96f 100644 --- a/src/renderer/wddmcon/WddmConRenderer.hpp +++ b/src/renderer/wddmcon/WddmConRenderer.hpp @@ -50,10 +50,8 @@ namespace Microsoft::Console::Render [[nodiscard]] HRESULT PaintCursor(const CursorOptions& options) noexcept override; - [[nodiscard]] HRESULT UpdateDrawingBrushes(COLORREF const colorForeground, - COLORREF const colorBackground, - const WORD legacyColorAttribute, - const ExtendedAttributes extendedAttrs, + [[nodiscard]] HRESULT UpdateDrawingBrushes(const TextAttribute& textAttributes, + const gsl::not_null pData, bool const isSettingDefaultBrushes) noexcept override; [[nodiscard]] HRESULT UpdateFont(const FontInfoDesired& fiFontInfoDesired, FontInfo& fiFontInfo) noexcept override; [[nodiscard]] HRESULT UpdateDpi(int const iDpi) noexcept override;