gpui: Improve path rendering & global multisample anti-aliasing (#29718)

Currently, the rendering path required creating a texture for each path,
which wasted a large amount of video memory. In our application, simply
drawing some charts resulted in video memory usage as high as 5G.

I removed the step of creating path textures and directly drew the paths
on the rendering target, adding post-processing global multi-sampling
anti-aliasing. Drawing paths no longer requires allocating any
additional video memory and also improves the performance of path
rendering.

Release Notes:

- N/A

---------

Co-authored-by: Jason Lee <huacnlee@gmail.com>
This commit is contained in:
Sunli 2025-07-03 00:41:42 +08:00 committed by GitHub
parent 9dc3ac9657
commit 4fdda8d5a1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 486 additions and 726 deletions

View file

@ -2633,7 +2633,7 @@ impl Window {
path.color = color.opacity(opacity);
self.next_frame
.scene
.insert_primitive(path.scale(scale_factor));
.insert_primitive(path.apply_scale(scale_factor));
}
/// Paint an underline into the scene for the next frame at the current z-index.