Use the newly exposed functionality in `dart:_wasm` to fix up two different hacks we have:
1) When creating an image from an image source, use `wasm:import` instead of `@Native` and pass the image source directly as an externref. (Direct wasm binding instead of a JS interop shim, yay).
2) When binding the surface callback, previously we were wrapping the callback in a JS function, and then using `WebAssembly.Function` to create a wasm function wrapper around that. Now, we can create a `WasmFuncRef` that is a direct reference to a dart function and pass that over. Now there are no intermediary JavaScript layers when skwasm calls back to us, and we no longer are dependent on the type reflection flag in Chrome.
This fixes https://github.com/flutter/flutter/issues/134556
In this PR, I'm leaving a getter for `platformViewRegistry` in `dart:ui` for backwards compatibility. At some point, we need to properly deprecate it (e.g. print a warning asking users to import it from `dart:ui_web` instead).
Next step is to migrate all call sites in flutter/flutter, flutter/packages and flutter/devtools (anything else?).
Issue: https://github.com/flutter/flutter/issues/126831
Fixes https://github.com/flutter/flutter/issues/41563
This implements font loading for the skwasm renderer.
In addition, it does some pretty major refactors:
1) Simplified the font collection interface to just have a single `loadAssetFonts` call, without the separate registration and debug fonts loading stuff
2) Debug fonts load now through http/asset mocking mechanisms instead of having a separate `downloadDebugTestFonts` call
3) Consolidated a few of our different unit test setup functions into a single `setUpUnitTests` function
dart:js_interop and package:js will start conflicting. Eventually, we
want people to only use dart:js_interop, so this CL refactors code to do
that.
Unblocks https://dart-review.googlesource.com/c/sdk/+/294130/8 and
prevents confusing shadowing of dart:js_interop annotations like we do
today.
## Pre-launch Checklist
- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [X] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [Mentioned CL that is unblocked] I listed at least one issue that this
PR fixes in the description above.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [Need test-exemption] I added new tests to check the change I am
making, or this PR is [test-exempt].
- [X] All existing and new tests are passing.
Previous attempt was here: https://github.com/flutter/engine/pull/40846
I was including un-rewritten source files, which caused breakage. Now we run out `ui_web` files through the sdk_rewriter script before putting them into sky_engine
* [web] New gn for building CanvasKit
* Use toolchain_args to override CanvasKit gn args
* Use correct path for the generated canvaskit files
* Put toolchain close to target
* remove extra toolchains
* remove extra import
* add canvaskit_lite to archive
* fix local canvaskit path in tests
* add some guards using visibility and asserts
* renames
* formatting
* rename mistake
* Add github issue to the TODO
* Update buildroot sha
* clang-tidy error
* skip canvaskit targets when not needed
* Generate zip archives for Windows following target platform.
* Add CI builder for windows-arm64.
All packages can be cross compiled from an x64 machine.
Unittests are disabled, as they require an arm64 machine.
* Add windows-arm64 to CI.
* Generate zip archives for Windows following target platform.
* Add CI builder for windows-arm64.
All packages can be cross compiled from an x64 machine.
Unittests are disabled, as they require an arm64 machine.
* Add windows-arm64 to CI.
* Build dart2js platform kernels with null environment.
* Null environment should be true.
* More cleanup of gn steps.
* Fix build steps.
* Fix formatting.
* Add links to the cleanup github issue.