1325 Commits

Author SHA1 Message Date
auto-submit[bot]
90b6db8915 Reverts "Remove migration flag and unused header files" (flutter/engine#50229)
Reverts flutter/engine#50216
Initiated by: zanderso
This change reverts the following previous change:
Original Description:
The `applyRoundingHack` flag is no longer used by the framework. This also removes the [lib/ui/text/line_metrics.h](https://github.com/flutter/engine/pull/50216/files#diff-9175619f2b114dffef67eba38511b34afe6abefd4f697f4758647133895b34f5) file which doesn't seem to be referenced anywhere.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-02-01 03:47:16 +00:00
LongCatIsLooong
737437f718 Remove migration flag and unused header files (flutter/engine#50216)
The `applyRoundingHack` flag is no longer used by the framework. This also removes the [lib/ui/text/line_metrics.h](https://github.com/flutter/engine/pull/50216/files#diff-9175619f2b114dffef67eba38511b34afe6abefd4f697f4758647133895b34f5) file which doesn't seem to be referenced anywhere.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-02-01 00:36:16 +00:00
gaaclarke
c35dbe26fc [Impeller] implemented golden image tests for opengles (flutter/engine#50146)
fixes https://github.com/flutter/flutter/issues/142354

This sets up impeller_golden_tests to run with ANGLE.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-01-31 20:49:40 +00:00
Jenn Magder
12dc7ef814 Log FlutterJSONMessageCodec decode errors before asserting (flutter/engine#50163)
Logging JSON decode errors on assertion will help track down bugs.
https://github.com/flutter/flutter/issues/100891#issuecomment-1915946340

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-01-31 17:31:00 +00:00
zijiehe@
b2d8969566 [Fuchsia] Execute most of the testing/fuchsia/test_suites.yaml on debug and release builds (flutter/engine#50058)
This change implements a BundledTestRunner to run most of the tests in testing/fuchsia/test_suites.yaml as ExecutableTestRunner.

- Tests with packages out of out/fuchsia_*_x64/ are ignored for now.
- Tests with extra test command line parameters are ignored for now.

The BundledTestRunner can share most of the logic in ExecutableTestRunner and avoid reinventing the wheel.

This change also fixes the build break of fuchsia_tests in fuchsia_release_x64 which allows tests to run on the build as well.

- Tests not built with AOT are filtered out with variant field in test_suites.yaml.

Bug: https://github.com/flutter/flutter/issues/140179

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-01-31 05:39:21 +00:00
Michael Brase
c4608bbfd1 Use structured logging on Fuchsia (flutter/engine#49918)
This change migrates off of the old fuchsia logging apis to use the
structured logging apis. The initial FIDL connection is made during
global initialization (before main()) and the initial minimum log level
is queried from the system. Later on, once the main loop is initialized,
we setup an async task to listen for additional log interest changes
from the system. The advantage of doing this on the main loop is that we
avoid spawning an additional background thread in the process (the
legacy logging apis use the background thread approach).

One added benefit of this change is it reduces the size of the
dart/flutter runner far packages by about 250kb in release mode, because
libsyslog.so and libbackend_fuchsia_globals.so are no longer needed.

flutter/flutter#141924

## 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 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
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[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
2024-01-29 22:26:47 -06:00
Dan Field
7d955bfd7c Followups to screenshot patch (flutter/engine#50096)
@gaaclarke
2024-01-26 23:43:05 +00:00
Alexander Aprelev
a280f771c4 Roll dart to 3.4.0-79.0.dev (flutter/engine#50100)
Changes since last roll
```
58665e3dee4 Version 3.4.0-79.0.dev
6b0b4d425b0 Macro. Keep FileState for macro file, refresh if its content changes.
f4c3572c18a [deps] Rev `native` packages.
f4dae883559 [co19] Roll co19 to af2ac968c0ca28b7dd94325b00a3acf569f6e858
e2aac0b8e86 [web docs] add package:web to the main sdk docs - api.dart.dev
3d4a39e9c24 Revert "Revert two CLs that remove WithoutNullSafetyMixin usages."
20a27fee111 Fix for data driven rename when class is used in as expression
ecb5fc2228a [dart2wasm] Improve dispatch table packing from 49% to 99%
cdad90dfb81 [frontend_server] frontend_server_flutter_suite
```
Requires manual roll due to ffi package move as part of `f4c3572c18a`.
2024-01-26 22:45:47 +00:00
Matan Lurey
74d78673d9 Introduce a prototype of a "header guard enforcement" tool (flutter/engine#48903)
Closes https://github.com/flutter/flutter/issues/133415.

---

This is a prototype I threw together in about 1-2 hours. It enforces and
automatically fixes header guards that don't match the [the Google C++
style
guide](https://google.github.io/styleguide/cppguide.html#The__define_Guard).
For example, here is (trimmed) output at HEAD:

```txt
line 5, column 1 of impeller/aiks/picture.h: Unexpected #pragma once
  ╷
5 │ #pragma once
  │ ^^^^^^^^^^^^
  ╵
line 5, column 1 of flow/stopwatch.h: Expected #ifndef FLUTTER_FLOW_STOPWATCH_H_
  ╷
5 │ #ifndef FLUTTER_FLOW_INSTRUMENTATION_H_
  │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  ╵
The following 731 files have invalid header guards:
```
2024-01-26 13:15:56 -08:00
Matan Lurey
e9e5a237f8 Finish landing missing/incorrect header guards across flutter/engine (flutter/engine#50069)
Generated by https://github.com/flutter/engine/pull/48903 (`dart ./tools/header_guard_check/bin/main.dart --fix`).

As discussed with @cbracken and @jmagman, the guards are not technically needed on the Mac/iOS code, but they (a) do not hurt and (b) still provide value if for some reason `#include` is used instead of `#import` (though I suspect we could try to add that to the tool in the future as well).
2024-01-26 19:42:36 +00:00
Dan Field
ce731f3716 Fix Shell::Screenshot for Impeller (flutter/engine#50072)
Fixes https://github.com/flutter/flutter/issues/141571

Shell::Screenshot was impelemnted in a Skia-only way and would crash when invoked. Adds test coverage for the breaking path on iOS that ends up calling `FlutterView drawLayer`.
2024-01-26 17:17:32 +00:00
zijiehe@
538d967f7c [Fuchsia] Redo - Use chromium test-scripts to download images and execute tests (flutter/engine#49940)
This change is a redo of https://github.com/flutter/engine/pull/49847.

https://github.com/zijiehe-google-com/engine/compare/4530942..main
should show the diff between this and the original change; mainly fixes
the https://github.com/flutter/flutter/issues/141907.

Following paragraph is copied from the original change.

This change can be executed from buildroot by

```
python3 flutter/tools/fuchsia/with_envs.py flutter/testing/fuchsia/run_tests.py
```

Bug: https://github.com/flutter/flutter/issues/140179

- [V] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [V] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [V] I read and followed the [Flutter Style Guide] and the [C++,
Objective-C, Java style guides].
- [V] I listed at least one issue that this PR fixes in the description
above.
- [V] I added new tests to check the change I am making or feature I am
adding, or the PR is [test-exempt]. See [testing the engine] for
instructions on writing and running engine tests.
- [V] I updated/added relevant documentation (doc comments with `///`).
- [V] I signed the [CLA].
- [V] All existing and new tests are passing.
2024-01-25 11:58:03 +00:00
Jonah Williams
6f0249a062 [ui] hold a strong reference to fragment program objects. (flutter/engine#49868)
The native engine needs to hold a strong reference to fragment programs. So the dart side holding a weak ref is more or less pointless
2024-01-24 00:08:24 +00:00
auto-submit[bot]
07034d9f1d Reverts "[Fuchsia] Redo - Use chromium test-scripts to download images and execute tests" (flutter/engine#49908)
Reverts flutter/engine#49847
Initiated by: zanderso
This change reverts the following previous change:
Original Description:
This change is a redo of https://github.com/flutter/engine/pull/49650.

https://github.com/zijiehe-google-com/engine/compare/de5c713..main should show the diff between this and the original change.

Following paragraph is copied from the original change.

This change requires https://github.com/flutter/buildroot/pull/811, and can be executed from buildroot by

```
python3 flutter/tools/fuchsia/with_envs.py flutter/testing/fuchsia/run_tests.py
```

Bug: https://github.com/flutter/flutter/issues/140179

- [V] I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
- [V] I read the [Tree Hygiene] wiki page, which explains my responsibilities.
- [V] I read and followed the [Flutter Style Guide] and the [C++, Objective-C, Java style guides].
- [V] I listed at least one issue that this PR fixes in the description above.
- [V] I added new tests to check the change I am making or feature I am adding, or the PR is [test-exempt]. See [testing the engine] for instructions on writing and running engine tests.
- [V] I updated/added relevant documentation (doc comments with `///`).
- [V] I signed the [CLA].
- [V] All existing and new tests are passing.
2024-01-19 22:22:25 +00:00
zijiehe@
0f1211b660 [Fuchsia] Redo - Use chromium test-scripts to download images and execute tests (flutter/engine#49847)
This change is a redo of https://github.com/flutter/engine/pull/49650.

https://github.com/zijiehe-google-com/engine/compare/de5c713..main
should show the diff between this and the original change.

Following paragraph is copied from the original change.

This change requires https://github.com/flutter/buildroot/pull/811, and
can be executed from buildroot by

```
python3 flutter/tools/fuchsia/with_envs.py flutter/testing/fuchsia/run_tests.py
```

Bug: https://github.com/flutter/flutter/issues/140179

## Pre-launch Checklist

- [V] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [V] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [V] I read and followed the [Flutter Style Guide] and the [C++,
Objective-C, Java style guides].
- [V] I listed at least one issue that this PR fixes in the description
above.
- [V] I added new tests to check the change I am making or feature I am
adding, or the PR is [test-exempt]. See [testing the engine] for
instructions on writing and running engine tests.
- [V] I updated/added relevant documentation (doc comments with `///`).
- [V] I signed the [CLA].
- [V] All existing and new tests are passing.
2024-01-19 09:36:56 -08:00
Victoria Ashworth
0c7d05da12 Update tests to Xcode 15 and iOS 17 simulator (flutter/engine#49833)
Engine part of https://github.com/flutter/flutter/issues/132237.

Also, fixes https://github.com/flutter/flutter/issues/125227.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-01-18 16:07:54 +00:00
Brandon DeRosier
c38b3676d9 [Flutter GPU] Run unittests on CI and fix HostBuffer. (flutter/engine#49789)
The Flutter GPU tests were broken, and it turns out that I had never set them up to run on CI. This fixes the HostBuffer and gets the test suite running on CI.
2024-01-16 19:01:54 +00:00
auto-submit[bot]
b174774059 Reverts "[Fuchsia] Use chromium test-scripts to download images and execute tests" (flutter/engine#49772)
Reverts flutter/engine#49650
Initiated by: CaseyHillers
This change reverts the following previous change:
Original Description:
This change requires https://github.com/flutter/buildroot/pull/811, and can be executed from buildroot by

```
python3 flutter/tools/fuchsia/with_envs.py flutter/testing/fuchsia/run_tests.py
```

Bug: https://github.com/flutter/flutter/issues/140179

- [V] I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
- [V] I read the [Tree Hygiene] wiki page, which explains my responsibilities.
- [V] I read and followed the [Flutter Style Guide] and the [C++, Objective-C, Java style guides].
- [V] I listed at least one issue that this PR fixes in the description above.
- [V] I added new tests to check the change I am making or feature I am adding, or the PR is [test-exempt]. See [testing the engine] for instructions on writing and running engine tests.
- [V] I updated/added relevant documentation (doc comments with `///`).
- [V] I signed the [CLA].
- [V] All existing and new tests are passing.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-01-12 19:30:29 +00:00
zijiehe@
cc3c0eeca9 [Fuchsia] Use chromium test-scripts to download images and execute tests (flutter/engine#49650)
This change requires https://github.com/flutter/buildroot/pull/811, and can be executed from buildroot by

```
python3 flutter/tools/fuchsia/with_envs.py flutter/testing/fuchsia/run_tests.py
```

Bug: https://github.com/flutter/flutter/issues/140179

- [V] I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
- [V] I read the [Tree Hygiene] wiki page, which explains my responsibilities.
- [V] I read and followed the [Flutter Style Guide] and the [C++, Objective-C, Java style guides].
- [V] I listed at least one issue that this PR fixes in the description above.
- [V] I added new tests to check the change I am making or feature I am adding, or the PR is [test-exempt]. See [testing the engine] for instructions on writing and running engine tests.
- [V] I updated/added relevant documentation (doc comments with `///`).
- [V] I signed the [CLA].
- [V] All existing and new tests are passing.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-01-12 17:04:31 +00:00
Dan Field
90ee2f7711 Try to get GLES tests running... (flutter/engine#49701)
I plan to fix the GLES fragment program reload issue, but first want to make sure this gets some failures for it.

Added a few skips for shaders that require an extension not available on CI (mipmap related ones).

Updated a couple tests that were failing.
2024-01-11 17:32:13 +00:00
Zachary Anderson
96ff752fd7 Skip flaky test on mac in http_disallow_http_connections_test.dart (flutter/engine#49635)
Related https://github.com/flutter/flutter/issues/141149
2024-01-09 09:10:32 -08:00
Dan Field
3078ba7036 Allow spawning additional UI isolates in flutter_tester (flutter/engine#48706)
This enables work ongoing by @derekxu16 to improve performance in flutter_tester when running multiple files from large test suites.

Specifically, it:

- Exposes a `Spawn` C symbol from flutter_tester that runs the current kernel in a new UI isolate with a different entrypoint and/or route name
- Exposes two symbols from flutter_tester to allow a test harness to more efficiently load particular kernel files or to lookup an entrypoint from an imported source file.
- Avoids re-loading the kernel file completely when spawning a new UI isolate

Googlers can look at go/flutter-tester-isolates for some more context. If anyone wants I'm happy to create a public version of that doc.
2024-01-05 17:13:59 +00:00
Dan Field
76fc29312f Make sure to finish the suite if all tests are skipped (flutter/engine#49339)
Fixes https://github.com/flutter/flutter/issues/140481

Before this fix, if all tests are skipped, the `onDone` callback never fires, which means the recieve port never closes, which means the process just hangs indefinitely (and the success message is never printed).
2024-01-02 18:34:04 +00:00
Jenn Magder
e7d1af70f1 Turn on scenario app screenshots (flutter/engine#49066)
Save a recording/screenshot to the uploaded xcresult when a Scenario test fails.

<img width="1052" alt="Screenshot 2023-12-14 at 6 34 47 PM" src="https://github.com/flutter/engine/assets/682784/c1294497-28f6-4400-b21c-da689a224dc4">

<img width="244" alt="Screenshot 2023-12-14 at 6 41 03 PM" src="https://github.com/flutter/engine/assets/682784/f769dd5f-a71b-4320-b9ef-64eac722166a">

No more errant spew as reported in https://github.com/flutter/engine/pull/19668 when this was originally turned off.
```
 Test Case '-[StatusBarTest testTapStatusBar]' started.
     t =     0.00s Start Test at 2023-12-14 18:20:34.207
...
     t =     2.69s     Synthesize event
     t =     2.70s         Find the StatusBar at {{0.0, 0.0}, {375.0, 20.0}}
     t =     2.72s         Find the StatusBar at {{0.0, 0.0}, {375.0, 20.0}}
     t =     2.74s         Find the StatusBar at {{0.0, 0.0}, {375.0, 20.0}}
     t =     3.03s     Wait for com.apple.springboard to idle
     t =     3.43s Waiting 1.0s for "0,PointerChange.add,device=0,buttons=0,signalKind=PointerSignalKind.none" TextField to exist
     t =     4.43s     Checking `Expect predicate `exists == 1` for object "0,PointerChange.add,device=0,buttons=0,signalKind=PointerSignalKind.none" TextField`
     t =     4.43s         Checking existence of `"0,PointerChange.add,device=0,buttons=0,signalKind=PointerSignalKind.none" TextField`
     t =     4.45s         Capturing element debug description
     t =     4.45s Checking existence of `"0,PointerChange.add,device=0,buttons=0,signalKind=PointerSignalKind.none" TextField`
 /Volumes/Work/s/w/ir/cache/builder/src/out/ios_debug_sim/scenario_app/Scenarios/ScenariosUITests/StatusBarTest.m:37: error: -[StatusBarTest testTapStatusBar] : ((exists) is true) failed
     t =     4.48s Tear Down
```
https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8761683198070320113/+/u/test:_Scenario_App_Integration_Tests__3_/stdout

Fixes https://github.com/flutter/flutter/issues/140192

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-12-21 19:01:15 +00:00
Jim Graham
910a5fa5d8 Ensure sorted rects in ui.Canvas for legacy compatibility (flutter/engine#49309)
Fixes https://github.com/flutter/flutter/issues/140490
2023-12-21 08:34:23 +00:00
Dan Field
ae9289f5c1 [Impeller] Make IPLR files multi-platform (flutter/engine#49253)
This is part of the work towards supporting OpenGLES and Vulkan for runtime stage shaders.

Removes some redundant work we had around SkSL. Now only bundles the shaders we actually ask for from the command line.

@bdero, we should figure out if this is the right approach for flutter_gpu.

With this change, the IPLR format goes from having a root table of shader related information to a root table of shader information per `sksl`, `metal`, `opengles`, and `vulkan` platforms. 

This may end up allowing us to revert https://github.com/flutter/engine/pull/47278, but I'm not sure I understand all the implications of that at this point.

I have run some but not all tests locally.
2023-12-21 06:17:26 +00:00
Victoria Ashworth
75cf8ed82c Fix testAppExtensionLaunching for Xcode 15/iOS 17 (flutter/engine#49242)
Fixes https://github.com/flutter/flutter/issues/140181.

Example of fix working on macOS 13 with Xcode 15 and iOS 17 simulator: https://ci.chromium.org/ui/p/flutter/builders/try/Mac%20Engine%20Drone/586366/overview

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-12-20 16:58:19 +00:00
Michael Goderbauer
dbfad3bfed Sync lints with flutter/flutter (flutter/engine#49192) 2023-12-20 01:12:30 +00:00
Bartek Pacia
61a61a8632 [Docs] Add more info about running tests on iOS (flutter/engine#48859)
I wish this info was there, that'd save me from looking inside the script.
2023-12-19 22:54:54 +00:00
Tong Mu
927fd200ed Revert "Reland 2: Multiview Pipeline (#47239)" (flutter/engine#49238)
This reverts commit 87171e73397f7edfd4c145fbaebdd7208954debf.

Internal performance test shows that this PR negatively affects startup time. I'll reland this PR in parts.

b/307872797

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-12-19 22:30:01 +00:00
Jim Graham
57c1db2af6 Make sure run_tests.py runs dart tests on Skia (flutter/engine#49260)
Today the default renderer on hosts is Skia, but if we ever change the default then we will be testing on Impeller+default(Impeller) rather than both Skia and Impeller. Change the flutter_tester launch arguments to explicitly disable Impeller when we want to test Skia so that we will always test on both platforms.
2023-12-19 21:51:09 +00:00
Matej Knopp
33a6339c63 Add FlutterMetalLayer as optional alternative to CAMetalLayer (flutter/engine#48226)
This PR implements `FlutterMetalLayer`, a drop-in (as far as Flutter is
concerned) replacement for `CAMetalLayer`. The biggest difference is
that `FlutterMetalLayer` can present frames from background thread
within a `CATransaction`.

`FlutterMetalLayer` is disabled by default. To opt-in, add the following
item to `Info.plist`:

```xml
        <key>FLTUseFlutterMetalLayer</key>
	<true/>
```

The performance seems quite good, consistent 120hz on iPhone 13 Pro.

Benefits
- presenting with transaction from background thread, which, down the
line, would allow for platform views without thread merging.
- fine control over how the surface is displayed - we can display single
surface on multiple `CALayers`, each showing different part, allowing
for performant implementation of unobstructed platform views.
 
Drawbacks
- this not being a metal layer makes working with metal instrument tools
more awkward
2023-12-16 21:53:32 +01:00
Matan Lurey
3aae0411b7 Automatically fix header guards in the rest of the flutter/engine repo. (flutter/engine#49059) 2023-12-15 04:11:06 +00:00
Matan Lurey
2ecbd2ff7d Rename font-subset to font_subset. (flutter/engine#49051)
For consistency, I don't think we have any other tools with `-`'s.

I'll be honest - this seemed easier than teaching the header guard tool
how to handle `-`'s in directory names, but if you feel strongly about
it I can revert.
2023-12-14 15:16:09 -08:00
LongCatIsLooong
63dabdd2e0 Add a constructor for GlyphInfo. (flutter/engine#48971)
Needed for https://github.com/flutter/flutter/pull/139717

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-12-13 18:01:47 +00:00
Matan Lurey
09ba20cb6a Move third_party/swiftshader, roll buildroot DEPS. (flutter/engine#48946)
Progress towards https://github.com/flutter/flutter/issues/67373, synced with 0141e94b34.
2023-12-12 22:23:02 +00:00
Bartek Pacia
d3b6e4044d SemanticsUpdateBuilder migration: introduce identifier (flutter/engine#48882)
This PR adds `String? identifier` to `SemanticsUpdateBuilder` (currently it's only available in the temproary `SemanticsUpdateBuilderNew` API.

This is mainly targeted at https://github.com/flutter/flutter/issues/17988

Steps:
part 1: [engine] add `SemanticsUpdateBuilderNew` https://github.com/flutter/engine/pull/47961
part 2: [flutter] use `SemanticsUpdateBuilderNew`  https://github.com/flutter/flutter/pull/138331
**part 3: [engine] update `SemanticsUpdateBuilder` to be the same as `SemanticsUpdateBuilderNew`** <-- we are here
part 4: [flutter] use (now updated) `SemanticsUpdateBuilder` again.
part 5: [engine] remove `SemanticsBuilderNew`
2023-12-11 22:35:07 +00:00
Zachary Anderson
63e00ce106 Fix _availability_version_check for iOS 11 and 12 (flutter/engine#48624)
This PR ports more of the implementation of availability checking from
clang-rt into the Engine. In particular, when the call to look up the
symbol `_availability_version_check` fails, this PR falls back on
reading the platform version information out of a plist file at a
well-known location, as is done
[here](2fd66e6eb6/compiler-rt/lib/builtins/os_version_check.c (L163)).

This change fixes a mistake in
https://github.com/flutter/engine/pull/44711, which didn't account for
`_availability_version_check` not being available on iOS 11 and 12.

Fixes https://github.com/flutter/flutter/issues/138711
2023-12-11 11:51:55 -08:00
Victoria Ashworth
2d2423b0f2 Skip unexpected events in MultiPlatformViewBackgroundForegroundScenario (flutter/engine#48456)
Fixes https://github.com/flutter/flutter/issues/138193.

Was first attempted to fix in https://github.com/flutter/engine/pull/48096, but that was not reliable since it's all asynchronous. 

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-11-28 19:53:09 +00:00
Jonah Williams
91b78cc361 [Impeller] Add benchmarks that measure the time it takes to record canvas operations. (flutter/engine#48374)
This benchmark includes things like allocating geometry/contents, path conversions, et cetera. It doesn't include dispatching or GPU work, but should make it easier to see improvements/regressions in the efficiency of this code.
2023-11-28 03:06:53 +00:00
Michael Goderbauer
136f4a03c4 Dynamic view sizing [dart:ui] (flutter/engine#48090)
Towards https://github.com/flutter/flutter/issues/134501.

This PR makes the following changes to the public dart:ui API:

* It adds the `FlutterView.pysicalConstraints` property that describes max and min width and height for a view. The framework is allowed to size the `FlutterView` to any `Size` that meets these constraints.
* It adds an optional `size` argument to `FlutterView.render`. The framework provides the chosen `Size` that meets the aforementioned constraints to the `render` method. If the `FlutterView.pysicalConstraints` are tight (minHeight == maxHeight and minWidth == maxWidth) the argument is optional to remain backwards compatible. In all other cases, a `Size` must be provided.
* It adds a `ViewConstraints` class, which is basically the `dart:ui` version of `BoxConstraints` (This is similar to how we have `ViewPadding` in dart:ui to mirror `EdgeInsets` from the framework). It describes the constraints of a `FlutterView`, i.e. it powers the `FlutterView.pysicalConstraints` property.

This change does not wire anything up to the embedders. For now, `FlutterView.pysicalConstraints` just returns tight constraints for the embedder-provided size of the view (`FlutterView.physicalSize`) and the size provided to `FlutterView.render` is ignored (after it is checked that it meets the constrains). 

This PR enables the framework to implement the new dynamic view sizing and embedders to separately expose the new functionality to their clients.

Presubmits will fail until https://github.com/flutter/flutter/pull/138565 is submitted to the framework.

**DO NOT SUBMIT until https://github.com/flutter/flutter/pull/138648 is ready.**
2023-11-27 22:33:59 +00:00
LongCatIsLooong
59a5579465 Expose a few more glyph apis from ui.Paragraph (flutter/engine#47698)
Add 2 methods for querying glyph-related metrics

```dart
  GlyphInfo? getClosestGlyphInfoForOffset(Offset offset); 
  GlyphInfo? getGlyphInfoAt(int codeUnitOffset);
```

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-11-22 18:04:13 +00:00
Matan Lurey
7cc1f2f98c [Impeller] Write a text-decoration test at the dart:ui layer (flutter/engine#48101)
Closes https://github.com/flutter/flutter/issues/138501.

---

It would be nice to turn this into a test-fixture, and create a better local environment.

Here is how to run it locally:

```bash
# The test expects you to be PWD in the `src` directory or it crashes.
cd $ENGINE_SRC

out/host_debug_unopt_arm64/flutter_tester \
  --force-multithreading \
  --disable-observatory \
  --use-test-fonts \
  --icu-data-file-path=out/host_debug_unopt_arm64/icudtl.dat \
  --flutter-assets-dir=out/host_debug_unopt_arm64/gen/flutter/lib/ui/assets \
  --disable-asset-fonts \
  --enable-impeller \
  out/host_debug_unopt_arm64/gen/canvas_test.dart.dill

# "See" the output goldens.
open out/host_debug_unopt_arm64/gen/skia_gold_canvas_test.dart
```

![image](https://github.com/flutter/engine/assets/168174/3deeab8d-409d-4b2e-8bdf-1cae272636f8)
2023-11-20 21:07:05 +00:00
Zachary Anderson
aa3f8e61c1 Moves expat, ocmock, libjpeg-turbo, libwebp, and wuffs to //flutter/third_party (flutter/engine#48193)
As part of eliminating the Flutter buildroot
(https://github.com/flutter/flutter/issues/67373), we are moving all
third-party dependencies from //third_party to //flutter/third_party.

Once all third-party dependencies have been migrated, tooling and config
will be moved and the buildroot will be eliminated altogether.

No tests changed because there is no semantic change to this PR. This is
simply relocating a dependency.

This PR moves expat, ocmock, libjpeg-turbo, libwebp, and wuffs to
//flutter/third_party.

It also deletes //third_party/fontconfig, which was unused.
2023-11-19 22:53:29 -08:00
Matan Lurey
ddce052e36 Make testing/... and vulkan/... compatible with .clang-tidy. (flutter/engine#48161) 2023-11-17 15:16:31 -08:00
Victoria Ashworth
cbd9e7a1fa Reenable UnobstructedPlatformViewTests testMultiplePlatformViewsWithOverlays (flutter/engine#48139)
Renable test now that https://github.com/flutter/flutter/issues/138193 is fixed.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-11-17 16:08:02 +00:00
Dan Field
89ff1d0d8b Only run systrace test on API 29+, avoid building scenario app for 28 (flutter/engine#48163)
The emulator tests I added yesterday are failing because the systrace python test script uses features introduced in API 29, which causes the `perfetto` invocation to fail.

It's not essential that we run this test on lower API levels, so instead I'm making the script bail out in this case.

Other than that, the shard seems to be consistently passing, so I'm removing bringup.
2023-11-17 02:20:51 +00:00
Victoria Ashworth
1cb5474a11 Fix race condition in Unobstructed Platform View Scenario tests (flutter/engine#48096)
Fixes race situation where `_onPlatformMessage` is triggered before the first frame, essentially skipping the first frame.

Fixes https://github.com/flutter/flutter/issues/138193.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-11-16 19:02:57 +00:00
Matan Lurey
933bd94016 Make flow/... compatible with .clang_tidy. (flutter/engine#47995)
Work towards https://github.com/flutter/flutter/issues/134969.

All changes were made automatically (i.e. with `--fix`).
2023-11-16 08:41:10 -08:00
Jason Simmons
a9c9177d35 In the scenario game loop test, cancel the results writer task if the activity has been destroyed (flutter/engine#48051)
This test is run on Firebase Test Lab, and crashes have been reported on CI if this task executes when the activity is in a destroyed state.

See https://github.com/flutter/flutter/issues/138451
2023-11-15 17:10:49 +00:00