Skip to content
Merged
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
24 changes: 19 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
members = [
"editor",
"desktop",
"desktop/wrapper",
"proc-macros",
"frontend/wasm",
"node-graph/gapplication-io",
Expand Down
12 changes: 2 additions & 10 deletions desktop/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,11 @@ rust-version = "1.87"

[features]
default = ["gpu"]
gpu = ["graphite-editor/gpu"]
gpu = ["graphite-desktop-wrapper/gpu"]

[dependencies]
# # Local dependencies
graphite-editor = { path = "../editor", features = [
"gpu",
"ron",
"vello",
] }
graphene-std = { workspace = true }
graph-craft = { workspace = true }
wgpu-executor = { workspace = true }
graphite-desktop-wrapper = { path = "wrapper" }

wgpu = { workspace = true }
winit = { workspace = true, features = ["serde"] }
Expand All @@ -39,4 +32,3 @@ vello = { workspace = true }
derivative = { workspace = true }
rfd = { workspace = true }
open = { workspace = true }
image = { workspace = true }
10 changes: 3 additions & 7 deletions desktop/src/app.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
use crate::CustomEvent;
use crate::WindowSize;
use crate::cef::WindowSize;
use crate::consts::APP_NAME;
use crate::desktop_wrapper::DesktopWrapper;
use crate::desktop_wrapper::NodeGraphExecutionResult;
use crate::desktop_wrapper::WgpuContext;
use crate::desktop_wrapper::messages::DesktopFrontendMessage;
use crate::desktop_wrapper::messages::DesktopWrapperMessage;
use crate::desktop_wrapper::serialize_frontend_messages;
use crate::render::GraphicsState;
use graphite_desktop_wrapper::messages::{DesktopFrontendMessage, DesktopWrapperMessage};
use graphite_desktop_wrapper::{DesktopWrapper, NodeGraphExecutionResult, WgpuContext, serialize_frontend_messages};
use rfd::AsyncFileDialog;
use std::sync::Arc;
use std::sync::mpsc::Sender;
Expand Down
4 changes: 2 additions & 2 deletions desktop/src/cef.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::desktop_wrapper::WgpuContext;
use crate::CustomEvent;
use crate::render::FrameBufferRef;
use crate::{CustomEvent, desktop_wrapper::deserialize_editor_message};
use graphite_desktop_wrapper::{WgpuContext, deserialize_editor_message};
use std::sync::mpsc::Receiver;
use std::sync::{Arc, Mutex};
use std::time::Instant;
Expand Down
9 changes: 4 additions & 5 deletions desktop/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use winit::event_loop::EventLoop;
pub(crate) mod consts;

mod cef;
use cef::{Setup, WindowSize};
use cef::Setup;

mod render;

Expand All @@ -15,9 +15,8 @@ use app::WinitApp;

mod dirs;

mod desktop_wrapper;
use desktop_wrapper::messages::DesktopWrapperMessage;
use desktop_wrapper::{DesktopWrapper, NodeGraphExecutionResult};
use graphite_desktop_wrapper::messages::DesktopWrapperMessage;
use graphite_desktop_wrapper::{DesktopWrapper, NodeGraphExecutionResult, WgpuContext};

pub(crate) enum CustomEvent {
UiUpdate(wgpu::Texture),
Expand All @@ -42,7 +41,7 @@ fn main() {

let (window_size_sender, window_size_receiver) = std::sync::mpsc::channel();

let wgpu_context = futures::executor::block_on(desktop_wrapper::WgpuContext::new()).unwrap();
let wgpu_context = futures::executor::block_on(WgpuContext::new()).unwrap();
let cef_context = match cef_context.init(cef::CefHandler::new(window_size_receiver, event_loop.create_proxy(), wgpu_context.clone())) {
Ok(c) => c,
Err(cef::InitError::AlreadyRunning) => {
Expand Down
4 changes: 1 addition & 3 deletions desktop/src/render/graphics_state.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
use graphene_std::Color;
use std::sync::Arc;
use wgpu_executor::WgpuExecutor;
use winit::window::Window;

use crate::desktop_wrapper::WgpuContext;
use graphite_desktop_wrapper::{Color, WgpuContext, WgpuExecutor};

#[derive(derivative::Derivative)]
#[derivative(Debug)]
Expand Down
33 changes: 33 additions & 0 deletions desktop/wrapper/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[package]
name = "graphite-desktop-wrapper"
version = "0.1.0"
description = "Graphite Desktop Wrapper"
authors = ["Graphite Authors <[email protected]>"]
license = "Apache-2.0"
repository = ""
edition = "2024"
rust-version = "1.87"

[features]
default = ["gpu"]
gpu = ["graphite-editor/gpu"]

[dependencies]
# Local dependencies
graphite-editor = { path = "../../editor", features = [
"gpu",
"ron",
"vello",
] }
graphene-std = { workspace = true }
graph-craft = { workspace = true }
wgpu-executor = { workspace = true }

wgpu = { workspace = true }
thiserror = { workspace = true }
futures = { workspace = true }
tracing = { workspace = true }
dirs = { workspace = true }
ron = { workspace = true}
vello = { workspace = true }
image = { workspace = true }
10 changes: 10 additions & 0 deletions desktop/src/desktop_wrapper.rs → desktop/wrapper/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ use graph_craft::wasm_application_io::WasmApplicationIo;
use graphite_editor::application::Editor;
use graphite_editor::messages::prelude::{FrontendMessage, Message};

// TODO: Remove usage of this reexport in desktop create and remove this line
pub use graphene_std::Color;

pub use wgpu_executor::Context as WgpuContext;
pub use wgpu_executor::WgpuExecutor;

pub mod messages;
use messages::{DesktopFrontendMessage, DesktopWrapperMessage};
Expand Down Expand Up @@ -43,6 +47,12 @@ impl DesktopWrapper {
}
}

impl Default for DesktopWrapper {
fn default() -> Self {
Self::new()
}
}

pub enum NodeGraphExecutionResult {
HasRun(Option<wgpu::Texture>),
NotRun,
Expand Down
Loading