Skip to content

Commit bfe8939

Browse files
committed
gcore: remove features std, alloc, gpu and reflections, now always available
1 parent 8c7b22e commit bfe8939

File tree

24 files changed

+37
-194
lines changed

24 files changed

+37
-194
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: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,14 @@ authors = ["Graphite Authors <[email protected]>"]
77
license = "MIT OR Apache-2.0"
88

99
[features]
10-
default = ["serde", "kurbo", "log", "std", "rand_chacha", "wasm"]
10+
default = ["serde", "kurbo", "log", "wasm"]
1111
log = ["dep:log"]
12-
gpu = ["spirv-std", "glam/bytemuck", "dyn-any", "glam/libm"]
1312
nightly = []
14-
alloc = ["dyn-any", "bezier-rs"]
1513
type_id_logging = []
1614
wasm = ["web-sys"]
1715
wgpu = ["dep:wgpu"]
1816
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"]
17+
dealloc_nodes = []
3218
serde = [
3319
"dep:serde",
3420
"glam/serde",
@@ -55,31 +41,30 @@ petgraph = { workspace = true, default-features = false, features = [
5541
] }
5642
rustc-hash = { workspace = true }
5743
math-parser = { path = "../../libraries/math-parser" }
44+
dyn-any = { workspace = true }
45+
ctor = { workspace = true }
46+
rand_chacha = { workspace = true }
47+
bezier-rs = { workspace = true }
48+
specta = { workspace = true }
49+
rustybuzz = { workspace = true }
50+
image = { workspace = true, default-features = false, features = [
51+
"png",
52+
] }
5853

5954
# Required dependencies
6055
half = { version = "2.4.1", default-features = false, features = ["bytemuck"] }
6156
tinyvec = { version = "1" }
6257

6358
# Optional workspace dependencies
64-
dyn-any = { workspace = true, optional = true }
65-
spirv-std = { workspace = true, optional = true }
6659
serde = { workspace = true, optional = true, features = ["derive"] }
67-
ctor = { workspace = true, optional = true }
6860
log = { workspace = true, optional = true }
69-
rand_chacha = { workspace = true, optional = true }
70-
bezier-rs = { workspace = true, optional = true }
7161
kurbo = { workspace = true, optional = true }
7262
base64 = { workspace = true, optional = true }
7363
vello = { workspace = true, optional = true }
7464
wgpu = { workspace = true, optional = true }
75-
specta = { workspace = true, optional = true }
76-
rustybuzz = { workspace = true, optional = true }
7765
web-sys = { workspace = true, optional = true, features = [
7866
"HtmlCanvasElement",
7967
] }
80-
image = { workspace = true, optional = true, default-features = false, features = [
81-
"png",
82-
] }
8368

8469
[dev-dependencies]
8570
# Workspace dependencies

node-graph/gcore/src/application_io.rs

Lines changed: 0 additions & 5 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
}
@@ -82,7 +81,6 @@ impl PartialEq for ImageTexture {
8281
}
8382
}
8483

85-
#[cfg(feature = "dyn-any")]
8684
unsafe impl StaticType for ImageTexture {
8785
type Static = ImageTexture;
8886
}
@@ -121,7 +119,6 @@ impl<S: Size> Size for SurfaceHandle<S> {
121119
}
122120
}
123121

124-
#[cfg(feature = "dyn-any")]
125122
unsafe impl<T: 'static> StaticType for SurfaceHandle<T> {
126123
type Static = SurfaceHandle<T>;
127124
}
@@ -132,7 +129,6 @@ pub struct SurfaceHandleFrame<Surface> {
132129
pub transform: DAffine2,
133130
}
134131

135-
#[cfg(feature = "dyn-any")]
136132
unsafe impl<T: 'static> StaticType for SurfaceHandleFrame<T> {
137133
type Static = SurfaceHandleFrame<T>;
138134
}
@@ -307,7 +303,6 @@ impl<T> Debug for EditorApi<T> {
307303
}
308304
}
309305

310-
#[cfg(feature = "dyn-any")]
311306
unsafe impl<T: StaticTypeSized> StaticType for EditorApi<T> {
312307
type Static = EditorApi<T::Static>;
313308
}

node-graph/gcore/src/gpu.rs

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

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
}

node-graph/gcore/src/lib.rs

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
1-
#![cfg_attr(not(feature = "std"), no_std)]
2-
3-
#[cfg(feature = "alloc")]
41
extern crate alloc;
5-
#[cfg(feature = "alloc")]
6-
use core::future::Future;
72

83
#[cfg_attr(feature = "log", macro_use)]
94
#[cfg(feature = "log")]
105
extern crate log;
116
pub use crate as graphene_core;
127
pub use num_traits;
138

14-
#[cfg(feature = "reflections")]
159
pub use ctor;
1610

1711
pub mod animation;
@@ -23,37 +17,26 @@ pub mod logic;
2317
pub mod misc;
2418
pub mod ops;
2519
pub mod structural;
26-
#[cfg(feature = "std")]
2720
pub mod text;
28-
#[cfg(feature = "std")]
2921
pub mod uuid;
3022
pub mod value;
3123

32-
#[cfg(feature = "gpu")]
33-
pub mod gpu;
34-
35-
#[cfg(feature = "alloc")]
3624
pub mod memo;
3725

3826
pub mod raster;
39-
#[cfg(feature = "alloc")]
4027
pub mod transform;
4128

42-
#[cfg(feature = "alloc")]
4329
mod graphic_element;
44-
#[cfg(feature = "alloc")]
4530
pub use graphic_element::*;
46-
#[cfg(feature = "alloc")]
4731
pub mod vector;
4832

49-
#[cfg(feature = "alloc")]
5033
pub mod application_io;
5134

52-
#[cfg(feature = "reflections")]
5335
pub mod registry;
5436

5537
pub use context::*;
5638
use core::any::TypeId;
39+
use core::future::Future;
5740
use core::pin::Pin;
5841
pub use dyn_any::{StaticTypeSized, WasmNotSend, WasmNotSync};
5942
pub use memo::MemoHash;
@@ -74,16 +57,13 @@ pub trait Node<'i, Input> {
7457
core::any::type_name::<Self>()
7558
}
7659
/// Serialize the node which is used for the `introspect` function which can retrieve values from monitor nodes.
77-
#[cfg(feature = "std")]
7860
fn serialize(&self) -> Option<std::sync::Arc<dyn core::any::Any + Send + Sync>> {
7961
log::warn!("Node::serialize not implemented for {}", core::any::type_name::<Self>());
8062
None
8163
}
8264
}
8365

84-
#[cfg(feature = "alloc")]
8566
mod types;
86-
#[cfg(feature = "alloc")]
8767
pub use types::*;
8868

8969
pub trait NodeIO<'i, Input>: Node<'i, Input>
@@ -103,15 +83,13 @@ where
10383
fn output_type_name(&self) -> &'static str {
10484
core::any::type_name::<Self::Output>()
10585
}
106-
#[cfg(feature = "alloc")]
10786
fn to_node_io(&self, inputs: Vec<Type>) -> NodeIOTypes {
10887
NodeIOTypes {
10988
call_argument: concrete!(<Input as StaticTypeSized>::Static),
11089
return_value: concrete!(<Self::Output as StaticTypeSized>::Static),
11190
inputs,
11291
}
11392
}
114-
#[cfg(feature = "alloc")]
11593
fn to_async_node_io(&self, inputs: Vec<Type>) -> NodeIOTypes
11694
where
11795
<Self::Output as Future>::Output: StaticTypeSized,
@@ -138,22 +116,19 @@ impl<'i, I: 'i, N: Node<'i, I> + ?Sized> Node<'i, I> for &'i N {
138116
(*self).eval(input)
139117
}
140118
}
141-
#[cfg(feature = "alloc")]
142119
impl<'i, I: 'i, O: 'i, N: Node<'i, I, Output = O> + ?Sized> Node<'i, I> for Box<N> {
143120
type Output = O;
144121
fn eval(&'i self, input: I) -> O {
145122
(**self).eval(input)
146123
}
147124
}
148-
#[cfg(feature = "alloc")]
149125
impl<'i, I: 'i, O: 'i, N: Node<'i, I, Output = O> + ?Sized> Node<'i, I> for alloc::sync::Arc<N> {
150126
type Output = O;
151127
fn eval(&'i self, input: I) -> O {
152128
(**self).eval(input)
153129
}
154130
}
155131

156-
#[cfg(feature = "alloc")]
157132
impl<'i, I, O: 'i> Node<'i, I> for Pin<Box<dyn Node<'i, I, Output = O> + 'i>> {
158133
type Output = O;
159134
fn eval(&'i self, input: I) -> O {
@@ -167,7 +142,6 @@ impl<'i, I, O: 'i> Node<'i, I> for Pin<&'i (dyn NodeIO<'i, I, Output = O> + 'i)>
167142
}
168143
}
169144

170-
#[cfg(feature = "alloc")]
171145
pub use crate::application_io::{SurfaceFrame, SurfaceId};
172146
#[cfg(feature = "wasm")]
173147
pub type WasmSurfaceHandle = application_io::SurfaceHandle<web_sys::HtmlCanvasElement>;

node-graph/gcore/src/memo.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use crate::{Node, WasmNotSend};
2-
#[cfg(feature = "alloc")]
32
use alloc::sync::Arc;
43
use core::future::Future;
54
use core::ops::Deref;
@@ -106,7 +105,6 @@ pub struct IORecord<I, O> {
106105
pub output: O,
107106
}
108107

109-
#[cfg(feature = "alloc")]
110108
/// Caches the output of the last graph evaluation for introspection
111109
#[derive(Default)]
112110
pub struct MonitorNode<I, T, N> {
@@ -115,7 +113,6 @@ pub struct MonitorNode<I, T, N> {
115113
node: N,
116114
}
117115

118-
#[cfg(feature = "alloc")]
119116
impl<'i, T, I, N> Node<'i, I> for MonitorNode<I, T, N>
120117
where
121118
I: Clone + 'static + Send + Sync,
@@ -139,7 +136,6 @@ where
139136
}
140137
}
141138

142-
#[cfg(feature = "alloc")]
143139
impl<I, T, N> MonitorNode<I, T, N> {
144140
pub fn new(node: N) -> MonitorNode<I, T, N> {
145141
MonitorNode { io: Arc::new(Mutex::new(None)), node }
@@ -173,7 +169,6 @@ impl<T: Hash + serde::Serialize> serde::Serialize for MemoHash<T> {
173169
}
174170
}
175171

176-
#[cfg(feature = "std")]
177172
impl<T: Hash> MemoHash<T> {
178173
pub fn new(value: T) -> Self {
179174
let hash = Self::calc_hash(&value);

0 commit comments

Comments
 (0)