| 58 | } |
| 59 | |
| 60 | Valdi::Result<Valdi::Ref<ReSVGHandle>> parse(const Valdi::Byte* data, size_t length) { |
| 61 | resvg_render_tree* tree = nullptr; |
| 62 | auto loadResult = resvg_parse_tree_from_data(reinterpret_cast<const char*>(data), length, _options, &tree); |
| 63 | if (loadResult != RESVG_OK) { |
| 64 | return svgErrorFromResult(loadResult); |
| 65 | } |
| 66 | |
| 67 | return Valdi::makeShared<ReSVGHandle>(tree); |
| 68 | } |
| 69 | |
| 70 | private: |
| 71 | resvg_options* _options = nullptr; |
no test coverage detected