Skip to content

faster visit() function#3592

Draft
wcandillon wants to merge 2 commits intomainfrom
visit
Draft

faster visit() function#3592
wcandillon wants to merge 2 commits intomainfrom
visit

Conversation

@wcandillon
Copy link
Copy Markdown
Contributor

No description provided.

Comment on lines +829 to +871
} else if (type == "skFill") {
drawPaint();
} else if (type == "skImage") {
drawImage(runtime, props);
} else if (type == "skCircle") {
drawCircle(runtime, props);
} else if (type == "skPoints") {
drawPoints(runtime, props);
} else if (type == "skPath") {
drawPath(runtime, props);
} else if (type == "skRect") {
drawRect(runtime, props);
} else if (type == "skRRect") {
drawRRect(runtime, props);
} else if (type == "skOval") {
drawOval(runtime, props);
} else if (type == "skLine") {
drawLine(runtime, props);
} else if (type == "skPatch") {
drawPatch(runtime, props);
} else if (type == "skVertices") {
drawVertices(runtime, props);
} else if (type == "skDiffRect") {
drawDiffRect(runtime, props);
} else if (type == "skText") {
drawText(runtime, props);
} else if (type == "skTextPath") {
drawTextPath(runtime, props);
} else if (type == "skTextBlob") {
drawTextBlob(runtime, props);
} else if (type == "skGlyphs") {
drawGlyphs(runtime, props);
} else if (type == "skPicture") {
drawPicture(runtime, props);
} else if (type == "skImageSVG") {
drawImageSVG(runtime, props);
} else if (type == "skParagraph") {
drawParagraph(runtime, props);
} else if (type == "skSkottie") {
drawSkottie(runtime, props);
} else if (type == "skAtlas") {
drawAtlas(runtime, props);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Nitro I have a constexpr hashing creator func so that I can generate switch cases / jump tables for this, instead of walking the entire string to compare it for each if branch.

Maybe we can re-use that here, or migrate to Nitro 😄

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.

2 participants