mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 22:28:10 +08:00
Memoize hashing (#1876)
* Implement memoization wrapper for hashing * Fix pattern matching errors * Revert proper point modification hash calculiton * Remove unused hashing code * Code review and bug fixes * Improve pattern matching * Fix tests --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
@@ -5,7 +5,7 @@ use crate::wasm_application_io::WasmEditorApi;
|
||||
|
||||
use graphene_core::raster::brush_cache::BrushCache;
|
||||
use graphene_core::raster::{BlendMode, LuminanceCalculation};
|
||||
use graphene_core::{Color, Node, Type};
|
||||
use graphene_core::{Color, MemoHash, Node, Type};
|
||||
|
||||
use dyn_any::DynAny;
|
||||
pub use dyn_any::StaticType;
|
||||
@@ -207,17 +207,17 @@ impl Display for TaggedValue {
|
||||
}
|
||||
|
||||
pub struct UpcastNode {
|
||||
value: TaggedValue,
|
||||
value: MemoHash<TaggedValue>,
|
||||
}
|
||||
impl<'input> Node<'input, DAny<'input>> for UpcastNode {
|
||||
type Output = FutureAny<'input>;
|
||||
|
||||
fn eval(&'input self, _: DAny<'input>) -> Self::Output {
|
||||
Box::pin(async move { self.value.clone().to_any() })
|
||||
Box::pin(async move { self.value.clone().into_inner().to_any() })
|
||||
}
|
||||
}
|
||||
impl UpcastNode {
|
||||
pub fn new(value: TaggedValue) -> Self {
|
||||
pub fn new(value: MemoHash<TaggedValue>) -> Self {
|
||||
Self { value }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user