408 Commits

Author SHA1 Message Date
Michael Goderbauer
efc22ee283 Enable private field promotion (flutter/engine#45722)
New feature in upcoming Dart 3.2. See https://github.com/dart-lang/language/issues/2020. Feature is enabled by bumping the min SDK version to 3.2.

Part of https://github.com/flutter/flutter/issues/134476.
2023-09-14 21:02:03 +00:00
godofredoc
c9ce9f7fd5 Update webdriver imports. (flutter/engine#45816)
This is to be able to update the webdriver dependency.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-09-14 18:26:42 +00:00
Stephen Adams
182847ec84 [web] More efficient fallback font selection (flutter/engine#44526)
The PR improves the code size and runtime performance of fallback font selection.

### Performance improvements

Initialization of the data structures to support fallback font selection has been moved from creating the FallbackFontManager (first frame) to the first use, i.e. the first frame actually needing a fallback font.

The numbers reported below are for a lightly edited version of the counter demo that appends to the counter about ~300 missing code points that need ~25 fallback fonts to cover the missing code points. Timings taken from a few profiles on my performance workstation.

|  |  Before | After  | 
| --- | ---: | ---: |
| FallbackFontManager() |~100ms | <2ms |
| First need | 0ms | 12ms |
| Subsequent need | 20-30ms | <1ms |

### Size improvements

|  |  Before | After  | Δ |
| --- | ---: | ---: | ---: |
| main.dart.js | 1586405 | 1477319 | -109086 (-6.87%) |
| brotli -9 | 427304 | 401611 | -25693 (-6.01%) |

### Algorithm notes

#### Startup

The old algorithm built an interval tree from the code point ranges of the ~140 fallback fonts and uses the interval tree to build a list of fonts that support each missing code point. The new algorithm uses a binary search map that directly produces the list of fonts. There are fewer binary search ranges (~22k) than the aggregate ranges for all the fonts (~26k).
Most of the startup time gain comes from using a data unpacks directly into a useful form rather than needing processing to build an interval tree (~12ms vs ~100ms).

#### Running

The runtime for font selection is greatly improved for several reasons

- The code point space is partitioned into components so that code point counting can be batched.
- When a font is selected, the counts are updated incrementally rather than being recomputed.
- The counts are held in fields of the NotoFont and component objects rather than in Maps or Sets.

Batching, incremental update and avoiding hash tables are roughly multiplicative in effect.

## Issues

- https://github.com/flutter/flutter/issues/131440

*If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-08-31 22:42:20 +00:00
Jackson Gardner
69b2747ca3 Skwasm platform views (flutter/engine#43011)
This implements platform views in Skwasm. There are a number of substantial changes rolled up in this change, including:
* Reworked the rendering system to use multiple canvases with a single WebGL context, via ImageBitmap rendering.
* Reworked our object management and bindings to use the `__externref_t` construct in C code.
* Upgraded emscripten to a much newer version
* Generified skwasm's scene builder to be able to work with any renderer that can produce `ImageBitmap` objects from Pictures, and whose `Canvas`, `Picture` and `ImageFilter` objects conform to `SceneCanvas`/`ScenePicture`/`SceneImageFilter`

For platform views themselves, most stuff is implemented except for clipping. I plan on doing that in a subsequent change.
2023-08-28 16:29:14 +00:00
Ian Hickson
9881f4846b Make web tests start with an empty title (flutter/engine#43846)
Fixes https://github.com/flutter/flutter/issues/39159
2023-08-23 03:22:59 +00:00
Matan Lurey
ee235383f8 Update web_ui/** to explicitly pass --local-engine-host to the flutter tool. (flutter/engine#44613)
Partial work towards https://github.com/flutter/flutter/issues/132245.
2023-08-14 21:09:22 +00:00
Mouad Debbar
dc0147d3d3 [web] Silence pub get when it's successful (flutter/engine#44445)
In the spirit of keeping the happy path's output as clean as possible, let's hide the many lines printed by `pub get` even when it's successful.

If `pub get` fails, its output will be printed on the terminal.
2023-08-07 22:38:03 +00:00
Jackson Gardner
12c34f4b33 Roll Chrome to 115 (flutter/engine#44076)
Update the version of Chrome we use for unit tests to 115.
2023-07-28 15:03:05 +00:00
David Iglesias
1d2593d09f [web] Preserve canvaskit variant during tests. (flutter/engine#43868)
A ~~simpler~~ very similar version of https://github.com/flutter/engine/pull/43854

* Makes it harder for users to accidentally remove default configuration values, while still allowing them to do so if needed (configuration is now overridden with a subset of values, rather than passing a full configuration object).
  * Moves `merge` from the configuration object and into the override method.
* Removes a test-only configuration option:
  * `window._flutter_canvaskit_variant_for_test_only`

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-07-26 05:04:16 +00:00
Mouad Debbar
d205cf6af6 [web] Preserve correct CanvasKit Variant during test initialization (flutter/engine#43854)
At some point, we started setting `useColorEmoji` to true in our tests, but we were doing it in a way that resets all other configurations to their defaults. This caused the `canvasKitVariant` config to be lost and always set to the default `auto`.

This PR fixes the issue and adds tests to:

1. Make sure that the CanvasKit suite always runs with a specific variant (not `auto`).
2. Make sure the given CanvasKit variant makes it all the way through to the tests.

The test harness uses a backdoor (a global JS property on `window`) to communicate which canvaskit variant it's using. The test then compares that with `configuration.canvasKitVariant` to make sure they match. If they don't match, then the configuration was lost somewhere on the way.

Fixes https://github.com/flutter/flutter/issues/130993
2023-07-20 18:06:24 +00:00
Konstantin Scheglov
327e2a3d85 Fix prefer_final_in_for_each (flutter/engine#42899)
Context: https://dart-review.googlesource.com/c/sdk/+/309821
2023-06-15 20:57:43 -07:00
Jackson Gardner
6fdcec7af7 Bump Chrome version to 114 for testing (flutter/engine#42623) 2023-06-07 17:55:20 +00:00
Jackson Gardner
aa7b3fcf98 Only use 8 cores for web test compilation. (flutter/engine#42321) 2023-05-25 19:14:06 +00:00
Mouad Debbar
7b3b362623 [web] Cleaner output on LUCI (flutter/engine#41989)
Using ansi colors in LUCI results in output that looks like:
```
00:00 +0: loading flutter_tester_emulation_golden_test.dart                                                                                                                                            
00:01 +0: loading flutter_tester_emulation_golden_test.dart                                                                                                                                            
00:02 +0: loading flutter_tester_emulation_golden_test.dart
```

This PR disables colors on LUCI so that we get clean output that's easily scannable and searchable.
2023-05-12 21:50:22 +00:00
Jackson Gardner
3c85b2e565 Implement text rendering in Skwasm (flutter/engine#41832)
This implements full text rendering with the Skwasm renderer.

The font fallback logic has been refactored to decouple the font fallback manager from any CanvasKit-specific types and functions.

A chunk of CanvasKit text rendering tests have been ported over to the renderer-agnostic `ui` tests.

Fixes https://github.com/flutter/flutter/issues/126339
2023-05-09 23:37:21 +00:00
Jackson Gardner
5189eda98b Populate fallback fonts from CIPD in tests (flutter/engine#41656)
This fixes https://github.com/flutter/flutter/issues/85793

The script that generates the font fallback data also rolls a package to CIPD with these files and updates the DEPS to download those files from CIPD. This makes sure that these tests are hermetic.
2023-05-04 05:12:54 +00:00
Jackson Gardner
28d9e0df0f Improve Wasm Debugging. (flutter/engine#41054)
Improve Wasm Debugging.
2023-04-12 00:52:04 +00:00
Jackson Gardner
439141c38d Skwasm scene (flutter/engine#40330)
Skwasm scene
2023-04-10 17:38:57 +00:00
Mouad Debbar
5d30f3f043 [web] Make 'Noto Color Emoji' opt-in (flutter/engine#40990)
[web] Make 'Noto Color Emoji' opt-in
2023-04-07 16:54:22 +00:00
Jackson Gardner
1f7f52ffac Fail the run_suite_step if any test failures are detected. (flutter/engine#40834)
We need to throw if the `run_suite_step` encounters any test failures.
2023-04-03 18:02:31 -07:00
Harry Terkelsen
8f9c5e83dd Switch from Noto Emoji to Noto Color Emoji and update font data (flutter/engine#40666) 2023-03-29 14:12:25 -07:00
Jackson Gardner
77dadc582f Forward stdout and stderr from dart2wasm when verbose. (flutter/engine#40731)
Forward stdout and stderr from dart2wasm when verbose.
2023-03-29 00:46:05 +00:00
Harry Terkelsen
e8d9ea46c2 Revert "Revert "Reland "Default the CanvasKit base URL to local artifacts. (#40293)" (#40470)" (#40700)" (flutter/engine#40717)
This reverts commit aee0a1a6db53cfdada6d00fe50a94c3216950bb6.
2023-03-28 17:21:10 -07:00
Kevin Chisholm
aee0a1a6db Revert "Reland "Default the CanvasKit base URL to local artifacts. (#40293)" (#40470)" (flutter/engine#40700)
Revert "Reland "Default the CanvasKit base URL to local artifacts.""
2023-03-28 04:49:13 +00:00
Michael Goderbauer
a508065bbc Reland "Post 3.0 lint sync (#40394)" (flutter/engine#40688)
Reland "Post 3.0 lint sync (#40394)"
2023-03-28 03:25:02 +00:00
Jackson Gardner
82886d52b3 Web test reorganization (flutter/engine#39984)
Web test reorganization
2023-03-28 00:08:48 +00:00
Brandon DeRosier
9e9590a68f Revert "Post 3.0 lint sync (#40394)" (flutter/engine#40687)
This reverts commit 8ba209121d2671b0d202d9731fe67ec5eb1529b4.
2023-03-27 15:45:59 -07:00
Michael Goderbauer
8ba209121d Post 3.0 lint sync (flutter/engine#40394)
Post 3.0 lint sync
2023-03-27 17:15:08 +00:00
Harry Terkelsen
888d56a309 Reland "Default the CanvasKit base URL to local artifacts. (#40293)" (flutter/engine#40470)
This reverts commit d56b53d0c6006873499ba75dcc0bf478834a1b64.
2023-03-24 11:41:33 -07:00
Zachary Anderson
b4c1aaaf1c Revert "[web] Turn on CanvasKit Chromium (#40459)" (flutter/engine#40495)
Revert "[web] Turn on CanvasKit Chromium"
2023-03-21 18:18:51 +00:00
Mouad Debbar
a32e3ab927 [web] Turn on CanvasKit Chromium (flutter/engine#40459)
[web] Turn on CanvasKit Chromium
2023-03-21 16:23:09 +00:00
Zachary Anderson
d56b53d0c6 Revert "Default the CanvasKit base URL to local artifacts. (#40293)" (flutter/engine#40415)
Revert "Default the CanvasKit base URL to local artifacts."
2023-03-18 04:33:12 +00:00
Harry Terkelsen
d9e8942c04 Default the CanvasKit base URL to local artifacts. (flutter/engine#40293) 2023-03-17 14:36:11 -07:00
Jackson Gardner
5508a04de1 Output web test artifacts to out directory. (flutter/engine#40355)
Output web test artifacts to out directory.
2023-03-16 22:19:55 +00:00
Mouad Debbar
fe97e51d19 [web][felt] Add 'archive' target + 'profile' mode (flutter/engine#40060)
[web][felt] Add 'archive' target + 'profile' mode
2023-03-07 21:31:31 +00:00
godofredoc
bc2611e03c Web engine build config cleanup. (flutter/engine#40064)
Web engine build config cleanup.
2023-03-04 00:28:18 +00:00
Jackson Gardner
a3dc9e77fb Skwasm Renderer - initial implementation (flutter/engine#39072)
Skwasm Renderer - initial implementation
2023-03-02 00:01:04 +00:00
Mouad Debbar
2c378412f2 [web] Copy everything under the local canvaskit folder (flutter/engine#39799)
* [web] Copy everything under the local canvaskit folder

* Update compile_tests_step.dart
2023-02-23 15:06:18 +00:00
Yegor
543f998577 [web] consolidate network code into httpFetch (flutter/engine#39657)
* consolidate network code into httpFetch

* make HTTP test cross-browser friendly; fix copypasta
2023-02-16 00:02:02 +00:00
Jackson Gardner
43e7f9beeb Bump to Chrome 111. (flutter/engine#39525) 2023-02-10 01:05:10 +00:00
Jackson Gardner
6f7fd98f68 Remove uses of --full-dart-sdk from the engine_v2 builders. (flutter/engine#39297)
Also, do not produce host-specific web_sdk artifacts in the builders.
2023-01-31 23:01:00 +00:00
Jackson Gardner
5c3acfecc6 @alwaysThrows is deprecated. Return Never instead. (flutter/engine#39269) 2023-01-30 16:31:56 -08:00
Mouad Debbar
e1651d2e3a [web] Expose felt flag for building CanvasKit Chromium (flutter/engine#39201) 2023-01-30 21:48:15 +00:00
Ben Konyi
d3f45828bf Reland "Remove references to Observatory (#38919)" (flutter/engine#39139)
This reverts commit 5dd945442b230a2c0549ee6d798fda71e031a4a9.
2023-01-30 09:50:09 -05:00
Harry Terkelsen
3447ce87ad [web] Remove dependency on 'profiling' subfolder of canvaskit. (flutter/engine#38169) 2023-01-24 14:23:20 -08:00
Mouad Debbar
105bb9ab43 [web] Build multiple CanvasKit variants (using toolchain_args) (flutter/engine#38448)
* [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
2023-01-23 20:37:18 +00:00
Ben Konyi
002fce29e0 Revert "Remove references to Observatory (#38919)" (flutter/engine#39035)
Reason for revert: breaking Flutter -> plugins roll

This reverts commit 1f603711c7b7afe52dff3872a5035789e3ddba02.
2023-01-20 12:33:40 -05:00
Ben Konyi
1f603711c7 Remove references to Observatory (flutter/engine#38919)
Observatory is being deprecated for Dart 3.0 so it should no longer be referenced in tooling messaging / flags.

See https://github.com/dart-lang/sdk/issues/50233
2023-01-19 09:20:46 -05:00
Jackson Gardner
b9047c2756 Get unit tests working with dart2wasm (flutter/engine#38784) 2023-01-18 12:28:31 -08:00
Mouad Debbar
3b8d9a5429 [web] Reduce code size impact of fallback font data (flutter/engine#38787)
* [web] Reduce code size impact of fallback font data

* fix rangeEnd vs rangeLength mistake
2023-01-17 19:59:14 +00:00