Implement Gradient Shaders and Fragment Shaders in Skwasm#41144
Implement Gradient Shaders and Fragment Shaders in Skwasm#41144auto-submit[bot] merged 14 commits intoflutter:mainfrom
Conversation
jonahwilliams
left a comment
There was a problem hiding this comment.
LGTM with some nits
| Pointer<Float> convertDoublesToNative(Iterable<double> values) { | ||
| final Pointer<Float> pointer = allocFloatArray(values.length); | ||
| int i = 0; | ||
| for (final double value in values) { | ||
| pointer[i] = value; | ||
| i++; | ||
| } | ||
| return pointer; | ||
| } | ||
|
|
There was a problem hiding this comment.
| Pointer<Float> convertDoublesToNative(Iterable<double> values) { | |
| final Pointer<Float> pointer = allocFloatArray(values.length); | |
| int i = 0; | |
| for (final double value in values) { | |
| pointer[i] = value; | |
| i++; | |
| } | |
| return pointer; | |
| } | |
| Pointer<Float> convertDoublesToNative(List<double> values) { | |
| final Pointer<Float> pointer = allocFloatArray(values.length); | |
| for (int i = 0; i < values.length; i++) { | |
| pointer[i] = value; | |
| } | |
| return pointer; | |
| } | |
| int i = 0; | ||
| for (final SkwasmShader shader in _childShaders!) { | ||
| childShaders[i] = shader.handle; | ||
| i++; | ||
| } | ||
| } |
There was a problem hiding this comment.
here and elsewhere, this pattern seems like the worst of both worlds - you still have all the bookkeeping of a for loop, but with no syntax help. And all the overhead of a for-of loop
|
Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change). If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review. |
This implements gradient shaders (linear, radial, conical, and sweep) as well as custom fragment shaders in Skwasm.
Something is still up with the ShaderMask layer though, it doesn't quite render correctly on Skwasm.
Edit: fixed and it's rendering consistently with CanvasKit now.