Skip to content

Commit

Permalink
Adding SkSVGDOM::renderNode(); depends on m103+
Browse files Browse the repository at this point in the history
  • Loading branch information
HinTak committed Aug 4, 2023
1 parent 9a06317 commit 6c59fc0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/skia/SVGDOM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <modules/svg/include/SkSVGDOM.h>
#include <modules/svg/include/SkSVGNode.h>
#include <modules/svg/include/SkSVGSVG.h>
#include <modules/svg/include/SkSVGRenderContext.h>

void initSVGDOM(py::module &m) {
py::class_<SkSVGDOM, sk_sp<SkSVGDOM>, SkRefCnt> SVGDOM(m, "SVGDOM");
Expand All @@ -14,5 +15,14 @@ SVGDOM
// .def("setRoot", &SkSVGDOM::setRoot)
// .def("findNodeById", &SkSVGDOM::findNodeById)
.def("render", &SkSVGDOM::render)
.def("renderNode",
[] (const SkSVGDOM& self, SkCanvas* canvas, const char* id) {
/*
* Just Make up a new default
* SkSVGPresentationContext for now.
*/
SkSVGPresentationContext pctx;
return self.renderNode(canvas, pctx, id);
})
;
}

0 comments on commit 6c59fc0

Please sign in to comment.