-
Notifications
You must be signed in to change notification settings - Fork 350
ImageData WebGL Textures #414
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
ImageData WebGL Textures #414
Conversation
Thanks @mzgoddard ! |
Given ImageData we can skip drawing the input and getting image data. This can help if update's color can also use the ImageData directly.
707332e
to
eaeb183
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! There's one line (in two places) that I have questions about, and one possible typo, but I really like the idea of using ImageData
when possible.
When possible pass ImageData to texture creation and updating to help remove chance of references that keep canvas and underlying data from being garbage collected.
eaeb183
to
e31934f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 LGTM!
Resolves
Load faster and use less memory.
Proposed Changes
Reason for Changes
Getting the ImageData in setBitmap and setSVG lets us skip an extra draw operation to Silhouette's update canvas. It likely also skips a step browsers perform to do a operation similar to getImageData and instead use ImageData directly. This provides a significant reduction in the time it takes to turn asset data in Storage into a Skin.
Benchmark Data
Pending ...