In the 3 charts below, "window draw" has 3 major subroutines. Request
layout, where we walk over the tree and have everything talk to the
layout engine initially. Compute layout, where we have the layout engine
actually do the layout, and then paint, where we use the computed bounds
to populate the scene.
![image_720](https://github.com/zed-industries/zed/assets/1789/d2225389-865f-4c8a-9452-9f611da64dcf)
Things are moving quickly so before/after comparisons are tough. In the
graph above, green bars are from a commit actually pre-dates a merge of
master which increased the complexity of layout. The red bars represent
the state of the world after this PR. Note how we improve the
performance of `paint`.
Improvements:
- Not moving `self` in `Element::paint`. This was moving from the heap
to the stack and imposing a big cost. This is the biggest win in this
PR.
- We got some minor wins by making the stacking order a bigger smallvec
of u8 instead of u32.
- A big win that doesn't show up in this chart is avoiding a double
render of the editor when autoscrolling by never pushing notification
effects or marking the window dirty when notifying during a window draw.
Release Notes:
- N/A
This PR fixes a warning that was present in release mode, which was
preventing the nightly builds from running:
```
error: variable does not need to be mutable
--> crates/gpui2/src/elements/div.rs:547:9
|
547 | let mut div = Div {
| ----^^^
| |
| help: remove this `mut`
|
= note: `-D unused-mut` implied by `-D warnings`
```
Release Notes:
- N/A
This PR populates the `editor_foreground` color in the various themes
and updates the editor to use this as the color for text.
The `text` field in the theme should now be used for UI elements, while
`editor_foreground` should be used for buffers.
This improves the contrast in some themes, notably Ayu Dark.
Release Notes:
- N/A
Rework gpui2 drag API so that receivers need not specify the dragged view type.
co-authored-by: Max <max@zed.dev>
co-authored-by: Conrad <conrad@zed.dev>