Skip to content

Commit

Permalink
Merge branch 'main' into dev/migrie/f/sui-panes
Browse files Browse the repository at this point in the history
  • Loading branch information
zadjii-msft committed Mar 29, 2024
2 parents ef560bf + 75dea24 commit e05b2bb
Show file tree
Hide file tree
Showing 191 changed files with 2,583 additions and 3,143 deletions.
3 changes: 3 additions & 0 deletions .github/actions/spelling/expect/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,7 @@ FECF
FEEF
fesb
FFAF
ffd
FFDE
FFFDb
fgbg
Expand Down Expand Up @@ -757,6 +758,7 @@ hdr
HDROP
hdrstop
HEIGHTSCROLL
hfind
hfont
hfontresource
hglobal
Expand Down Expand Up @@ -1155,6 +1157,7 @@ NOCONTEXTHELP
NOCOPYBITS
NODUP
noexcepts
NOFONT
NOINTEGRALHEIGHT
NOINTERFACE
NOLINKINFO
Expand Down
20 changes: 12 additions & 8 deletions doc/cascadia/profiles.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2332,12 +2332,20 @@
},
"type": "array"
},
"experimental.rendering.forceFullRepaint": {
"description": "When set to true, we will redraw the entire screen each frame. When set to false, we will render only the updates to the screen between frames.",
"rendering.graphicsAPI": {
"description": "Direct3D 11 provides a more performant and feature-rich experience, whereas Direct2D is more stable. The default option \"Automatic\" will pick the API that best fits your graphics hardware. If you experience significant issues, consider using Direct2D.",
"type": "string",
"enum": [
"direct2d",
"direct3d11"
]
},
"rendering.disablePartialInvalidation": {
"description": "By default, the text renderer uses a FLIP_SEQUENTIAL Swap Chain and declares dirty rectangles via the Present1 API. When this setting is enabled, a FLIP_DISCARD Swap Chain will be used instead, and no dirty rectangles will be declared. Whether one or the other is better depends on your hardware and various other factors.",
"type": "boolean"
},
"experimental.rendering.software": {
"description": "When set to true, we will use the software renderer (a.k.a. WARP) instead of the hardware one.",
"rendering.software": {
"description": "When enabled, the terminal will use a software rasterizer (WARP). This setting should be left disabled under almost all circumstances.",
"type": "boolean"
},
"experimental.input.forceVT": {
Expand Down Expand Up @@ -2769,10 +2777,6 @@
"description": "When set to true, prompts will automatically be marked.",
"type": "boolean"
},
"experimental.connection.passthroughMode": {
"description": "When set to true, directs the PTY for this connection to use pass-through mode instead of the original Conhost PTY simulation engine. This is an experimental feature, and its continued existence is not guaranteed.",
"type": "boolean"
},
"experimental.retroTerminalEffect": {
"description": "When set to true, enable retro terminal effects. This is an experimental feature, and its continued existence is not guaranteed.",
"type": "boolean"
Expand Down
21 changes: 7 additions & 14 deletions src/buffer/out/TextColor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ bool TextColor::CanBeBrightened() const noexcept
return IsIndex16() || IsDefault();
}

ColorType TextColor::GetType() const noexcept
{
return _meta;
}

bool TextColor::IsLegacy() const noexcept
{
return (IsIndex16() || IsIndex256()) && _index < 16;
Expand Down Expand Up @@ -202,7 +207,7 @@ COLORREF TextColor::GetColor(const std::array<COLORREF, TextColor::TABLE_SIZE>&
// the result will be something like 0b00100000.
// 5. Use BitScanForward (bsf) to find the index of the most significant 1 bit.
const auto haystack = _mm256_loadu_si256(reinterpret_cast<const __m256i*>(colorTable.data())); // 1.
const auto needle = _mm256_set1_epi32(til::bit_cast<int>(defaultColor)); // 2.
const auto needle = _mm256_set1_epi32(std::bit_cast<int>(defaultColor)); // 2.
const auto result = _mm256_cmpeq_epi32(haystack, needle); // 3.
const auto mask = _mm256_movemask_ps(_mm256_castsi256_ps(result)); // 4.
unsigned long index;
Expand All @@ -219,7 +224,7 @@ COLORREF TextColor::GetColor(const std::array<COLORREF, TextColor::TABLE_SIZE>&
// --> the index returned by _BitScanForward must be divided by 2.
const auto haystack1 = _mm_loadu_si128(reinterpret_cast<const __m128i*>(colorTable.data() + 0));
const auto haystack2 = _mm_loadu_si128(reinterpret_cast<const __m128i*>(colorTable.data() + 4));
const auto needle = _mm_set1_epi32(til::bit_cast<int>(defaultColor));
const auto needle = _mm_set1_epi32(std::bit_cast<int>(defaultColor));
const auto result1 = _mm_cmpeq_epi32(haystack1, needle);
const auto result2 = _mm_cmpeq_epi32(haystack2, needle);
const auto result = _mm_packs_epi32(result1, result2); // 3.5
Expand Down Expand Up @@ -280,15 +285,3 @@ BYTE TextColor::GetLegacyIndex(const BYTE defaultIndex) const noexcept
return til::at(CompressedRgbToIndex16, compressedRgb);
}
}

// Method Description:
// - Return a COLORREF containing our stored value. Will return garbage if this
//attribute is not a RGB attribute.
// Arguments:
// - <none>
// Return Value:
// - a COLORREF containing our stored value
COLORREF TextColor::GetRGB() const noexcept
{
return RGB(_red, _green, _blue);
}
12 changes: 6 additions & 6 deletions src/buffer/out/TextColor.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ struct TextColor
}

bool CanBeBrightened() const noexcept;
ColorType GetType() const noexcept;
bool IsLegacy() const noexcept;
bool IsIndex16() const noexcept;
bool IsIndex256() const noexcept;
Expand All @@ -133,12 +134,11 @@ struct TextColor
COLORREF GetColor(const std::array<COLORREF, TABLE_SIZE>& colorTable, const size_t defaultIndex, bool brighten = false) const noexcept;
BYTE GetLegacyIndex(const BYTE defaultIndex) const noexcept;

constexpr BYTE GetIndex() const noexcept
{
return _index;
}

COLORREF GetRGB() const noexcept;
constexpr BYTE GetIndex() const noexcept { return _index; }
constexpr BYTE GetR() const noexcept { return _red; }
constexpr BYTE GetG() const noexcept { return _green; }
constexpr BYTE GetB() const noexcept { return _blue; }
constexpr COLORREF GetRGB() const noexcept { return RGB(_red, _green, _blue); }

static constexpr BYTE TransposeLegacyIndex(const size_t index)
{
Expand Down
Loading

0 comments on commit e05b2bb

Please sign in to comment.