-
Notifications
You must be signed in to change notification settings - Fork 6k
Update CanvasKit to 0.7.0 and flesh out painting #13240
Update CanvasKit to 0.7.0 and flesh out painting #13240
Conversation
This allows us to fix some bugs in the CanvasKit backend. - Implement RRect where the radii are different - Implement drawDRRect - Implement ColorFilter - Implement the correct `arcTo` for `arcToPoint`
| final js.JsArray colorMatrix = js.JsArray(); | ||
| colorMatrix.length = 20; | ||
| for (int i = 0; i < 20; i++) { | ||
| colorMatrix[i] = filter._matrix[i]; |
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.
Let's leave a todo to remove this double-conversion. This should, at least, convert straight to a Float64List, but ideally we should write to WASM memory directly.
/cc @kjlubick - here's an example for excessive conversion that we talked about at the last sync.
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.
Done.
| /// EXPERIMENTAL: Enable the Skia-based rendering backend. | ||
| const bool experimentalUseSkia = | ||
| bool.fromEnvironment('FLUTTER_WEB_USE_SKIA', defaultValue: false); | ||
| bool.fromEnvironment('FLUTTER_WEB_USE_SKIA', defaultValue: true); |
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.
We probably want to keep this as false.
BTW, have you checked the code size difference with and without this backend? If the size difference is small (say <50KB gzipped), I'd say let's make it a dynamic option. I imagine most of the size cost is from the WASM blob, not from Dart code.
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.
I'll investigate after landing this PR
- Add TODO to avoid unnecessary conversions - Don't set CanvasKit to default - Fix licenses file
This allows us to fix some bugs in the CanvasKit backend.
arcToforarcToPointScreenshots
Using
drawDRRectfor checkboxesShowing
ColorFilterin the "Animation" demoUsing correct
arcToto get the correct notch under the FAB