We have tests today that are trying to testwith impeller but using software rendering, so they're not actually testing with impeller.
In an unrelated patch, I'm causing the request to enable impeller to have additional checks that Impeller related objects/configurations are set when using Impeller, which isn't true if software rendering is enabled, and is causing the tests getting disabled here to fail.
The tests are not actually testing Impeller and thus are getting added to the skip list (they now crash with this change). https://github.com/flutter/flutter/issues/131888 tracks re-enabling them. They will almost certainly need different golden files than the Skia ones.
Fixes https://github.com/flutter/flutter/issues/131887
Previously, some common Darwin framework targets existed in:
//flutter/shell/platform/darwin/BUILD.gn
This moves all targets into:
//flutter/shell/platform/darwin/common/BUILD.gn
The framework_shared target has been renamed framework_common for consistency with the directory name, and flutter_channels_unittests has been renamed framework_common_unittests since it's a reasonable target for adding other tests of common framework code.
We also de-duplicate targets with existing targets.
* The `flutter_channels` target duplicates the existing
`framework_shared` target.
* The `common` target already includes the buffer conversions
translation units,
which are only used by the iOS embedder.
No test changes since there are no semantic changes, just a
restructuring of build targets.
## 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] and the [C++,
Objective-C, Java style guides].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [ ] I added new tests to check the change I am making or feature I am
adding, or Hixie said the PR is test-exempt. See [testing the engine]
for instructions on writing and running engine tests.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [X] I signed the [CLA].
- [X] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
Part of https://github.com/flutter/flutter/issues/131346
Stubs a minimal test of the FFI utilities that `dart:ui` uses, but using
public symbols exported from the engine library. If this goes well, I'll
move the stuff from `dart:ui` into here and begin landing parts of the
API with test coverage.
Stop using the special fuchsia headers, as they are contributing to
undefined behavior when building with LTO.
They are also no longer needed. All relevant fuchsia extensions were
upstreamed some time ago.
In the process, engage in some cleanup which means the "vulkan_config"
is also no longer needed. Rely on GN "public_deps" to provide the vulkan
include paths to various source sets.
See b/291462180 for more details on why this fix was neccesary.
This PR is to add support for the expanded/collapsed-state semantics flag to the engine. After adding another PR to Flutter, we will be able to support the expanded/collapsed state in semantics for submenu buttons.
Related to [#127617](https://github.com/flutter/flutter/issues/127617) in flutter
The change in [0] has propagated now everywhere, so we can use
`utf8.encode()` instead of the longer `const Utf8Encoder.convert()`.
Also it cleans up code like
```
Uint8List bytes;
bytes.buffer.asByteData();
```
as that is not guaranteed to be correct, the correct version would be
```
Uint8List bytes;
bytes.buffer.asByteData(bytes.offsetInBytes, bytes.length);
```
a shorter hand for that is:
```
Uint8List bytes;
ByteData.sublistView(bytes);
```
[0] https://github.com/dart-lang/sdk/issues/52801
Reverts flutter/engine#43118
The incorrect default value (`true` instead of `false`) was used in the PR and that caused internal test failures. I'll add a test before trying to reland.
The goal is to remove the rounding applied in skparagraph and in the framework: https://github.com/flutter/flutter/issues/31707
The plumbing is done via a new static variable `ParagraphBuilder.shouldDisableRoundingHack` that toggles the rounding behavior in skparagraph and the flag is read by framework code. Application code and test code can either use `ParagraphBuilder.setDisableRoundingHack` or `--dart-define="SKPARAGRAPH_REMOVE_ROUNDING_HACK=1"` to opt-in.
Once the internal migration is finished the default value of the flag will be set to true.
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
Most of the #include directives for SkPicture are removed except where they are still functional. Many comments rewritten to no longer be SkPicture-centric.
- DL unit tests still use it for consistency testing
- rasterizer/engine still use it for screen shot support
- Fuchsia still uses it extensively
The unit tests can run in parallel so running on a bigger machine gives a good speedup. This shaves ~10 minutes off of linux_unopt time. Some of the DisplayList unit tests go over the 120s limit, so this PR also bumps the default limit to 300s.
Dart is being removed from the Fuchsia SDK, so remove references to it
here.
Also remove references to workstation_eng and replace with terminal.
workstation_eng is no longer a thing.
To avoid analyzer warnings when utf8.encode() will return the more
precise Uint8List type, we use const Utf8Encoder().convert() which
already returns Uint8List
See https://github.com/dart-lang/sdk/issues/52801
For example, `_encodeParagraphStyle` says:
```dart
if (locale != null) {
result[0] |= 1 << 12;
// Passed separately to native.
}
```
We know `1<<12` is 4096.
On the other hand, the old code uses `0x800`, which is 2048.
And the strutStyle field is missing.
*Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.*
*List which issues are fixed by this PR. You must list at least one issue.*
*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
Re-submit the changes to enable windows pre-push checks.
This patch changes how `ci/bin/format.dart` generate diffs from `diff` and `patch` commands to `git diff` and `git apply` in order to have a common method for these operations on all platforms. Windows installations don't have diff and patch commands available by default and many implementations which provide such commands work differently than the UN*X tools. Git however works consistently across all platforms.
Additionally, this patch also changes the python executable in some of the pre-push components affected by this to `vpython3` to continue the effort started at flutter/flutter#108474 and I also removed the `--no-sound-null-safety` parameter in the ci/format.sh, ci/format.bat files
NOTE: Since the original patch caused some issues, I suggest that this should be tested more carefully before it is merged.
### Issues fixed by this PR
* flutter/flutter#108122
* flutter/flutter#107920
* flutter/flutter#86506
* flutter/flutter#106615
### [flutter/tests] repo impact
None.
writing and running engine tests.
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
This reverts commit 2b5c1f8d95c9c54e51787f5ceaeb142c0666aa72.
This is a straight reland without any additional changes. The package that was still using the outdated API causing the original revert has been updated in https://github.com/flutter/packages/pull/4233. **Do not land this until that PR has rolled into the framework.**
The destination buffer format may not exactly match the source format. In particular, the alpha type of the source may need to be converted to the alpha type of the destination.
Fixes https://github.com/flutter/flutter/issues/128102
Fixes https://github.com/flutter/flutter/issues/116070
Fixes https://github.com/flutter/flutter/issues/126202
Introduces `DlRegion` class which implements subset of `SkRegion`
required to get non-overlapping rectangles from region.
The implementation is different and faster than `SkRegion` for this
particular use-case (`display_list_region_benchmarks`):
Edit: Updated benchmark to latest revision and natively (initial run
went through rosetta)
```
----------------------------------------------------------------------------
Benchmark Time CPU Iterations
----------------------------------------------------------------------------
BM_RegionBenchmarkDlRegion/Tiny 616 us 616 us 908
BM_RegionBenchmarkSkRegion/Tiny 70559 us 70557 us 10
BM_RegionBenchmarkDlRegion/Small 1315 us 1314 us 537
BM_RegionBenchmarkSkRegion/Small 121736 us 121717 us 6
BM_RegionBenchmarkDlRegion/Medium 1079 us 1079 us 650
BM_RegionBenchmarkSkRegion/Medium 22039 us 22035 us 32
BM_RegionBenchmarkDlRegion/Large 399 us 399 us 1763
BM_RegionBenchmarkSkRegion/Large 1510 us 1510 us 466
```
## 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] and the [C++,
Objective-C, Java style guides].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [X] I added new tests to check the change I am making or feature I am
adding, or Hixie said the PR is test-exempt. See [testing the engine]
for instructions on writing and running engine tests.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [X] I signed the [CLA].
- [X] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
Part of an ongoing set of efforts to address https://github.com/flutter/flutter/issues/106448
Move the checkerboard layer unit tests onto the DisplayList version of the paint contexts and fix some bugs in the reusability of the DisplayListBuilder that this migration uncovered.
A mistake was introduced in https://github.com/flutter/engine/pull/39498 where the maskViews are already recycles each frame.
Sometimes a PlatformView does not need to be re-composite: (https://github.com/flutter/engine/blob/main/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm#L398-L401), so the mask view for such PlatformView should not be recycled.
This PR changed the `recycleMaskViews` API to allow individual maskviews to be recycled. `ApplyMutator` then only recycle the maskView for that particular PlatformView.
The MaskViewPool is also reworked to be simpler.
- The pool now contains a single set of mask views, there is no index counter needed.
- When a maskView is needed, try to get it from the pool.
- If pool is empty, create a new view.
- If pool has an available maskview, remove it from the pool.
- When a PlatformView starts to `applyMutator`, it removes current the maskView, insert the maskView to the pool.
- When the above PlatformView needs to a maskView, it grabs one from the pool.
fixes: https://github.com/flutter/flutter/issues/125620
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style