Skip to content
Open
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
11 changes: 11 additions & 0 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 @@ -105,6 +105,7 @@ wgpu-sync = { path = "libraries/wgpu-sync" }
graphite-proc-macros = { path = "proc-macros" }
graphite-editor = { path = "editor" }
graphene-canvas-utils = { path = "node-graph/libraries/canvas-utils" }
graphene-cache = { path = "node-graph/libraries/graphene-cache" }

# Workspace dependencies
rustc-hash = "2.0"
Expand Down
1 change: 1 addition & 0 deletions node-graph/graph-craft/src/document/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ macro_rules! tagged_value {
#[serde(alias = "Gradient", alias = "GradientTable", alias = "GradientPositions", alias = "GradientStops")]
GradientRamp(GradientRamp),
Strokes(Vec<Stroke>),
#[serde(alias = "NodeCache", alias = "FootprintCache")]
BrushCache(BrushCache),
// =======================
// AUTO-GENERATED VARIANTS
Expand Down
1 change: 1 addition & 0 deletions node-graph/libraries/brush-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ serde = ["dep:serde", "core-types/serde"]
[dependencies]
# Local dependencies
core-types = { workspace = true }
graphene-cache = { workspace = true }
graphene-hash = { workspace = true }

# Workspace dependencies
Expand Down
250 changes: 0 additions & 250 deletions node-graph/libraries/brush-types/src/cache.rs

This file was deleted.

7 changes: 4 additions & 3 deletions node-graph/libraries/brush-types/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
pub mod cache;
pub use cache::BrushCache;

use core_types::CacheHash;
use core_types::bounds::{BoundingBox, RenderBoundingBox};
use core_types::render_complexity::RenderComplexity;
use core_types::transform::Footprint;
use dyn_any::DynAny;
use glam::{DAffine2, DVec2, Vec2};
use graphene_cache::{Cache, GenerationalEviction};
use std::f32::consts::{PI, TAU};

pub type BrushCache = Cache<Footprint, GenerationalEviction<2, 3>>;
Comment thread
YohYamasaki marked this conversation as resolved.

#[derive(Clone, Debug, PartialEq, CacheHash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum Channel<T> {
Expand Down
22 changes: 22 additions & 0 deletions node-graph/libraries/graphene-cache/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[package]
name = "graphene-cache"
version = "0.1.0"
edition = "2024"
description = "The footprint-based cache for Graphene"
authors = ["Graphite Authors <contact@graphite.art>"]
license = "MIT OR Apache-2.0"

[features]
default = ["serde"]
serde = ["dep:serde", "core-types/serde"]

[dependencies]
# Local dependencies
core-types = { workspace = true }

# Workspace dependencies
dyn-any = { workspace = true }
glam = { workspace = true }

# Optional workspace dependencies
serde = { workspace = true, optional = true }
Loading
Loading