Skip to content

Commit 07eada0

Browse files
authored
Merge branch 'master' into artboard-gsr
2 parents 37e3180 + 3d84e63 commit 07eada0

64 files changed

Lines changed: 828 additions & 448 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Cargo.lock

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

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ members = [
1111
"frontend/wrapper",
1212
"libraries/dyn-any",
1313
"libraries/math-parser",
14+
"node-graph/libraries/graphene-hash",
1415
"node-graph/libraries/*",
1516
"node-graph/nodes/*",
1617
"node-graph/nodes/raster/shaders",
@@ -63,6 +64,7 @@ dyn-any = { path = "libraries/dyn-any", features = [
6364
"log-bad-types",
6465
"rc",
6566
] }
67+
graphene-hash = { path = "node-graph/libraries/graphene-hash", features = ["derive"] }
6668
preprocessor = { path = "node-graph/preprocessor" }
6769
math-parser = { path = "libraries/math-parser" }
6870
graphene-application-io = { path = "node-graph/libraries/application-io" }

editor/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ gpu = ["interpreted-executor/gpu", "dep:wgpu-executor"]
1919
# Local dependencies
2020
graphite-proc-macros = { workspace = true }
2121
graph-craft = { workspace = true }
22+
graphene-hash = { workspace = true }
2223
interpreted-executor = { workspace = true }
2324
graphene-std = { workspace = true } # NOTE: `core-types` should not be added here because `graphene-std` re-exports its contents
2425
preprocessor = { workspace = true }

editor/src/messages/portfolio/document/utility_types/network_interface/memo_network.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use graph_craft::document::NodeNetwork;
22
use std::cell::Cell;
3-
use std::hash::{Hash, Hasher};
43

54
#[derive(Debug, Default, Clone, PartialEq)]
65
pub struct MemoNetwork {
@@ -26,9 +25,9 @@ impl serde::Serialize for MemoNetwork {
2625
}
2726
}
2827

29-
impl Hash for MemoNetwork {
30-
fn hash<H: Hasher>(&self, state: &mut H) {
31-
self.current_hash().hash(state);
28+
impl graphene_hash::CacheHash for MemoNetwork {
29+
fn cache_hash<H: ::core::hash::Hasher>(&self, state: &mut H) {
30+
self.current_hash().cache_hash(state);
3231
}
3332
}
3433

editor/src/messages/tool/tool_messages/gradient_tool.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub struct GradientOptions {
2626

2727
#[impl_message(Message, ToolMessage, Gradient)]
2828
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
29-
#[derive(PartialEq, Clone, Debug, Hash, serde::Serialize, serde::Deserialize)]
29+
#[derive(PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize)]
3030
pub enum GradientToolMessage {
3131
// Standard messages
3232
Abort,

frontend/wrapper/src/editor_wrapper.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ use editor::messages::portfolio::utility_types::{DockingSplitDirection, FontCata
2222
use editor::messages::prelude::*;
2323
use editor::messages::tool::tool_messages::tool_prelude::WidgetId;
2424
use graph_craft::document::NodeId;
25+
use graphene_std::graphene_hash::CacheHashWrapper;
2526
use graphene_std::raster::color::Color;
2627
use graphene_std::vector::GradientStops;
2728
use serde::Serialize;
@@ -131,7 +132,7 @@ impl EditorWrapper {
131132
// Sends a FrontendMessage to JavaScript
132133
pub(crate) fn send_frontend_message_to_js(&self, message: FrontendMessage) {
133134
if let FrontendMessage::UpdateImageData { ref image_data } = message {
134-
let new_hash = calculate_hash(image_data);
135+
let new_hash = calculate_hash(&CacheHashWrapper(image_data));
135136
let prev_hash = IMAGE_DATA_HASH.load(Ordering::Relaxed);
136137

137138
if new_hash != prev_hash {

node-graph/graph-craft/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ wasm = [
2222
[dependencies]
2323
# Local dependencies
2424
dyn-any = { workspace = true }
25+
graphene-hash = { workspace = true }
2526
core-types = { workspace = true }
2627
brush-nodes = { workspace = true }
2728
graphene-core = { workspace = true }

0 commit comments

Comments
 (0)