Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ sha2 = "0.10"
slotmap = "1.0.6"
smallvec = { version = "1.6", features = [ "union", "const_new", "const_generics" ] }
smol = "2.0"
stacksafe = "0.1"
syn = { version = "2.0", features = [ "full", "extra-traits", "visit-mut" ] }
thiserror = "2.0.12"
tokio = { version = "1.48", default-features = false }
Expand Down
1 change: 0 additions & 1 deletion crates/gpui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ rapidhash.workspace = true
slotmap.workspace = true
smallvec.workspace = true
smol.workspace = true
stacksafe.workspace = true
taffy = { version = "0.9", default-features = false, features = [
"std",
"taffy_tree",
Expand Down
8 changes: 2 additions & 6 deletions crates/gpui/src/elements/div.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ use lucie_common::{
use lucie_style::{Display, Overflow, Style, StyleRefinement, Styled, Visibility};
use rapidhash::fast::RapidHashMap;
use smallvec::SmallVec;
use stacksafe::{StackSafe, stacksafe};

use super::ImageCacheProvider;
use crate::{
Expand Down Expand Up @@ -1052,7 +1051,7 @@ pub fn div() -> Div {
/// A [`Div`] element, the all-in-one element for building complex UIs in GPUI
pub struct Div {
interactivity: Interactivity,
children: SmallVec<[StackSafe<AnyElement>; 2]>,
children: SmallVec<[AnyElement; 2]>,
prepaint_listener: Option<Box<dyn Fn(Vec<Bounds<Pixels>>, &mut Window, &mut App) + 'static>>,
image_cache: Option<Box<dyn ImageCacheProvider>>
}
Expand Down Expand Up @@ -1096,7 +1095,7 @@ impl InteractiveElement for Div {

impl ParentElement for Div {
fn extend(&mut self, elements: impl IntoIterator<Item = AnyElement>) {
self.children.extend(elements.into_iter().map(StackSafe::new))
self.children.extend(elements.into_iter())
}
}

Expand All @@ -1108,7 +1107,6 @@ impl Element for Div {
self.interactivity.element_id.clone()
}

#[stacksafe]
fn request_layout(&mut self, global_id: Option<&GlobalElementId>, window: &mut Window, cx: &mut App) -> (LayoutId, Self::RequestLayoutState) {
let mut child_layout_ids = SmallVec::new();
let image_cache = self.image_cache.as_mut().map(|provider| provider.provide(window, cx));
Expand All @@ -1129,7 +1127,6 @@ impl Element for Div {
(layout_id, DivFrameState { child_layout_ids })
}

#[stacksafe]
fn prepaint(
&mut self,
global_id: Option<&GlobalElementId>,
Expand Down Expand Up @@ -1196,7 +1193,6 @@ impl Element for Div {
})
}

#[stacksafe]
fn paint(
&mut self,
global_id: Option<&GlobalElementId>,
Expand Down
11 changes: 2 additions & 9 deletions crates/gpui/src/taffy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use std::{fmt::Debug, ops::Range};
use lucie_common::geometry::{AbsoluteLength, Bounds, DefiniteLength, Edges, GridPlacement, Length, Pixels, Size, point, size};
use lucie_style::Style;
use rapidhash::fast::{RapidHashMap, RapidHashSet};
use stacksafe::{StackSafe, stacksafe};
use taffy::{
TaffyTree, TraversePartialTree as _,
geometry::{Point as TaffyPoint, Rect as TaffyRect, Size as TaffySize},
Expand All @@ -13,7 +12,7 @@ use taffy::{

use crate::{App, Window};

type NodeMeasureFn = StackSafe<Box<dyn FnMut(Size<Option<Pixels>>, Size<AvailableSpace>, &mut Window, &mut App) -> Size<Pixels>>>;
type NodeMeasureFn = Box<dyn FnMut(Size<Option<Pixels>>, Size<AvailableSpace>, &mut Window, &mut App) -> Size<Pixels>>;

struct NodeContext {
measure: NodeMeasureFn
Expand Down Expand Up @@ -69,12 +68,7 @@ impl TaffyLayoutEngine {
let taffy_style = style.to_taffy(rem_size, scale_factor);

self.taffy
.new_leaf_with_context(
taffy_style,
NodeContext {
measure: StackSafe::new(Box::new(measure))
}
)
.new_leaf_with_context(taffy_style, NodeContext { measure: Box::new(measure) })
.expect(EXPECT_MESSAGE)
.into()
}
Expand Down Expand Up @@ -123,7 +117,6 @@ impl TaffyLayoutEngine {
Ok(edges)
}

#[stacksafe]
pub fn compute_layout(&mut self, id: LayoutId, available_space: Size<AvailableSpace>, window: &mut Window, cx: &mut App) {
// Leaving this here until we have a better instrumentation approach.
// println!("Laying out {} children", self.count_all_children(id)?);
Expand Down
Loading