terminal/src/host
Michael Niksa ca33d895a3
Move ConPTY to use til::bitmap (#5024)
## Summary of the Pull Request
Moves the ConPTY drawing mechanism (`VtRenderer`) to use the fine-grained `til::bitmap` individual-dirty-bit tracking mechanism instead of coarse-grained rectangle unions to improve drawing performance by dramatically reducing the total area redrawn.

## PR Checklist
* [x] Part of #778 and #1064 
* [x] I work here
* [x] Tests added and updated.
* [x] I'm a core contributor

## Detailed Description of the Pull Request / Additional comments
- Converted `GetDirtyArea()` interface from `IRenderEngine` to use a vector of `til::rectangle` instead of the `SMALL_RECT` to banhammer inclusive rectangles.
- `VtEngine` now holds and operates on the `til::bitmap` for invalidation regions. All invalidation operation functions that used to be embedded inside `VtEngine` are deleted in favor of using the ones in `til::bitmap`.
- Updated `VtEngine` tracing to use new `til::bitmap` on trace and the new `to_string()` methods detailed below.
- Comparison operators for `til::bitmap` and complementary tests.
- Fixed an issue where the dirty rectangle shortcut in `til::bitmap` was set to 0,0,0,0 by default which means that `|=` on it with each `set()` operation was stretching the rectangle from 0,0. Now it's a `std::optional` so it has no value after just being cleared and will build from whatever the first invalidated rectangle is. Complementary tests added.
- Optional run caching for `til::bitmap` in the `runs()` method since both VT and DX renderers will likely want to generate the set of runs at the beginning of a frame and refer to them over and over through that frame. Saves the iteration and creation and caches inside `til::bitmap` where the chance of invalidation of the underlying data is known best. It is still possible to iterate manually with `begin()` and `end()` from the outside without caching, if desired. Complementary tests added.
- WEX templates added for `til::bitmap` and used in tests.
- `translate()` method for `til::bitmap` which will slide the dirty points in the direction specified by a `til::point` and optionally back-fill the uncovered area as dirty. Complementary tests added.
- Moves all string generation for `til` types `size`, `point`, `rectangle`, and `some` into a `to_string` method on each object such that it can be used in both ETW tracing scenarios AND in the TAEF templates uniformly. Adds a similar method for `bitmap`.
- Add tagging to `_bitmap_const_iterator` such that it appears as a valid **Input Iterator** to STL collections and can be used in a `std::vector` constructor as a range. Adds and cleans up operators on this iterator to match the theoretical requirements for an **Input Iterator**. Complementary tests added.
- Add loose operators to `til` which will allow some basic math operations (+, -, *, /) between `til::size` and `til::point` and vice versa. Complementary tests added. Complementary tests added.
- Adds operators to `til::rectangle` to allow scaling with basic math operations (+, -, *) versus `til::size` and translation with basic math operations (+, -) against `til::point`. Complementary tests added.
- In-place variants of some operations added to assorted `til` objects. Complementary tests added.
- Update VT tests to compare invalidation against the new map structure instead of raw rectangles where possible.

## Validation Steps Performed
- Wrote additional til Unit Tests for all additional operators and functions added to the project to support this operation
- Updated the existing VT renderer tests
- Ran perf check
2020-03-23 15:57:54 +00:00
..
dll Unify and clean up the common build properties (#3429) 2019-11-05 14:29:11 -08:00
exe Add experimental retro terminal effects (#3468) 2019-12-12 13:44:01 +00:00
ft_host Change NULL to nullptr since they are pointers (#4960) 2020-03-20 20:35:12 +00:00
ft_integrity Fix a bunch of spelling errors across the project (#4295) 2020-02-10 20:40:01 +00:00
ft_uia Fix a bunch of spelling errors across the project (#4295) 2020-02-10 20:40:01 +00:00
lib Migrate Search module as a shared component for Terminal Search (#3279) 2019-11-14 14:36:41 -08:00
ut_host Move ConPTY to use til::bitmap (#5024) 2020-03-23 15:57:54 +00:00
ut_lib Unify and clean up the common build properties (#3429) 2019-11-05 14:29:11 -08:00
_output.cpp Fix FillConsoleOutputCharacterA crash (#4309) 2020-02-10 14:09:08 -08:00
_output.h Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
_stream.cpp Fix a bunch of spelling errors across the project (#4295) 2020-02-10 20:40:01 +00:00
_stream.h Unify UTF-8 handling using til::u8u16 & revise WriteConsoleAImpl (#4422) 2020-02-03 18:06:55 -08:00
alias.cpp Fix a bunch of spelling errors across the project (#4295) 2020-02-10 20:40:01 +00:00
alias.h add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
ApiRoutines.h add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
cmdline.cpp Replace macros with constexpr part 2 (#3416) 2019-11-04 07:37:47 -06:00
cmdline.h Remove unneeded VT-specific control character handling (#4289) 2020-01-29 19:18:46 +00:00
CommandListPopup.cpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
CommandListPopup.hpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
CommandNumberPopup.cpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
CommandNumberPopup.hpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
conapi.h Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
conareainfo.cpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
conareainfo.h add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
conattrs.cpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
conddkrefs.h add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
conhost.rcv Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
conhostv2_traceviewpp.tvpp Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
conimeinfo.cpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
conimeinfo.h Fix a bunch of spelling errors across the project (#4295) 2020-02-10 20:40:01 +00:00
conserv.h add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
ConsoleArguments.cpp Add support for "reflow"ing the Terminal buffer (#4741) 2020-03-12 17:43:37 -07:00
ConsoleArguments.hpp Add support for "reflow"ing the Terminal buffer (#4741) 2020-03-12 17:43:37 -07:00
consoleInformation.cpp Move MouseInput from TermAdapter to TermInput (#4848) 2020-03-12 22:25:43 +00:00
conv.h add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
convarea.cpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
conwinuserrefs.h add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
CopyFromCharPopup.cpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
CopyFromCharPopup.hpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
CopyToCharPopup.cpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
CopyToCharPopup.hpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
CursorBlinker.cpp Change NULL to nullptr since they are pointers (#4960) 2020-03-20 20:35:12 +00:00
CursorBlinker.hpp Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
dbcs.cpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
dbcs.h add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
directio.cpp Replace some macros with constexpr (#3362) 2019-11-01 10:33:09 -07:00
directio.h add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
dirs Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
exemain.cpp Change NULL to nullptr since they are pointers (#4960) 2020-03-20 20:35:12 +00:00
getset.cpp Add support for "reflow"ing the Terminal buffer (#4741) 2020-03-12 17:43:37 -07:00
getset.h Add support for VT100 Auto Wrap Mode (DECAWM) (#3943) 2020-02-04 00:20:21 +00:00
globals.cpp Add just the test infrastructure bits from #4354 (#4382) 2020-01-29 16:33:06 +00:00
globals.h Add just the test infrastructure bits from #4354 (#4382) 2020-01-29 16:33:06 +00:00
handle.cpp Removed using namespace directive from header files (#955) 2019-05-30 11:14:21 -07:00
handle.h Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
history.cpp Merged PR 4447792: Fix two bugs with DOSKEY 2020-03-19 18:14:52 +00:00
history.h Replace macros with constexpr part 2 (#3416) 2019-11-04 07:37:47 -06:00
host-common.vcxitems Migrate Search module as a shared component for Terminal Search (#3279) 2019-11-14 14:36:41 -08:00
IIoProvider.hpp Fix a bunch of spelling errors across the project (#4295) 2020-02-10 20:40:01 +00:00
init.cpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
init.hpp Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
input.cpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
input.h Replace macros with constexpr part 2 (#3416) 2019-11-04 07:37:47 -06:00
inputBuffer.cpp Move MouseInput from TermAdapter to TermInput (#4848) 2020-03-12 22:25:43 +00:00
inputBuffer.hpp Move MouseInput from TermAdapter to TermInput (#4848) 2020-03-12 22:25:43 +00:00
inputKeyInfo.cpp Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
inputReadHandleData.cpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
inputReadHandleData.h add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
misc.cpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
misc.h add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
ntprivapi.cpp Change NULL to nullptr since they are pointers (#4960) 2020-03-20 20:35:12 +00:00
ntprivapi.hpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
output.cpp Fix a bunch of spelling errors across the project (#4295) 2020-02-10 20:40:01 +00:00
output.h add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
outputStream.cpp Only passthrough input changes if the client's in VT input mode (#4913) 2020-03-13 15:44:17 -07:00
outputStream.hpp Only passthrough input changes if the client's in VT input mode (#4913) 2020-03-13 15:44:17 -07:00
popup.cpp Get rid of the SCREEN_INFORMATION::LineChar array (#3371) 2019-10-31 10:12:41 -05:00
popup.h Replace some macros with constexpr (#3362) 2019-11-01 10:33:09 -07:00
precomp.cpp Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
precomp.h add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
PtySignalInputThread.cpp Fix a bunch of spelling errors across the project (#4295) 2020-02-10 20:40:01 +00:00
PtySignalInputThread.hpp Revert locking changes (#3488) 2019-11-08 13:44:52 -08:00
readData.cpp Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
readData.hpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
readDataCooked.cpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
readDataCooked.hpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
readDataDirect.cpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
readDataDirect.hpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
readDataRaw.cpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
readDataRaw.hpp Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
registry.cpp Fix a bunch of spelling errors across the project (#4295) 2020-02-10 20:40:01 +00:00
registry.hpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
renderData.cpp Properly represent block selections in UIA (#4991) 2020-03-18 21:03:51 +00:00
renderData.hpp Properly represent block selections in UIA (#4991) 2020-03-18 21:03:51 +00:00
renderFontDefaults.cpp Allow FontInfo{,Base,Desired} to store a font name > 32 wch (#3107) 2019-10-14 21:23:45 -07:00
renderFontDefaults.hpp Allow FontInfo{,Base,Desired} to store a font name > 32 wch (#3107) 2019-10-14 21:23:45 -07:00
res.rc Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
resource.h add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
runft.bat Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
runtests.bat Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
runut.bat Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
ScreenBufferRenderTarget.cpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
ScreenBufferRenderTarget.hpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
screenInfo.cpp Maintain scrollbar position during a resize operation (#4903) 2020-03-16 12:55:25 +00:00
screenInfo.hpp Remove unneeded VT-specific control character handling (#4289) 2020-01-29 19:18:46 +00:00
scrolling.cpp Accessibility: Set-up UIA Tree (#1691) 2019-07-29 15:21:15 -07:00
scrolling.hpp Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
selection.cpp Move rect expansion to textbuffer; refactor selection code (#4560) 2020-02-27 16:42:26 -08:00
selection.hpp Move rect expansion to textbuffer; refactor selection code (#4560) 2020-02-27 16:42:26 -08:00
selectionInput.cpp Fix a bunch of spelling errors across the project (#4295) 2020-02-10 20:40:01 +00:00
selectionState.cpp Fix a bunch of spelling errors across the project (#4295) 2020-02-10 20:40:01 +00:00
server.h Move MouseInput from TermAdapter to TermInput (#4848) 2020-03-12 22:25:43 +00:00
settings.cpp Fix a bunch of spelling errors across the project (#4295) 2020-02-10 20:40:01 +00:00
settings.hpp Add support for the DECSCNM screen mode (#3817) 2020-01-22 22:29:50 +00:00
sources.inc Merged PR 4182306: [Git2Git] Merged PR 4182266: conhost: don't use D3DCompiler on inside-windows builds (and delete the shaders) 2020-01-23 00:42:56 +00:00
sources.test.inc Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
srvinit.cpp Change NULL to nullptr since they are pointers (#4960) 2020-03-20 20:35:12 +00:00
srvinit.h add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
stream.cpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
stream.h add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
telemetry.cpp Fix a bunch of spelling errors across the project (#4295) 2020-02-10 20:40:01 +00:00
telemetry.hpp Fix a bunch of spelling errors across the project (#4295) 2020-02-10 20:40:01 +00:00
tracing.cpp UIA: Fix GetVisibleRanges() and add Tracing (#4495) 2020-02-20 23:50:43 +00:00
tracing.hpp UIA: Fix GetVisibleRanges() and add Tracing (#4495) 2020-02-20 23:50:43 +00:00
utf8ToWideCharParser.cpp Fix a bunch of spelling errors across the project (#4295) 2020-02-10 20:40:01 +00:00
utf8ToWideCharParser.hpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
utils.cpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
utils.hpp Fix a bunch of spelling errors across the project (#4295) 2020-02-10 20:40:01 +00:00
VtInputThread.cpp Enable Passthrough for VT Input Mode in ConPty (#4856) 2020-03-10 22:07:14 +00:00
VtInputThread.hpp Unify UTF-8 handling using til::u8u16 & revise WriteConsoleAImpl (#4422) 2020-02-03 18:06:55 -08:00
VtIo.cpp Add support for "reflow"ing the Terminal buffer (#4741) 2020-03-12 17:43:37 -07:00
VtIo.hpp Add support for "reflow"ing the Terminal buffer (#4741) 2020-03-12 17:43:37 -07:00
writeData.cpp Removed using namespace directive from header files (#955) 2019-05-30 11:14:21 -07:00
writeData.hpp Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00