dx: don't check the OS version multiple times (#3480)

This commit is contained in:
Chester Liu 2019-11-09 06:14:46 +08:00 committed by Dustin L. Howett (MSFT)
parent ddcc06e911
commit c274b38dcc

View file

@ -278,7 +278,8 @@ using namespace Microsoft::Console::Render;
// First check if we want a color font and try to extract color emoji first.
// Color emoji are only available on Windows 10+
if (WI_IsFlagSet(drawingContext->options, D2D1_DRAW_TEXT_OPTIONS_ENABLE_COLOR_FONT) && IsWindows10OrGreater())
static const bool s_isWindows10OrGreater = IsWindows10OrGreater();
if (WI_IsFlagSet(drawingContext->options, D2D1_DRAW_TEXT_OPTIONS_ENABLE_COLOR_FONT) && s_isWindows10OrGreater)
{
::Microsoft::WRL::ComPtr<ID2D1DeviceContext4> d2dContext4;
RETURN_IF_FAILED(d2dContext.As(&d2dContext4));