Skip to content

Rebuild LowLevelDemo as a 12-tile example selector - #4

Open
jcant0n wants to merge 3 commits into
mainfrom
feat/examples-selector
Open

Rebuild LowLevelDemo as a 12-tile example selector#4
jcant0n wants to merge 3 commits into
mainfrom
feat/examples-selector

Conversation

@jcant0n

@jcant0n jcant0n commented Aug 16, 2026

Copy link
Copy Markdown
Member

One example per tile of ThorVG's README example_primitives.png, selectable Evergine-style: Program.cs is a selector where exactly one Runner.Run<...>() line is uncommented (the engine's VisualTests runner pattern).

Example Ports Notes
AntialiasedShapes Shapes.cpp CanvasEngineOption is virtual — flip to ALIASED to compare
GradientFilling Linear+RadialGradient.cpp
Stroking Stroke.cpp + dash patterns/offsets
PathClipping Clipping.cpp per-paint and per-scene clips
Svg Svg.cpp aspect-preserving grid
Masking Masking.cpp alpha / inv-alpha / luma / inv-luma blocks
Blending Blending.cpp labelled rows, solid + gradient + tiger pairs
Texturing PictureTransform.cpp adapted: no pattern-fill in capi → clipped, rotated picture
Text TextTtf.cpp Public Sans stands in for all fonts
GaussianBlur SceneEffects.cpp both / horizontal / vertical
DropShadow EffectDropShadow.cpp
ColorReplacement SceneEffects.cpp fill / tint / tritone scene effects
Showcase (previous demo) the only animated example; exercises tvg_animation_*

The old monolithic Program.cs became Infrastructure/ (Runner, ExampleBase, NativeResolver, Shaders). Static examples rasterise once and idle; the runner only re-uploads the texture when Update() reports a change.

All 13 verified live on win-x64: window capture per example compared against the README tiles, 117 fps, clean teardown. Assets vendored from thorvg.example (MIT; Public Sans OFL 1.1) — see Assets/ATTRIBUTION.txt. Nothing in this PR ships in the NuGet package.

One example per tile of ThorVG's README example_primitives.png, each a
direct port of the matching thorvg.example source to the C API, chosen
by uncommenting exactly one line in Program.cs (the engine's VisualTests
runner pattern). The previous composite demo survives as Showcase, the
only animated example; static scenes rasterise once and idle.

Infrastructure/ holds what used to be the monolithic Program: the
runner (window, swapchain, pinned ABGR8888 buffer, fullscreen
triangle), the native resolver and the shaders. Assets vendored from
thorvg.example (MIT; Public Sans under OFL 1.1), see ATTRIBUTION.txt.
@github-actions

Copy link
Copy Markdown
Contributor

API gate: additive

Every symbol that existed still exists, unchanged. Nothing that compiled before stops compiling.

Target framework Added Removed
net10.0 +0 -0

Enum and constant values are part of the measured surface: a renumbering keeps compiling and sends the wrong number to the driver, so it counts as a removal.

The Text example only ever drew Latin, so nothing proved that
tvg_text_set_text's LPUTF8Str marshalling survives anything outside
ASCII. It now has a second column with Chinese, Japanese in all three
scripts at once, Korean from a second font, and accented Latin with
Greek and Cyrillic.

None of the small fonts in thorvg.example cover Han -- the only one
that does is SentyCloud at 16 MB. These are Noto Sans SC and KR
subset to the characters the example draws: 68 KB and 7 KB. See
ATTRIBUTION.txt for how to regenerate them.

Also makes the process PerMonitorV2 aware. Left unaware it sized the
swapchain in virtual pixels and let Windows upscale, which softened
every glyph and anti-aliased edge above 100% scaling -- the one thing
these examples exist to show.
@github-actions

Copy link
Copy Markdown
Contributor

API gate: additive

Every symbol that existed still exists, unchanged. Nothing that compiled before stops compiling.

Target framework Added Removed
net10.0 +0 -0

Enum and constant values are part of the measured surface: a renumbering keeps compiling and sends the wrong number to the driver, so it counts as a removal.

The demo is the twelve README tiles and nothing else. Removes the
example, its Lottie asset and the attribution entry for it.

The runner keeps ExampleBase.Update and its dirty-frame branch: no
example returns true any more, so every scene rasterises once and the
loop idles, but the hook stays as the extension point for an animated
one. Nothing now exercises tvg_animation_* or tvg_picture_load_data
from the demo -- Test/Program.cs still covers the latter.
@github-actions

Copy link
Copy Markdown
Contributor

API gate: additive

Every symbol that existed still exists, unchanged. Nothing that compiled before stops compiling.

Target framework Added Removed
net10.0 +0 -0

Enum and constant values are part of the measured surface: a renumbering keeps compiling and sends the wrong number to the driver, so it counts as a removal.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant