Skip to content

Commit 34dced3

Browse files
Firestar99Keavon
authored andcommitted
Make gcore a std library and remove std, alloc, and more unused features (#2724)
* gcore: remove features `std`, `alloc`, `gpu` and `reflections`, now always available * gcore: remove non-working features `kurbo` and `log`
1 parent 6b69a75 commit 34dced3

File tree

25 files changed

+40
-233
lines changed

25 files changed

+40
-233
lines changed

Cargo.lock

Lines changed: 0 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

editor/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ default = ["wasm"]
1515
wasm = ["wasm-bindgen", "graphene-std/wasm", "wasm-bindgen-futures"]
1616
gpu = [
1717
"interpreted-executor/gpu",
18-
"graphene-std/gpu",
1918
"wgpu-executor",
2019
]
2120
tauri = ["ron", "decouple-execution"]

editor/src/messages/portfolio/document/node_graph/node_properties.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,13 +1161,6 @@ pub(crate) fn selective_color_properties(node_id: NodeId, context: &mut NodeProp
11611161
]
11621162
}
11631163

1164-
#[cfg(feature = "gpu")]
1165-
pub(crate) fn _gpu_map_properties(parameter_widgets_info: ParameterWidgetsInfo) -> Vec<LayoutGroup> {
1166-
let map = text_widget(parameter_widgets_info);
1167-
1168-
vec![LayoutGroup::Row { widgets: map }]
1169-
}
1170-
11711164
pub(crate) fn grid_properties(node_id: NodeId, context: &mut NodePropertiesContext) -> Vec<LayoutGroup> {
11721165
let grid_type_index = grid::GridTypeInput::INDEX;
11731166
let spacing_index = grid::SpacingInput::<f64>::INDEX;

frontend/wasm/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ editor = { path = "../../editor", package = "graphite-editor", features = [
2929
# Workspace dependencies
3030
graph-craft = { workspace = true }
3131
log = { workspace = true }
32-
graphene-core = { workspace = true, features = ["std", "alloc"] }
32+
graphene-core = { workspace = true }
3333
serde = { workspace = true, features = ["derive"] }
3434
wasm-bindgen = { workspace = true }
3535
serde-wasm-bindgen = { workspace = true }

node-graph/gcore/Cargo.toml

Lines changed: 13 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,13 @@ authors = ["Graphite Authors <[email protected]>"]
77
license = "MIT OR Apache-2.0"
88

99
[features]
10-
default = ["serde", "kurbo", "log", "std", "rand_chacha", "wasm"]
11-
log = ["dep:log"]
12-
gpu = ["spirv-std", "glam/bytemuck", "dyn-any", "glam/libm"]
10+
default = ["serde", "wasm"]
1311
nightly = []
14-
alloc = ["dyn-any", "bezier-rs"]
1512
type_id_logging = []
1613
wasm = ["web-sys"]
1714
wgpu = ["dep:wgpu"]
1815
vello = ["dep:vello", "bezier-rs/kurbo", "wgpu"]
19-
dealloc_nodes = ["reflections"]
20-
std = [
21-
"dyn-any",
22-
"dyn-any/std",
23-
"alloc",
24-
"glam/std",
25-
"specta",
26-
"num-traits/std",
27-
"rustybuzz",
28-
"image",
29-
"reflections",
30-
]
31-
reflections = ["alloc", "ctor"]
16+
dealloc_nodes = []
3217
serde = [
3318
"dep:serde",
3419
"glam/serde",
@@ -55,31 +40,30 @@ petgraph = { workspace = true, default-features = false, features = [
5540
] }
5641
rustc-hash = { workspace = true }
5742
math-parser = { path = "../../libraries/math-parser" }
43+
dyn-any = { workspace = true }
44+
ctor = { workspace = true }
45+
rand_chacha = { workspace = true }
46+
bezier-rs = { workspace = true }
47+
specta = { workspace = true }
48+
rustybuzz = { workspace = true }
49+
image = { workspace = true, default-features = false, features = [
50+
"png",
51+
] }
5852

5953
# Required dependencies
6054
half = { version = "2.4.1", default-features = false, features = ["bytemuck"] }
6155
tinyvec = { version = "1" }
56+
kurbo = { workspace = true }
57+
log = { workspace = true }
6258

6359
# Optional workspace dependencies
64-
dyn-any = { workspace = true, optional = true }
65-
spirv-std = { workspace = true, optional = true }
6660
serde = { workspace = true, optional = true, features = ["derive"] }
67-
ctor = { workspace = true, optional = true }
68-
log = { workspace = true, optional = true }
69-
rand_chacha = { workspace = true, optional = true }
70-
bezier-rs = { workspace = true, optional = true }
71-
kurbo = { workspace = true, optional = true }
7261
base64 = { workspace = true, optional = true }
7362
vello = { workspace = true, optional = true }
7463
wgpu = { workspace = true, optional = true }
75-
specta = { workspace = true, optional = true }
76-
rustybuzz = { workspace = true, optional = true }
7764
web-sys = { workspace = true, optional = true, features = [
7865
"HtmlCanvasElement",
7966
] }
80-
image = { workspace = true, optional = true, default-features = false, features = [
81-
"png",
82-
] }
8367

8468
[dev-dependencies]
8569
# Workspace dependencies

node-graph/gcore/src/application_io.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ impl Hash for SurfaceFrame {
3636
}
3737
}
3838

39-
#[cfg(feature = "dyn-any")]
4039
unsafe impl StaticType for SurfaceFrame {
4140
type Static = SurfaceFrame;
4241
}
@@ -52,8 +51,6 @@ impl Size for web_sys::HtmlCanvasElement {
5251
}
5352
}
5453

55-
// pub type TextureDataTable = Instances<ImageTexture>;
56-
5754
#[derive(Debug, Clone)]
5855
pub struct ImageTexture {
5956
#[cfg(feature = "wgpu")]
@@ -84,7 +81,6 @@ impl PartialEq for ImageTexture {
8481
}
8582
}
8683

87-
#[cfg(feature = "dyn-any")]
8884
unsafe impl StaticType for ImageTexture {
8985
type Static = ImageTexture;
9086
}
@@ -123,7 +119,6 @@ impl<S: Size> Size for SurfaceHandle<S> {
123119
}
124120
}
125121

126-
#[cfg(feature = "dyn-any")]
127122
unsafe impl<T: 'static> StaticType for SurfaceHandle<T> {
128123
type Static = SurfaceHandle<T>;
129124
}
@@ -134,7 +129,6 @@ pub struct SurfaceHandleFrame<Surface> {
134129
pub transform: DAffine2,
135130
}
136131

137-
#[cfg(feature = "dyn-any")]
138132
unsafe impl<T: 'static> StaticType for SurfaceHandleFrame<T> {
139133
type Static = SurfaceHandleFrame<T>;
140134
}
@@ -309,7 +303,6 @@ impl<T> Debug for EditorApi<T> {
309303
}
310304
}
311305

312-
#[cfg(feature = "dyn-any")]
313306
unsafe impl<T: StaticTypeSized> StaticType for EditorApi<T> {
314307
type Static = EditorApi<T::Static>;
315308
}

node-graph/gcore/src/gpu.rs

Lines changed: 0 additions & 20 deletions
This file was deleted.

node-graph/gcore/src/graphic_element.rs

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -243,38 +243,6 @@ impl GraphicElement {
243243
}
244244
}
245245

246-
// // TODO: Rename to Raster
247-
// #[derive(Clone, Debug, Hash, PartialEq, DynAny)]
248-
// pub enum RasterDataType {
249-
// /// A CPU-based bitmap image with a finite position and extent, equivalent to the SVG <image> tag: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/image
250-
// // TODO: Rename to ImageTable
251-
// RasterData(RasterDataTable<CPU>),
252-
// /// A GPU texture with a finite position and extent
253-
// // TODO: Rename to ImageTextureTable
254-
// TextureData(TextureDataTable),
255-
// }
256-
257-
// impl<'de> serde::Deserialize<'de> for RasterDataType {
258-
// fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
259-
// where
260-
// D: serde::Deserializer<'de>,
261-
// {
262-
// Ok(RasterDataType::RasterData(RasterDataTable::new(Image::deserialize(deserializer)?)))
263-
// }
264-
// }
265-
266-
// impl serde::Serialize for RasterDataType {
267-
// fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
268-
// where
269-
// S: serde::Serializer,
270-
// {
271-
// match self {
272-
// RasterDataType::RasterData(_) => self.serialize(serializer),
273-
// RasterDataType::TextureData(_) => todo!(),
274-
// }
275-
// }
276-
// }
277-
278246
impl<'de> serde::Deserialize<'de> for Raster<CPU> {
279247
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
280248
where

node-graph/gcore/src/instances.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ impl<T: PartialEq> PartialEq for Instances<T> {
142142
}
143143
}
144144

145-
#[cfg(feature = "dyn-any")]
146145
unsafe impl<T: StaticType + 'static> StaticType for Instances<T> {
147146
type Static = Instances<T>;
148147
}

0 commit comments

Comments
 (0)