* Add conversion from Fill to Table<Graphic>
* Refactor Vector vello renderer for Gradient / Color
* Refactor Vector SVG renderer for Gradient / Color
* Fix conflicts
* Add basic clipping-based fill for SVG rendering
* Use Cow to avoid cloning graphic list for fill
* Cleanup for Cow usage
* format code
* Use `<pattern>` instead of `<clipPath>` for clip
This simplifies the future implementation of clipping-based rendering
for strokes, as the stroke does not support the use of a clip path but
rather paint sources from a paint server.
* Move svg pattern rendering function to RenderExt
* Fix comment
* Fix empty fill list rendering as default black
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
* Move opaque check function to Graphic impl
* Add color converter and debug node to use graphic
* WIP: Use List<Graphic> to render Color & Gradient
* Use `Arc<List<Vector>>` for vector_data metadata
This exposes List's attributes to message handlers, enabling them to
access the necessary attribute data such as ATTR_STROKE_PAINT_GRAPHIC
as `Fill` and `Stroke` will not have paint information in the future.
* Recurse opacity checks on nested `Graphic`
Also extracts `fill_graphic_list_at` /
`stroke_paint_graphic_list_at` to share the row-attribute
lookup across the existing call sites.
* Fix fill and stroke visibility check degradation
* Fix clipping based stroke paint positioning
* Refactor vello renderer for stroke to use graphic
* Reduce `Fill` / `Stroke.color` to `List<Graphic>` allocations
* Revert "Use `Arc<List<Vector>>` for vector_data metadata"
This reverts commit 4285243a5d
* Expose paint row attributes as dedicated metadata for vectors
Add `fill_attributes` / `stroke_paint_attributes` to `DocumentMetadata`
so the `ExpandFillStrokeOnSelectedLayers` handler can read row paint
visibility without exposing entire `List<Vector>`.
* Fix transparency check to consider fill opacity
* Fix consistency of gradient placement for SVG stroke
* Rename `stroke_paint_..` to `stroke_..`
* Remove debug nodes
* Allow to use any graphic type without casting
* Rename `fill_graphic` / `stroke_graphic` to `fill` / `stroke`
* Fix SVG pattern placement when stroke transform differs from item transform
* Fix click target fill check for empty list in graphic
* Fix blank fill/stroke attribute masking legacy style
* Fix SVG's paint order trick for vector/raster fills
* Add zero-division guard for pattern wraparound prevention
* Code review
---------
Co-authored-by: Keavon Chambers <keavon@keavon.com>
* Macro support
* Preprocessor support
* Allow Cow str as scope name
* Use Passthrough node to work around compiler auto wrapping the producer node and invalidating the node id
* Stable NodeIds
* Less hacky but with bad performace
* Remove Cow from RegistryValueSource::Scope
* Connect scope injections to the inner network export
---------
Co-authored-by: Dennis Kobert <dennis@kobert.dev>
* Add Gradient node
* Add support of new Gradient node for Gradient tool
* Adapt gemini reviews
* Add tests
* Bring back visibility check
* Remove the 'Gradient' node since it's unwanted after all
* Formatting
---------
Co-authored-by: Keavon Chambers <keavon@keavon.com>
* Use ResourceId for referring to Resources
* Use Doc
* use error for preprocessor ResourceId replacement failure
* Keep hashes in DocumentInfo
* Migrate with less mem copy
* Global ResourceMessage -> ResourceStorageMessage
* Add document ResourceMessage
* Move embedding logic
* Fix
* Cleanup
* Review
* Fix
* Add .nvim.lua to gitignore
* Migrate from iai-callgrind to the renamed successor gungraun
---------
Co-authored-by: Dennis Kobert <dennis@kobert.dev>
* Add TaggedValue::TypeDefault to avoid baking placeholder Tables into saved documents
* Add TaggedValue::TypeDefault to avoid baking placeholder Tables into saved documents
* Migrate empty Vector/Raster/Graphic/Artboard placeholder values to TypeDefault on load
Documents written before the TypeDefault mechanism existed have empty Table<Vector>/<Raster>/<Graphic>/<Artboard> values baked into every unwired exposed input. Walk each migrated node's inputs and rewrite any such placeholder NodeInput::Value into the equivalent NodeInput::type_default, so re-saved documents shed the placeholder payloads. Marked with a TODO for eventual removal once enough documents have been re-saved.
* Re-save demo artwork
* Remove Graphic and Artboard placeholder containers from TaggedValue
* Remove Raster placeholder TaggedValue variant
* Simplify document migration
* Remove Vector placeholder TaggedValue variant
* Remove NodeIdTable from the TaggedValue
* Remove StringTable from the TaggedValue
* Remove F64Table in place of F64Array in TaggedValue
* Replace TaggedValue::Color(Table<Color>) with ::Color(Option<Color>)
* Replace TaggedValue::GradientTable(Table<GradientStops>) with ::Gradient(GradientStops)
* Replace TaggedValue::BrushStrokeTable(Table<BrushStroke>) with ::BrushStrokes(Vec<BrushStroke>)
* Make TaggedValue::DocumentNode runtime-only with TypeDefault placeholder
* Make TaggedValue::ContextFeatures runtime-only
* Remove Serialize/Deserialize from Table<T>
* Add a widget for TaggedValue::BrushStrokes to visualize strokes and samples
* Define a reusable list of TaggedValue::TypeDefault types for its generated methods
* Re-save demo artwork
* Rename the 'Identity' node to 'Passthrough' internally
* Rename the 'Memoize' node to 'Cache' internally
* Let skip_impl proto nodes auto-generate as document node definitions
* Remove the wrapper 'Passthrough' node from document_node_definitions.rs
* Remove the wrapper 'Cache' node from document_node_definitions.rs
* Remove the wrapper 'Monitor' node from document_node_definitions.rs
* Remove the wrapper 'Noise Pattern' node from document_node_definitions.rs
* Remove the wrapper 'Brush' node from document_node_definitions.rs
* Remove the wrapper 'Transform' node from document_node_definitions.rs
* Code review improvements
* Rename Cache node back to Memoize
* More code review
* Replace the Artboard struct with a Table<Table<Graphic>> shape
* Remove the never-functional, seemingly unneeded migrate_type_descriptor_names due to typo
* Allow negative artboard sizes
* Improve the Data panel with more type-specific detail pages
* Add network_path to SetDisplayName so renames target any network depth
* Track nested layers via full editor:layer paths and rename parent_layer to path_of_subgraph
* Polish the data panel NodeId leaf page with an editable name field
* Make lock and visibility toggles work for layers in nested subgraphs
* Fix formatting
* Fix connected_to_output running in the wrong network for nested-layer toggles
* Move Vec<String> to Table<String>
* Remove old VecDVec2
* Move Vec<u8> to Table<u8>
* Move Vec<f64> to Table<f64>
* Move [f64; 4] to Table<f64>
* Move Vec<NodeId> to Table<NodeId>
* Tidy up the TaggedValue variants
* Move Vec<BrushStroke> to Table<BrushStroke>
* Add missing type implementations
* Fix tests
---------
* Fix click target propagation with the Rasterize node
* Add the 'Write Attribute' node
* Remove tag_layer in favor of the new Write Attribute node, prune redundant attribute writes
* Replace the Vector<Upstream> type argument with the "editor:merged_layers" attribute
* Rename 'Image Value' node to 'Image' and have its input value be Image<Color> not Table<Raster<CPU>>
* Add a Properties panel widget labeling "width x height" for images in the Image node
* Add Image<Color> node registry entry for MonitorNode
* Code review
* Fix Morph node transform interpolation and preservation in the table
* Fix click target positions for Morph's nested layers by pre-compensating upstream_data transforms
* Redesign Morph node (v3) with control path input and uniformly spaced progression, and fix Stroke::lerp interpolation weights
* Add migration from Morph node v2 to v3
* Redesign the 'Blend Shapes' node behavior and subgraph definition
* Add the Layer > Blend menu entry to easily set up a blend
* Optimize the Morph node
* Refactor the Morph node to remove the roundtrip through BezPath
* Fine-tune Morph node Bezier order promotion and handle interpolation
* Add the Layer > Morph menu bar entry
* Fix NaN and guard against other potential NaN bugs breaking the editor
* Add InterpolationDistribution parameter to Morph with weighted progression, swap parameter orders, and rename shear to skew
* Add the Reverse parameter to the Morph node
* Update the order of the inputs to Blend Shapes for consistency with Morph
* Make Layer > Morph create the Morph Path control layer
* Fix migrations
* Move 10 to a constant
* Avoid division by 0 in the Blend Shapes node internals
* Rename nodes 'Blend' -> 'Mix' and 'Blend Shapes' to 'Blend'
* Fix a crash encountered while testing
* Final code review
* Make domain push dupe checks debug-only and use push_unchecked in the Morph node
* Pre-allocate for pushes to the vector domains
* Add fast path at t=0
* Inline reserve()
* Set up the control path layer above not below, and starting collapsed
* Review fixes
---------
Co-authored-by: Timon <me@timon.zip>
* Refactor transform decomposition API with skew support, add Decompose Skew node, and fix stroke transform interpolation
* Fix bug in master with skew changing Area node calculated value
* Code review simplification
* More code review fixes
* Rename cases where "shear" terminology was used in place of "skew"
* WIP render caching
* Hook up render cache to render pipeline
* Fixed offsets
* Initial cleanup
* Integrate cache with context invalidation
* Cleanup
* Improve rounding and reduce tile size to fix vello not rendering
* Include pointer position in cache key
* Avoid unwraps and zero sized textures
* Destroy textures after blitting to surface
* Fix context dependencies
* Exclude footprint from render params
* Batch animation frame messages
* Add vello max render size to preference dialogue
* Remove unused import
* Reorder vello preference
* Clean up preferences dialog
* Apply review suggestions
* Cap max render region size
---------
Co-authored-by: Keavon Chambers <keavon@keavon.com>
* Generate the MVP node catalog in the manual (with some placeholders)
* Implement nearly the rest of everything
* Move to the tools directory and make it generate nicer default values
* Add category descriptions
* Organize file structure and improve type naming
* Improve book table of contents code
* Add collapsing chapter navigation to the book template
* Add to build workflow
* Clean up site structure
* Add two nodes for substring
* fix: number convention
* Remove unnecessay allocations and add support for \n in patterns
* Make split node return Vec<String> and remove count_elements node
* Add Cache implementations for Vec<String>
* Code review
---------
Co-authored-by: daniil.loban <daniil.loban@gmail.com>
Co-authored-by: Dennis Kobert <dennis@kobert.dev>
Co-authored-by: Keavon Chambers <keavon@keavon.com>