mirror of
https://github.com/microsoft/terminal.git
synced 2026-04-06 14:19:45 +00:00
Compare commits
1 Commits
dev/pabhoj
...
dev/migrie
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d972b5e07a |
@@ -344,6 +344,8 @@ XtermEngine::XtermEngine(_In_ wil::unique_hfile hPipe,
|
||||
// - S_OK if we succeeded, else an appropriate HRESULT for failing to allocate or write.
|
||||
[[nodiscard]] HRESULT XtermEngine::ScrollFrame() noexcept
|
||||
{
|
||||
_trace.TraceScrollFrame(_scrollDelta);
|
||||
|
||||
if (_scrollDelta.X != 0)
|
||||
{
|
||||
// No easy way to shift left-right. Everything needs repainting.
|
||||
|
||||
@@ -121,6 +121,7 @@ CATCH_RETURN();
|
||||
_circled = true;
|
||||
}
|
||||
|
||||
_trace.TraceTriggerCircling(*pForcePaint);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,12 @@ using namespace Microsoft::Console::Types;
|
||||
_titleChanged;
|
||||
|
||||
_quickReturn = !somethingToDo;
|
||||
_trace.TraceStartPaint(_quickReturn, _invalidMap, _lastViewport.ToInclusive(), _scrollDelta, _cursorMoved);
|
||||
_trace.TraceStartPaint(_quickReturn,
|
||||
_invalidMap,
|
||||
_lastViewport.ToInclusive(),
|
||||
_scrollDelta,
|
||||
_cursorMoved,
|
||||
_wrappedRow);
|
||||
|
||||
return _quickReturn ? S_FALSE : S_OK;
|
||||
}
|
||||
@@ -458,6 +463,7 @@ using namespace Microsoft::Console::Types;
|
||||
// the cursor is still waiting on that character for the next character
|
||||
// to follow it.
|
||||
_wrappedRow = std::nullopt;
|
||||
_trace.TraceClearWrapped();
|
||||
}
|
||||
|
||||
// Move the cursor to the start of this run.
|
||||
@@ -479,6 +485,7 @@ using namespace Microsoft::Console::Types;
|
||||
lastWrittenChar > _lastViewport.RightInclusive())
|
||||
{
|
||||
_wrappedRow = coord.Y;
|
||||
_trace.TraceSetWrapped(coord.Y);
|
||||
}
|
||||
|
||||
// Update our internal tracker of the cursor's position.
|
||||
|
||||
@@ -131,7 +131,8 @@ void RenderTracing::TraceStartPaint(const bool quickReturn,
|
||||
const til::bitmap invalidMap,
|
||||
const til::rectangle lastViewport,
|
||||
const til::point scrollDelt,
|
||||
const bool cursorMoved) const
|
||||
const bool cursorMoved,
|
||||
std::optional<short> wrappedRow) const
|
||||
{
|
||||
#ifndef UNIT_TESTING
|
||||
if (TraceLoggingProviderEnabled(g_hConsoleVtRendererTraceProvider, WINEVENT_LEVEL_VERBOSE, 0))
|
||||
@@ -142,14 +143,29 @@ void RenderTracing::TraceStartPaint(const bool quickReturn,
|
||||
const auto lastView = lastViewStr.c_str();
|
||||
const auto scrollDeltaStr = scrollDelt.to_string();
|
||||
const auto scrollDelta = scrollDeltaStr.c_str();
|
||||
TraceLoggingWrite(g_hConsoleVtRendererTraceProvider,
|
||||
"VtEngine_TraceStartPaint",
|
||||
TraceLoggingBool(quickReturn),
|
||||
TraceLoggingWideString(invalidated),
|
||||
TraceLoggingWideString(lastView),
|
||||
TraceLoggingWideString(scrollDelta),
|
||||
TraceLoggingBool(cursorMoved),
|
||||
TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE));
|
||||
if (wrappedRow.has_value())
|
||||
{
|
||||
TraceLoggingWrite(g_hConsoleVtRendererTraceProvider,
|
||||
"VtEngine_TraceStartPaint",
|
||||
TraceLoggingBool(quickReturn),
|
||||
TraceLoggingWideString(invalidated),
|
||||
TraceLoggingWideString(lastView),
|
||||
TraceLoggingWideString(scrollDelta),
|
||||
TraceLoggingBool(cursorMoved),
|
||||
TraceLoggingValue(wrappedRow.value()),
|
||||
TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE));
|
||||
}
|
||||
else
|
||||
{
|
||||
TraceLoggingWrite(g_hConsoleVtRendererTraceProvider,
|
||||
"VtEngine_TraceStartPaint",
|
||||
TraceLoggingBool(quickReturn),
|
||||
TraceLoggingWideString(invalidated),
|
||||
TraceLoggingWideString(lastView),
|
||||
TraceLoggingWideString(scrollDelta),
|
||||
TraceLoggingBool(cursorMoved),
|
||||
TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE));
|
||||
}
|
||||
}
|
||||
#else
|
||||
UNREFERENCED_PARAMETER(quickReturn);
|
||||
@@ -157,6 +173,7 @@ void RenderTracing::TraceStartPaint(const bool quickReturn,
|
||||
UNREFERENCED_PARAMETER(lastViewport);
|
||||
UNREFERENCED_PARAMETER(scrollDelt);
|
||||
UNREFERENCED_PARAMETER(cursorMoved);
|
||||
UNREFERENCED_PARAMETER(wrappedRow);
|
||||
#endif UNIT_TESTING
|
||||
}
|
||||
|
||||
@@ -186,6 +203,24 @@ void RenderTracing::TraceLastText(const til::point lastTextPos) const
|
||||
UNREFERENCED_PARAMETER(lastTextPos);
|
||||
#endif UNIT_TESTING
|
||||
}
|
||||
|
||||
void RenderTracing::TraceScrollFrame(const til::point scrollDeltaPos) const
|
||||
{
|
||||
#ifndef UNIT_TESTING
|
||||
if (TraceLoggingProviderEnabled(g_hConsoleVtRendererTraceProvider, WINEVENT_LEVEL_VERBOSE, 0))
|
||||
{
|
||||
const auto scrollDeltaStr = scrollDeltaPos.to_string();
|
||||
const auto scrollDelta = scrollDeltaStr.c_str();
|
||||
TraceLoggingWrite(g_hConsoleVtRendererTraceProvider,
|
||||
"VtEngine_TraceScrollFrame",
|
||||
TraceLoggingWideString(scrollDelta),
|
||||
TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE));
|
||||
}
|
||||
#else
|
||||
UNREFERENCED_PARAMETER(scrollDeltaPos);
|
||||
#endif UNIT_TESTING
|
||||
}
|
||||
|
||||
void RenderTracing::TraceMoveCursor(const til::point lastTextPos, const til::point cursor) const
|
||||
{
|
||||
#ifndef UNIT_TESTING
|
||||
@@ -224,6 +259,36 @@ void RenderTracing::TraceWrapped() const
|
||||
#endif UNIT_TESTING
|
||||
}
|
||||
|
||||
void RenderTracing::TraceSetWrapped(const short wrappedRow) const
|
||||
{
|
||||
#ifndef UNIT_TESTING
|
||||
if (TraceLoggingProviderEnabled(g_hConsoleVtRendererTraceProvider, WINEVENT_LEVEL_VERBOSE, 0))
|
||||
{
|
||||
TraceLoggingWrite(g_hConsoleVtRendererTraceProvider,
|
||||
"VtEngine_TraceSetWrapped",
|
||||
TraceLoggingValue(wrappedRow),
|
||||
TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE));
|
||||
}
|
||||
#else
|
||||
UNREFERENCED_PARAMETER(wrappedRow);
|
||||
#endif UNIT_TESTING
|
||||
}
|
||||
|
||||
void RenderTracing::TraceClearWrapped() const
|
||||
{
|
||||
#ifndef UNIT_TESTING
|
||||
if (TraceLoggingProviderEnabled(g_hConsoleVtRendererTraceProvider, WINEVENT_LEVEL_VERBOSE, 0))
|
||||
{
|
||||
const auto* const msg = "Cleared wrap state";
|
||||
TraceLoggingWrite(g_hConsoleVtRendererTraceProvider,
|
||||
"VtEngine_TraceClearWrapped",
|
||||
TraceLoggingString(msg),
|
||||
TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE));
|
||||
}
|
||||
#else
|
||||
#endif UNIT_TESTING
|
||||
}
|
||||
|
||||
void RenderTracing::TracePaintCursor(const til::point coordCursor) const
|
||||
{
|
||||
#ifndef UNIT_TESTING
|
||||
|
||||
@@ -29,7 +29,10 @@ namespace Microsoft::Console::VirtualTerminal
|
||||
void TraceString(const std::string_view& str) const;
|
||||
void TraceInvalidate(const til::rectangle view) const;
|
||||
void TraceLastText(const til::point lastText) const;
|
||||
void TraceScrollFrame(const til::point scrollDelta) const;
|
||||
void TraceMoveCursor(const til::point lastText, const til::point cursor) const;
|
||||
void TraceSetWrapped(const short wrappedRow) const;
|
||||
void TraceClearWrapped() const;
|
||||
void TraceWrapped() const;
|
||||
void TracePaintCursor(const til::point coordCursor) const;
|
||||
void TraceInvalidateAll(const til::rectangle view) const;
|
||||
@@ -38,7 +41,8 @@ namespace Microsoft::Console::VirtualTerminal
|
||||
const til::bitmap invalidMap,
|
||||
const til::rectangle lastViewport,
|
||||
const til::point scrollDelta,
|
||||
const bool cursorMoved) const;
|
||||
const bool cursorMoved,
|
||||
std::optional<short> wrappedRow) const;
|
||||
void TraceEndPaint() const;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user