Mainline GPUI2 UI work (#3099)
This PR mainlines the current state of new GPUI2-based UI from the `gpui2-ui` branch. Included in this is a performance improvement to make use of the `TextLayoutCache` when calling `layout` for `Text` elements. Release Notes: - N/A --------- Co-authored-by: Nate Butler <iamnbutler@gmail.com> Co-authored-by: Antonio Scandurra <me@as-cii.com>
This commit is contained in:
parent
c46137e40d
commit
456baaa112
18 changed files with 371 additions and 19 deletions
|
@ -71,7 +71,7 @@ pub struct Window {
|
|||
pub(crate) hovered_region_ids: Vec<MouseRegionId>,
|
||||
pub(crate) clicked_region_ids: Vec<MouseRegionId>,
|
||||
pub(crate) clicked_region: Option<(MouseRegionId, MouseButton)>,
|
||||
text_layout_cache: TextLayoutCache,
|
||||
text_layout_cache: Arc<TextLayoutCache>,
|
||||
refreshing: bool,
|
||||
}
|
||||
|
||||
|
@ -107,7 +107,7 @@ impl Window {
|
|||
cursor_regions: Default::default(),
|
||||
mouse_regions: Default::default(),
|
||||
event_handlers: Default::default(),
|
||||
text_layout_cache: TextLayoutCache::new(cx.font_system.clone()),
|
||||
text_layout_cache: Arc::new(TextLayoutCache::new(cx.font_system.clone())),
|
||||
last_mouse_moved_event: None,
|
||||
last_mouse_position: Vector2F::zero(),
|
||||
pressed_buttons: Default::default(),
|
||||
|
@ -303,7 +303,7 @@ impl<'a> WindowContext<'a> {
|
|||
self.window.refreshing
|
||||
}
|
||||
|
||||
pub fn text_layout_cache(&self) -> &TextLayoutCache {
|
||||
pub fn text_layout_cache(&self) -> &Arc<TextLayoutCache> {
|
||||
&self.window.text_layout_cache
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue