nical / lyon

2D graphics rendering on the GPU in rust using path tessellation.
Other
2.3k stars 140 forks source link

Integrate the OpenClipArt SVG library to the test suite #522

Open Shnatsel opened 4 years ago

Shnatsel commented 4 years ago

When running the wgpu_svg example on the contents of openclipart-svg Debian/Ubuntu package I see multiple occurrences of #521 as well as other errors such as Error during tesselation!: Internal(IncorrectActiveEdgeOrder(4)).

Since these SVGs are real-world workloads and have already exposed multiple issues in Lyon, it seems wise to use them as a robustness and regression test going forward. If you're not on one of those distros, the dataset can be downloaded here: https://packages.ubuntu.com/bionic/openclipart

nical commented 4 years ago

That's an good idea, especially thanks to the creative common license on the library, I might even be able to just put it in the repository.

I put together a quick and dirty script to run the wgpu_svg example on all svg files in the library. Fortunately the main problem was in the wgpu_example code in the glue that turns the parser's path iterator into lyon's format. There are also a number of files that usvg fails to parse, but beyond that the rest of the library tessellates without panic with the couple of fixes I have locally.

I'll look into making a more proper test harness and include this library.

nical commented 4 years ago

523 takes care of all the failures in the openclipart library so I'll repurpose this issue for extending the test suite.

Shnatsel commented 4 years ago

I've filed an issue for the usvg error "SVG data parsing failed cause the document does not have a root node.": https://github.com/RazrFalcon/resvg/issues/192

The rest of the failures ("SVG has an invalid size.", "SVG data parsing failed cause invalid token 'Declaration' at 1:1 cause expected '1.' at 1:16.") appear to be legitimate.

RazrFalcon commented 4 years ago

Also note that wgpu_svg example uses a very old version of usvg. I guess because this the last one you have been able to build to wasm.