Integrate Vello for vector rendering (#1802)

* Start integrating vello into render pipeline

Cache vello render creation

Implement viewport navigation

Close vello path

Add transform parameter to vello render pass

* Fix render node types

* Fix a bunch of bugs in the path translation

* Avoid panic on empty document

* Fix rendering of holes

* Implement image rendering

* Implement graph recompilation afer editor api change

* Implement preferences toggle for using vello as the renderer

* Make surface creation optional

* Feature gate vello usages

* Implement skeleton for radial gradient

* Rename vello preference

* Fix some gradients

* Only update monitor nodes on graph recompile

* Fix warnings + remove dead code

* Update everything except for thumbnails after a node graph evaluation

* Fix missing click targets for Image frames

* Improve perfamance by removing unecessary widget updates

* Fix node graph paning

* Fix thumbnail loading

* Implement proper hash for vector modification

* Fix test and warnings

* Code review

* Fix dep

* Remove warning

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Dennis Kobert 2024-07-22 10:56:29 +02:00 committed by GitHub
parent 8e774efe9d
commit ab71d26d84
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
41 changed files with 807 additions and 760 deletions

View file

@ -1,6 +1,6 @@
use graph_craft::document::value::TaggedValue;
use graph_craft::graphene_compiler::{Compiler, Executor};
use graph_craft::imaginate_input::ImaginatePreferences;
use graph_craft::wasm_application_io::EditorPreferences;
use graph_craft::{concrete, ProtoNodeIdentifier};
use graph_craft::{document::*, generic};
use graphene_core::application_io::{ApplicationIo, NodeGraphUpdateSender};
@ -47,7 +47,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
font_cache: FontCache::default(),
application_io: Some(application_io.into()),
node_graph_message_sender: Box::new(UpdateLogger {}),
imaginate_preferences: Box::new(ImaginatePreferences::default()),
editor_preferences: Box::new(EditorPreferences::default()),
});
let executor = create_executor(document_string, editor_api)?;
let render_config = graphene_core::application_io::RenderConfig::default();
@ -126,7 +126,7 @@ pub fn wrap_network_in_scope(mut network: NodeNetwork, editor_api: Arc<WasmEdito
NodeInput::network(graphene_core::Type::Fn(Box::new(concrete!(Footprint)), Box::new(generic!(T))), 0),
NodeInput::node(NodeId(1), 0),
],
implementation: DocumentNodeImplementation::ProtoNode(ProtoNodeIdentifier::new("graphene_std::wasm_application_io::RenderNode<_, _, _>")),
implementation: DocumentNodeImplementation::ProtoNode(ProtoNodeIdentifier::new("graphene_std::wasm_application_io::RenderNode<_, _, _, _>")),
..Default::default()
},
]
@ -174,7 +174,7 @@ pub fn wrap_network_in_scope(mut network: NodeNetwork, editor_api: Arc<WasmEdito
// font_cache: &FontCache::default(),
// application_io: &block_on(WasmApplicationIo::new()),
// node_graph_message_sender: &UpdateLogger {},
// imaginate_preferences: &ImaginatePreferences::default(),
// editor_preferences: &EditorPreferences::default(),
// render_config: graphene_core::application_io::RenderConfig::default(),
// };
// let result = (&executor).execute(editor_api.clone()).await.unwrap();
@ -191,7 +191,7 @@ pub fn wrap_network_in_scope(mut network: NodeNetwork, editor_api: Arc<WasmEdito
// font_cache: &FontCache::default(),
// application_io: &block_on(WasmApplicationIo::new()),
// node_graph_message_sender: &UpdateLogger {},
// imaginate_preferences: &ImaginatePreferences::default(),
// editor_preferences: &EditorPreferences::default(),
// render_config: graphene_core::application_io::RenderConfig::default(),
// };
// let result = (&executor).execute(editor_api.clone()).await.unwrap();