Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add canvas widget #215

Merged
merged 3 commits into from
Jul 2, 2021
Merged

Add canvas widget #215

merged 3 commits into from
Jul 2, 2021

Conversation

dhardy
Copy link
Collaborator

@dhardy dhardy commented Jul 1, 2021

This is built over the tiny-skia API (which is already used by the Svg widget).
The canvas has a built-in cache since it is rendered on the CPU then uploaded as a GPU texture.

Potentially we could add other canvas widgets over other draw APIs in the future, in which case this widget should be renamed.

Note there is already another option for drawing: constructing a new widget with code in the Layout::draw implementation (not cached); see e.g. clock or mandlebrot examples.

Also: some optimisations to text drawing.

@dhardy
Copy link
Collaborator Author

dhardy commented Jul 2, 2021

More thoughts: using a different library like lyon we could have GPU-accelerated rendering for the canvas and potentially for SVGs too. Probably worth investigating at some point.

@dhardy dhardy merged commit 852a40d into master Jul 2, 2021
@dhardy dhardy mentioned this pull request Jul 23, 2021
6 tasks
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