Agus Zubiaga
7c46498fe8
gpui: Add split and paint APIs on LineLayout ( #60831 )
...
`ShapedLine` is nearly 3KB by value because it inlines a
`SmallVec<[DecorationRun; 32]>`. A consumer that builds wrapped lines
out of many small uniformly styled fragments only needs the shaped
glyphs plus a single decoration run it can track itself, but it ends up
moving and reallocating that mostly dead capacity constantly because
splitting and painting are only reachable through `ShapedLine`.
This moves the glyph-partitioning half of `ShapedLine::split_at` down to
a new `LineLayout::split_at`, and adds
`LineLayout::paint`/`paint_background` methods that take explicit
decoration runs. Together with the already-public `layout_line`, callers
can now hold a bare `Arc<LineLayout>` and their own decorations.
`ShapedLine::split_at` delegates to the new method and behaves the same.
## Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist )
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md )
guidelines)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
---
Release Notes:
- N/A
2026-08-19 17:40:37 +00:00
..
2026-07-31 19:57:13 +00:00
2026-06-22 09:04:29 +00:00
2026-07-31 19:57:13 +00:00
2026-08-13 17:07:06 +00:00
2026-08-18 09:57:38 +00:00
2026-08-15 00:30:00 +00:00
2026-08-18 12:40:18 +00:00
2026-06-08 14:57:47 +00:00
2026-08-18 07:00:34 +00:00
2026-08-07 10:16:57 +00:00
2026-08-18 03:44:43 +00:00
2026-08-18 10:02:20 +00:00
2026-06-05 16:49:42 +00:00
2026-08-19 14:32:19 +00:00
2026-08-19 14:32:19 +00:00
2026-06-07 16:55:18 +00:00
2026-07-27 15:59:19 +00:00
2026-08-17 09:45:39 +00:00
2026-06-01 04:40:13 +00:00
2026-07-31 19:57:13 +00:00
2026-08-09 22:29:52 +00:00
2026-06-29 20:21:46 +00:00
2026-07-18 19:56:01 +00:00
2026-08-09 22:29:52 +00:00
2026-08-19 14:07:46 +00:00
2026-07-30 14:55:00 +00:00
2026-07-15 13:14:36 +00:00
2026-07-06 22:12:33 +00:00
2026-08-18 15:06:02 +00:00
2026-08-18 12:40:18 +00:00
2026-06-05 10:32:57 +00:00
2026-08-07 10:16:57 +00:00
2026-06-05 10:32:57 +00:00
2026-05-29 07:06:57 +00:00
2026-06-15 03:26:51 +00:00
2026-08-09 22:29:52 +00:00
2026-08-05 11:17:54 +00:00
2026-08-05 13:42:28 +00:00
2026-07-30 10:34:16 +00:00
2026-07-14 21:47:47 +00:00
2026-08-09 22:29:52 +00:00
2026-04-29 10:27:47 +00:00
2026-04-24 10:29:51 +00:00
2026-05-13 23:35:10 +00:00
2026-08-18 22:41:54 +00:00
2026-08-14 09:38:52 +00:00
2026-08-09 22:29:52 +00:00
2026-07-13 16:37:28 +00:00
2026-08-09 22:29:52 +00:00
2026-08-18 15:06:02 +00:00
2026-08-14 22:42:27 +00:00
2026-08-16 21:10:59 +00:00
2026-07-18 18:48:49 +00:00
2026-07-15 13:14:36 +00:00
2026-08-07 10:16:57 +00:00
2026-08-19 15:55:24 +00:00
2026-06-05 19:24:28 +00:00
2026-07-13 16:37:28 +00:00
2026-08-09 22:29:52 +00:00
2026-08-19 16:51:32 +00:00
2026-08-19 16:26:14 +00:00
2026-07-10 11:51:16 +00:00
2026-07-14 15:02:41 +00:00
2026-08-19 16:26:14 +00:00
2026-08-08 17:20:49 +00:00
2026-08-04 15:35:05 +00:00
2026-04-18 06:34:19 +00:00
2026-05-04 06:30:47 +00:00
2026-08-19 15:04:31 +00:00
2026-08-18 05:36:16 +00:00
2026-07-30 13:24:19 +00:00
2026-07-30 12:59:16 +00:00
2026-08-18 05:36:16 +00:00
2026-08-09 22:29:52 +00:00
2026-08-19 14:52:29 +00:00
2026-08-18 10:02:20 +00:00
2026-07-29 12:49:46 +00:00
2026-08-17 08:28:00 +00:00
2026-08-19 17:40:37 +00:00
2026-08-14 19:53:25 +00:00
2026-08-19 14:32:19 +00:00
2026-08-19 14:46:01 +00:00
2026-07-08 15:52:48 +00:00
2026-08-04 15:53:09 +00:00
2026-08-14 09:35:59 +00:00
2026-06-16 13:47:55 +00:00
2026-08-12 18:44:06 +00:00
2026-08-19 14:32:19 +00:00
2026-08-06 15:02:42 +00:00
2026-08-19 14:32:19 +00:00
2026-08-19 16:26:14 +00:00
2026-08-11 15:16:03 +00:00
2026-07-14 15:29:30 +00:00
2026-08-14 15:58:14 +00:00
2026-07-31 19:57:13 +00:00
2026-08-14 16:33:25 +00:00
2026-08-18 15:06:02 +00:00
2026-06-22 18:20:57 +00:00
2026-05-05 22:41:13 +00:00
2026-06-25 17:30:12 +00:00
2026-08-07 10:16:57 +00:00
2026-08-19 16:26:14 +00:00
2026-08-19 16:26:14 +00:00
2026-08-19 16:26:14 +00:00
2026-08-17 04:27:38 +00:00
2026-08-12 03:55:10 +00:00
2026-08-19 11:07:38 +00:00
2026-08-17 04:27:38 +00:00
2026-07-23 11:22:43 +00:00
2026-08-07 10:16:57 +00:00
2026-08-19 17:27:34 +00:00
2026-07-13 16:37:28 +00:00
2026-07-03 09:50:42 +00:00
2026-08-09 22:29:52 +00:00
2026-06-29 13:24:33 +00:00
2026-07-10 15:32:21 +00:00
2026-08-09 22:29:52 +00:00
2026-08-09 13:58:30 +00:00
2026-08-19 13:07:52 +00:00
2026-08-19 13:07:52 +00:00
2026-07-21 07:58:16 +00:00
2026-08-05 20:11:33 +00:00
2026-08-18 12:40:18 +00:00
2026-06-02 12:03:05 +00:00
2026-07-21 14:51:27 +00:00
2026-08-04 11:45:33 +00:00
2026-07-29 15:16:39 +00:00
2026-05-29 07:06:57 +00:00
2026-05-14 21:03:56 +00:00
2026-06-23 09:21:31 +00:00
2026-08-07 10:16:57 +00:00
2026-08-18 03:20:44 +00:00
2026-08-19 12:16:37 +00:00
2026-08-14 22:42:27 +00:00
2026-08-17 00:54:13 +00:00
2026-08-19 11:07:38 +00:00
2026-07-17 11:41:08 +00:00
2026-08-18 12:40:18 +00:00
2026-05-12 15:52:52 +00:00
2026-08-19 12:16:37 +00:00
2026-07-15 08:33:25 +00:00
2026-08-19 15:04:31 +00:00
2026-07-14 17:18:23 +00:00
2026-08-18 07:00:34 +00:00
2026-06-13 05:21:05 +00:00
2026-08-19 15:55:24 +00:00
2026-08-18 10:02:20 +00:00
2026-08-18 12:40:18 +00:00
2026-07-23 11:22:43 +00:00
2026-06-05 19:46:05 +00:00
2026-08-18 05:36:16 +00:00
2026-07-23 22:46:06 +00:00
2026-08-07 10:16:57 +00:00
2026-07-27 18:20:35 +00:00
2026-08-18 10:02:20 +00:00
2026-08-18 10:02:20 +00:00
2026-08-12 10:44:58 +00:00
2026-08-15 19:55:10 +00:00
2026-08-11 15:16:03 +00:00
2026-05-27 10:31:53 +00:00
2026-07-16 09:41:21 +00:00
2026-08-03 11:53:30 +00:00
2026-08-18 16:55:09 +00:00
2026-07-29 20:59:24 +00:00
2026-08-19 15:55:24 +00:00
2026-07-07 11:48:14 +00:00
2026-08-18 12:40:18 +00:00
2026-08-19 11:07:38 +00:00
2026-08-10 16:42:30 +00:00
2026-06-23 09:33:47 +00:00
2026-08-18 12:40:18 +00:00
2026-05-05 16:25:56 +00:00
2026-08-18 07:00:34 +00:00
2026-07-20 11:17:43 +00:00
2026-04-29 10:27:47 +00:00
2026-07-23 04:49:39 +00:00
2026-04-24 10:29:51 +00:00
2026-08-09 22:29:52 +00:00
2026-05-27 19:33:04 +00:00
2026-08-09 22:29:52 +00:00
2026-07-20 04:08:28 +00:00
2026-05-04 06:30:47 +00:00
2026-07-31 19:57:13 +00:00
2026-08-19 01:15:44 +00:00
2026-08-18 07:58:21 +00:00
2026-07-23 11:22:43 +00:00
2026-08-18 12:40:18 +00:00
2026-08-13 14:13:12 +00:00
2026-08-12 18:14:22 +00:00
2026-08-17 00:36:13 +00:00
2026-07-29 20:59:24 +00:00
2026-06-23 09:33:47 +00:00
2026-08-16 11:41:17 +00:00
2026-05-28 19:43:30 +00:00
2026-08-19 12:16:37 +00:00
2026-08-09 22:29:52 +00:00
2026-08-16 11:41:17 +00:00
2026-07-01 04:25:40 +00:00
2026-05-29 07:06:57 +00:00
2026-06-08 14:59:39 +00:00
2026-08-19 12:16:37 +00:00
2026-08-18 16:59:08 +00:00
2026-05-27 10:31:53 +00:00
2026-06-09 12:06:49 +00:00
2026-05-01 22:33:54 +00:00
2026-08-19 12:16:37 +00:00
2026-08-18 16:59:08 +00:00
2026-05-29 16:28:27 +00:00
2026-08-19 16:01:01 +00:00
2026-08-19 16:04:12 +00:00
2026-08-09 22:29:52 +00:00
2026-07-01 15:18:54 +00:00
2026-05-28 20:19:17 +00:00
2026-05-28 20:19:17 +00:00