You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Draw the background separately from the foreground during render passes #6193
Right now, I'm inefficiently iterating over the entire dirty region twice -- once row by row x attr by attr with an AttrRowIterator, and once row by row x cell by cell with a TextBufferCellIterator.
They're the same expense, roughly, because AttrRowIterator doesn't have any affordances for getting the run length and skipping it. If it did, we could dispense with some of the complexity.
IDEALLY, I would have one function that turned out a vector of clusters and a vector of backgrounds. This would save the cost of iterating twice.
Okay, so this might be working better than my hack to manually break the run with the cursor on it. I need to add at least O(Rows+Cols) checks to painting the frame in my prototype, to check if we're on the cursor row, and the perf so far is horrifyingly bad.
If this truly doesn't double the work done for a single frame, then this seems like it might be a better solution to combine with the pre/post rendering of the cursor.
IMO the biggest advantage is that letters can slightly overflow to neighboring cells, e.g. diacritics above or below don't get cropped, bold letters don't get their right edge cut off.
Alright, I've got this down to a single function that takes each dirty region and produces...
A list of damaged backgrounds to repaint
A list of colored cluster lists to repaint
I don't like the number of vectors here, but... we're saving money by invalidating narrowly whenever possible.
Dirty Region [1..n]
- Origin (SCREEN CHAR COORDS)
- At line wrap point
- Region intersected right half of DBCS char (left trim)
- Background Run [1..n]
- Attribute
- Rect Covered (SCREEN CHAR COORDS)
- Colored Foreground Run [1..n]
- Attribute
- Columns
- Cluster [1..n]
Right now, because of some minor issues (#2661), backgrounds are attributes and actual final colors. It's not pleasant!
To fix:
reverse is occasionally (!) broken
render engines need flags to say "plz no background splitting" (vt engine needs to update drawing brushes per text run, foreground and background)
need to re-enable space optimization (if the cell is non-printing (and has no underline, etc.), no point in forwarding it to the cluster renderer!)
Activity
DHowett commentedon May 26, 2020
Hey, it works!
DHowett commentedon May 26, 2020
Right now, I'm inefficiently iterating over the entire dirty region twice -- once row by row x attr by attr with an AttrRowIterator, and once row by row x cell by cell with a TextBufferCellIterator.
They're the same expense, roughly, because AttrRowIterator doesn't have any affordances for getting the run length and skipping it. If it did, we could dispense with some of the complexity.
IDEALLY, I would have one function that turned out a vector of clusters and a vector of backgrounds. This would save the cost of iterating twice.
zadjii-msft commentedon May 26, 2020
Okay, so this might be working better than my hack to manually break the run with the cursor on it. I need to add at least O(Rows+Cols) checks to painting the frame in my prototype, to check if we're on the cursor row, and the perf so far is horrifyingly bad.
If this truly doesn't double the work done for a single frame, then this seems like it might be a better solution to combine with the pre/post rendering of the cursor.
egmontkob commentedon May 26, 2020
VTE does 2-pass rendering like this.
IMO the biggest advantage is that letters can slightly overflow to neighboring cells, e.g. diacritics above or below don't get cropped, bold letters don't get their right edge cut off.
DHowett commentedon May 27, 2020
Alright, I've got this down to a single function that takes each dirty region and produces...
I don't like the number of vectors here, but... we're saving money by invalidating narrowly whenever possible.
Right now, because of some minor issues (#2661), backgrounds are attributes and actual final colors. It's not pleasant!
To fix:
DHowett commentedon May 27, 2020
branch
2 remaining items
DHowett commentedon Jun 3, 2020
Michael's got some ideas that will be less invasive than this.
Draw the cursor underneath text, and above the background (#6337)
Draw the cursor underneath text, and above the background (#6337)
DHowett commentedon Jul 1, 2020
preliminary work: https://github.com/microsoft/terminal/tree/dev/duhowett/background-atlas
Update Fork (#1)
DHowett commentedon Jun 29, 2022
Atlas supersedes this.