Skip to content

Rebuild from model#455

Merged
wieslawsoltes merged 5 commits into
masterfrom
RebuildFromModel
Jan 3, 2026
Merged

Rebuild from model#455
wieslawsoltes merged 5 commits into
masterfrom
RebuildFromModel

Conversation

@wieslawsoltes
Copy link
Copy Markdown
Owner

Spec

  • Add SKSvg.RebuildFromModel() to rebuild the picture from the current model, clear wireframe cache, and return null when Model is missing.
  • Make SKSvg.Picture lazily build from Model and cache the result.
  • Ensure Avalonia.Svg.Skia.SvgSource retains a SKSvg instance for all load paths, including LoadFromSvg and LoadFromSvgDocument.
  • Add SvgSource.RebuildFromModel() in Svg.Controls.Skia.Avalonia to rebuild via SKSvg and refresh Picture.
  • Add SvgSource.RebuildFromModel() in Svg.Controls.Avalonia to deep-clone the current picture to refresh the rendered reference.
  • Update Avalonia samples with a model-editing demo (grayscale) that calls RebuildFromModel().
  • Add unit tests covering rebuild behavior in SKSvg and both SvgSource variants.

API/Implementation

  • SKSvg.Picture now lazily materializes _picture from Model; RebuildFromModel() rebuilds the SkiaSharp picture and clears the wireframe cache.
  • Avalonia.Svg.Skia.SvgSource now keeps a SKSvg instance for SVG string/document loads and exposes RebuildFromModel() that regenerates the picture from the model.
  • Avalonia.Svg.SvgSource exposes RebuildFromModel() that deep-clones the current ShimSkiaSharp.SKPicture to refresh render caches.
  • Samples add a "Model" tab showing original vs. modified (grayscale) output by editing draw commands and rebuilding.
  • Tests validate rebuild behavior and load retention for SKSvg and both Avalonia SvgSource implementations.

Fixes #450

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SvgImage manipulation in code

1 participant