Skip to content

Commit 503a4db

Browse files
Remove redundant PlatformApplicationIo::new_offscreen
is now equivalent to PlatformApplicationIo::new
1 parent d9a2bc4 commit 503a4db

File tree

3 files changed

+2
-22
lines changed

3 files changed

+2
-22
lines changed

editor/src/node_graph_executor/runtime.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ impl NodeRuntime {
158158
#[cfg(all(not(test), target_family = "wasm"))]
159159
application_io: Some(PlatformApplicationIo::new().await.into()),
160160
#[cfg(any(test, not(target_family = "wasm")))]
161-
application_io: Some(PlatformApplicationIo::new_offscreen().await.into()),
161+
application_io: Some(PlatformApplicationIo::new().await.into()),
162162
font_cache: self.editor_api.font_cache.clone(),
163163
node_graph_message_sender: Box::new(self.sender.clone()),
164164
editor_preferences: Box::new(self.editor_preferences.clone()),

node-graph/graph-craft/src/application_io/native.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -37,26 +37,6 @@ impl NativeApplicationIo {
3737
io
3838
}
3939

40-
pub async fn new_offscreen() -> Self {
41-
#[cfg(feature = "wgpu")]
42-
let executor = WgpuExecutor::new().await;
43-
44-
#[cfg(not(feature = "wgpu"))]
45-
let wgpu_available = false;
46-
#[cfg(feature = "wgpu")]
47-
let wgpu_available = executor.is_some();
48-
super::set_wgpu_available(wgpu_available);
49-
50-
let mut io = Self {
51-
#[cfg(feature = "wgpu")]
52-
gpu_executor: executor,
53-
resources: HashMap::new(),
54-
};
55-
56-
io.resources.insert("null".to_string(), Arc::from(include_bytes!("../null.png").to_vec()));
57-
58-
io
59-
}
6040
#[cfg(feature = "wgpu")]
6141
pub fn new_with_context(context: wgpu_executor::WgpuContext) -> Self {
6242
#[cfg(feature = "wgpu")]

node-graph/graphene-cli/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
121121
let document_string = std::fs::read_to_string(document_path).expect("Failed to read document");
122122

123123
log::info!("Creating GPU context");
124-
let mut application_io = block_on(WasmApplicationIo::new_offscreen());
124+
let mut application_io = block_on(WasmApplicationIo::new());
125125

126126
if let Command::Export { image: Some(ref image_path), .. } = app.command {
127127
application_io.resources.insert("null".to_string(), Arc::from(std::fs::read(image_path).expect("Failed to read image")));

0 commit comments

Comments
 (0)