1446 Commits

Author SHA1 Message Date
Chinmay Garde
cf0b9e869c A native Android unit-testing harness. (flutter/engine#51479)
Sets up rules to create an APK that is comprised of solely native code. Existing executable targets (like GTests) can then use this to run on Android devices while having access to activities, windows, etc.. This allows for broader test coverage. Basically, anything that needed an ANativeWindow could only be tested in an integration test.

Executables that need access to the native activity must provide an implementation of `NativeActivityMain` that returns a custom subclass of `flutter::NativeActivity`. The `native_activity_apk` reads like an `executable` or `shared_library` target. Just one that packages that executable in an APK.

The APK is built using the Android Tools and does not use Gradle. Creating a new APK after invalidating some code takes ~200ms on my machine. The edit, compile, run cycle for only a tiny bit worse than testing on the host.

Builds on top of this new infrastructure to create a `GTestActivity` that runs an existing test suites. This works really well except the GTest suite logs to `STDOUT` whereas the engine logs to `logcat`. To quickly work around this, a custom test status listener has been wired up. This only displays the test results to logcat today but a similar mechanism can be used to talk to the test runner in the host. I will wire this up in an upcoming patch as there is no hooks into this from CI right now.

Creates an APK variant of the `impeller_toolkit_android_unittests` harness.
2024-03-18 22:32:08 +00:00
Jason Simmons
0daed16f21 Write recent logcat output to the LUCI log directory if an Android unit test fails (flutter/engine#51462) 2024-03-18 19:01:18 +00:00
Jenn Magder
d30a412e28 Support accessibility back gesture to pop route from view controller (flutter/engine#51241)
Adapted suggestion from https://github.com/flutter/flutter/issues/74246#issuecomment-971326926 to pop the route if the view controller route if `accessibilityPerformEscape` is called at that level in the responder chain.

Ideally this could know if the route was successfully popped, and only then return `YES` (halting propagation through the responder chain).

I confirmed by editing https://docs.flutter.dev/cookbook/navigation/navigation-basics#interactive-example as a demo that that the two-finger scrub (move two fingers back and forth three times quickly, making a "z") navigates back to the last route, and that the [`SementicObject`](e889b287f1/shell/platform/darwin/ios/framework/Source/SemanticsObject.mm (L763)) scrub, which already worked, continued to work.

I'm not super familiar with this code, hopefully there aren't further gotchas I'm not thinking of.

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

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-03-18 18:11:59 +00:00
gaaclarke
076f29066c [Impeller] make sure to render TiledTextureContents if the geometry doesn't fit in the texture's bounds. (flutter/engine#51393)
fixes https://github.com/flutter/flutter/issues/144836

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-03-18 16:13:03 +00:00
Zachary Anderson
66fa3dd66c Pass some missing --disable-dart-dev and --suppress-analytics to dart (flutter/engine#51473) 2024-03-17 08:46:11 -07:00
Jim Graham
a3fa6b7ab0 Reland "Add DisplayList Region and Transform benchmarks to CI" (flutter/engine#51458)
Reverts https://github.com/flutter/engine/pull/51432

Originally landed as https://github.com/flutter/engine/pull/51429, but the appropriate executables were not listed in the standalone build files.
2024-03-16 01:24:20 +00:00
Chinmay Garde
695a720ded Re-land "[Impeller] A toolkit for managed handles to Android NDK vended objects." (flutter/engine#51460)
This reverts commit 037aa6b4caa6a3a726e67e519324b2c0a1ec274a.

The original cause of the revert was a flake introduced because the unit-test could request a frame from the Choreographer if it ran long enough. The availability checks in the choreographer were inaccurate after we intentionally backed out of using the Callback32 variant on 32 bit platforms.

The new tests didn't catch it because of an unrelated issue. In the first version of the patch for review, the proc table was only supposed to run on API levels 29 and above. When @dnfield requested we also get rid of the NDK helpers, the choreographer and additional utilities were added. But the API level gate in the new test harness wasn't removed. This made the tests be skipped. That gate has been removed entirely now. The error that cause the revert because of flakiness will now be a reliable failure.
2024-03-16 00:15:07 +00:00
Matan Lurey
4fc6efad78 Log messages when an image successfully uploads to Skia Gold (flutter/engine#51455)
Work towards https://github.com/flutter/flutter/issues/145219.

Combined with https://github.com/flutter/engine/pull/51454, we should be more "sure" that (a) Skia Gold is getting every image we're uploading and (b) Flutter Gold is correctly flagging untriaged images.

/cc @gaaclarke
2024-03-15 21:44:06 +00:00
Matan Lurey
2d4c61e417 Add more explicit logging (just to stderr) if a try-job detects an untriaged image (flutter/engine#51454)
Work towards https://github.com/flutter/flutter/issues/145219.

Previously all logging would be silent in the case that `test_foo` uploads a digest that is considered "untriaged", and we'd be entirely reliant on the `flutter-gold` check to pick this up asynchronously. 

As part of debugging https://github.com/flutter/flutter/issues/145219 (but probably to keep this code indefinitely, it's not harmful), we now unconditionally log the swallowed failures to `stderr` so they will show up in our LUCI logs.

/cc @gaaclarke @jonahwilliams
2024-03-15 21:44:04 +00:00
auto-submit[bot]
037aa6b4ca Reverts "[Impeller] A toolkit for managed handles to Android NDK vended objects. (#51334)" (flutter/engine#51457)
Reverts: flutter/engine#51334
Initiated by: matanlurey
Reason for reverting: Broke engine post-submit, see https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8753367119442265873/+/u/test:_Android_Unit_Tests__API_28_/stdout.
Original PR Author: chinmaygarde

Reviewed By: {dnfield}

This change reverts the following previous change:
Only available on Android device API levels >= 29. Proc table is setup has versioning checks. All handles are type safe. Collection of handles takes into account cleanup tasks (like reparenting surface controls). The proc table contains code duplicated in ndk_helpers and I will remove that in favor of this in a subsequent patch.

Part of https://github.com/flutter/engine/pull/51213 being chopped up.
2024-03-15 21:35:37 +00:00
Chinmay Garde
38ec9b7328 [Impeller] A toolkit for managed handles to Android NDK vended objects. (flutter/engine#51334)
Only available on Android device API levels >= 29. Proc table is setup has versioning checks. All handles are type safe. Collection of handles takes into account cleanup tasks (like reparenting surface controls). The proc table contains code duplicated in ndk_helpers and I will remove that in favor of this in a subsequent patch.

Part of https://github.com/flutter/engine/pull/51213 being chopped up.
2024-03-15 20:45:15 +00:00
Jim Graham
3942f01773 [DisplayList] Pre-Compute saveLayer bounds in DLBuilder (flutter/engine#50935)
Previously the DisplayListBuilder would only pass along bounds for a saveLayer when they were supplied by the caller that was building the DisplayList. This would require Impeller to use post-processing of the EntityPass lists to compute them on its own.

DisplayList can now compute those bounds as it builds the DisplayList to save dispatch clients from having to do so on their own. It will also provide an indicator in the case when the caller supplied bounds that ended up being too small to capture all of the content, causing clipping by the layer render target.
2024-03-15 17:45:05 +00:00
Dan Field
bc4ed312b3 Add a pixel test to cover multiple clips with a BDF (flutter/engine#51431)
Same test as in https://github.com/flutter/engine/pull/51416.

This test should pass without the revert here because the StC related changes make the optimized path work again.
2024-03-15 17:39:08 +00:00
Matan Lurey
f223f5044b Remove the Android-drawn surface rendering from scenario_app. (flutter/engine#51433)
Closes https://github.com/flutter/flutter/issues/144365.

Wasn't able to delete as much as I wanted (it's used by the video-rendering code path), but it should fix the problem we're seeing. I expect this change to remove the bottom (Android-rendered) image from our golden files for `ExternalTexturesTests`.
2024-03-15 03:18:21 +00:00
auto-submit[bot]
3f6a94fb39 Reverts "Add DisplayList Region and Transform benchmarks to CI (#51429)" (flutter/engine#51432)
Reverts: flutter/engine#51429
Initiated by: bdero
Reason for reverting: Engine tree breakage

```
+ /b/s/w/ir/cache/builder/src/out/host_release/display_list_region_benchmarks --benchmark_format=json
/b/s/w/ir/cache/builder/src/flutter/testing/benchmark/generate_metrics.sh: line 17: /b/s/w/ir/cache/builder/src/out/host_release/display_list_region_benchmarks: No such file or directory
```
Original PR Author: flar

Reviewed By: {godofredoc}

This change reverts the following previous change:
These benchmark results aren't shown in Skia perf because they were never added to the CI tasks to run.
2024-03-14 23:06:26 +00:00
Jim Graham
48d118fb05 Add DisplayList Region and Transform benchmarks to CI (flutter/engine#51429)
These benchmark results aren't shown in Skia perf because they were never added to the CI tasks to run.
2024-03-14 22:41:31 +00:00
Matan Lurey
d4cb8de3ba Reduce code-duplication a bit and add more error context across SkiaGoldClient. (flutter/engine#51426)
- Replaced manual `StringBuffer()..writeln('stdout: ...')` with a single
`SkiaGoldProcessError` constructor.
- Updated tests to make sure it's working.

_/cc @dnfield @jonahwilliams FYI only._
2024-03-14 14:55:40 -07:00
Matan Lurey
31b0fb1ea3 Remove or replaced unused or duplicate code in SkiaGoldClient. (flutter/engine#51399)
- `get isAvailable` -> `SkiaGoldClient.isAvailable()`
- `get isLuciEnv` -> `SkiaGoldClient.isLuciEnv()`
- Remove unused `SkiaGoldHttpOverrides`
2024-03-14 08:45:34 -07:00
gaaclarke
0c6a230ad2 [Impeller] added missing golden test for DrawScaledTextWithPerspectiveSaveLayer (flutter/engine#51368)
related:
 - https://github.com/flutter/flutter/issues/130633
 - https://github.com/flutter/engine/pull/51343

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-03-13 17:49:49 +00:00
Jonah Williams
674874e613 [Impeller] attempt to get validation errors from CI unittests. (flutter/engine#51341)
Enables Vulkan validation layers for macOS and linux builds, enables macOS validation for macOS builds.

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

There may still be remaining issues with macOS validation, I need to verify I can reproduce https://github.com/flutter/flutter/issues/143324 . I plan to do that separately
2024-03-13 17:35:58 +00:00
Jonah Williams
3b105855ac [scenario app] make image matching fuzzier. (flutter/engine#51376)
Attempt to work around the minor 1px differences from
https://github.com/flutter/flutter/issues/145058
2024-03-13 09:50:50 -07:00
Gray Mackall
25865c11b1 Try making android scenario app not do animations (flutter/engine#51349)
Skips animations

Looks like this, for reference:
[no_animation_example.webm](https://github.com/flutter/engine/assets/34871572/0c8665a3-b546-4bbd-b7e1-00851c48e1ff)

(This is the animation from https://github.com/flutter/engine/pull/51329, so note that the first test looks weird because I lagged my emulator by alt tabbing).

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-03-12 17:03:18 +00:00
gaaclarke
06027becb6 [Impeller] implements blur styles for gradients (flutter/engine#51264)
fixes https://github.com/flutter/flutter/issues/144449

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-03-12 00:05:19 +00:00
Gray Mackall
9eedb6ab86 Make scenario app have translucent splash screen so it doesn't affect screenshot colors (flutter/engine#51329)
Makes the scenario app splash screen have a translucent color, so it doesn't end up overlaying on screenshots.

Before:
[device-2024-03-07-152047.webm](https://github.com/flutter/flutter/assets/34871572/a9b7a1f9-57ab-4eda-93e5-5ca70032cbef)

After:
[translucentsplash.webm](https://github.com/flutter/engine/assets/34871572/a6eb6407-add0-4004-83f9-4e0a5c1bb6f6)

This sort of fixes https://github.com/flutter/flutter/issues/144657? The issue is still odd to me, though, because I don't know why the test runner wouldn't be waiting properly for the splash screen.

Bonus, this is what it looks like if we [change the runner](a70a0abdec/testing/scenario_app/bin/run_android_tests.dart (L352)) to not use animations, with `--no-window-animation` (but don't include the splash screen change):
[no_animation_example.webm](https://github.com/flutter/engine/assets/34871572/0c8665a3-b546-4bbd-b7e1-00851c48e1ff)
You can see there is still a moment of color change at the end of tests (ignore the very first test I was alt tabbing and lagged out my emulator).

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-03-11 23:04:55 +00:00
Matan Lurey
15779b7847 Conditionally run golden_tests_harvester for run_impeller_golden_tests. (flutter/engine#51325)
I think this restores the behavior prior to
https://github.com/flutter/engine/pull/50844 without making the client
code faulty.

I'll file a follow-up issue, I don't think `golden_tests_harvester`
should accept running if `GOLDCTL` isn't set:
https://github.com/flutter/flutter/issues/144948.

/cc @godofredoc
2024-03-11 12:10:57 -07:00
Zachary Anderson
e99d6e5616 Remove flaky check from observatory/tracing_test.dart (flutter/engine#51320)
For https://github.com/flutter/flutter/issues/144394
2024-03-11 09:21:06 -07:00
gaaclarke
b220a37102 [Impeller] implement mask blur for textures (flutter/engine#51183)
fixes https://github.com/flutter/flutter/issues/144266

## 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-03-08 15:58:03 -08:00
Zachary Anderson
286169bb52 Don't rely on dart binary on PATH in run_test.py (flutter/engine#51302) 2024-03-08 23:49:32 +00:00
Dan Field
a4c787e072 Use io.flutter.Build.API_LEVELS rather than android.os.Build.VERSION_CODES (flutter/engine#51171)
Updates the linting script to ban the use of `VERSION_CODES`.

We currently have a mish-mash of using the integers, using `VERSION_CODES`, and even how we import the version codes. This makes it more confusing when doing things like #51070 - I think it is clearer to see `22` than `LOLLIPOP_MR1`.

I'd like to get LGTM (or at least no opinion) from all the requested reviewers here.
2024-03-08 19:04:20 +00:00
Jason Simmons
7da9c29b79 Update CI scripts to use either src/flutter/third_party/dart or src/third_party/dart (flutter/engine#51276)
See https://github.com/flutter/flutter/issues/143335
2024-03-08 17:00:17 +00:00
Brandon DeRosier
e4a8c84807 [Impeller] Add mask blur style support to the RRect blur fast path. (flutter/engine#51250)
This improves performance by avoiding the 2-pass Gaussian blur in more shadow drawing situations.

The new golden also serves as a good reference for how mask blurs are supposed to work alongside various other paint properties such as color filters, color opacity, image filters, and blending.

![Screenshot 2024-03-06 at 11 47 04 PM](https://github.com/flutter/engine/assets/919017/dee1b56c-d2e4-40bd-9f50-aeba0cfd69f2)

The top 5 shapes are various RRect cases and are rendering correctly via the new blur style implementation in this patch.
The two bottom rows (the triangles and arcs) are non-rrect paths, so they're falling back to rendering using the 2-pass Gaussian blur. Rendering errors are circled in red below:

![Screenshot 2024-03-06 at 11 47 04 PM](https://github.com/flutter/engine/assets/919017/5ac27d71-95e6-4e6e-99d8-7436476e1aee)

* Cases 1, 2, 7, and 9 all appear to rendering fine.
* Cases 3, 4, 5, and 6 all have mask blur styles set to `BlurStyle::kSolid`. After the first clipped overlay has been drawn, subsequent clipped overlays aren't drawing.
* Case 6 is also has the blend mode set to `BlendMode::kExclusion`.
* Cases 8 and 10 are rendering with `BlurStyle::kInner` and `BlurStyle::kOuter` respectfully, but with a blur ImageFilter also set on the paint state. The ImageFilter needs to be applied to the rasterized mask blurred content.
2024-03-08 01:36:09 +00:00
Chris Bracken
0575633c34 Move ANGLE to flutter/third_party (flutter/engine#51270)
This moves Flutter out of the buildroot's third_party directory and into
//flutter/third_party and updates all BUILD and gni files.

Issue: https://github.com/flutter/flutter/issues/144786
Part of: https://github.com/flutter/flutter/issues/67373

## 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] The odds of this passing on its first CI run is 0%, because
there's no way the licence script isn't going to have a fit over it, at
which point I promise on my honour that I will dutifully fix all the
things it complains about and re-run, probably more than once.
- [X] This PR fulfils the minimum [Canadian
Content](https://www.youtube.com/watch?v=h9NMnPm5kXc&list=PLJ7QPuvv91JuoPWrLhqX0zDFUoLdynMEk&index=3)
regulations mandated by the CRTC.
- [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-03-07 16:23:14 -08:00
Tong Mu
67603e5e32 Reland 5: Multiview pipeline (flutter/engine#51186)
This relands https://github.com/flutter/engine/pull/50931.

The crash that caused the 4th revert has been fixed by https://github.com/flutter/flutter/pull/144212.

[There has been discussion](https://github.com/flutter/engine/pull/51019) on why the benchmark in previous attempts show significant drop in build time. This PR addresses it using option a as described in [this comment](https://github.com/flutter/engine/pull/51186#issuecomment-1977820525).

This PR also addresses https://github.com/flutter/flutter/issues/144584 with option 1. A test is added.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-03-07 01:54:14 +00:00
Brandon DeRosier
80c055bfc9 [Flutter GPU] Move method tests to flutter_tester. (flutter/engine#51223)
Part of https://github.com/flutter/flutter/issues/144640.

I'll be moving the rest of the pipeline-dependent tests and packaging a shader bundle for flutter_tester once Flutter GPU works against Vulkan/swiftshader.
2024-03-06 20:33:01 +00:00
Matan Lurey
feef93058c Re-stamp skia_gold_client e2e tests. (flutter/engine#51220)
Testing if `skia_gold_client` and pre-submit/post-submit is playing nice by triggering an update.

Generated via:

```sh
dart ./testing/skia_gold_client/tool/generate.dart
```

Related: https://github.com/flutter/flutter/issues/144352.
2024-03-06 18:33:05 +00:00
Loïc Sharma
8f1baa30bb [et] Allow users to update dependencies (flutter/engine#51177)
Allow users to update dependencies. Examples:

* `et fetch` Fetch dependencies

In the future, `et build` will update dependencies if it detects that they have changed.

Also:
* Updates the status in the README
* Adds instructions on how to run tests
* Fixes `et run`'s description
* Makes the `--verbose` flag global
2024-03-06 17:00:23 +00:00
Matan Lurey
31e26a1d52 Revamp the scenario_app/../README.md to encourage self-sustenance (flutter/engine#51196)
Feedback welcome, though if it is non-blocking and ambiguous consider a follow-up PR instead 😸
2024-03-06 01:26:13 +00:00
gaaclarke
425aeca227 [Impeller] implement blur style solid (flutter/engine#50892)
fixes https://github.com/flutter/flutter/issues/134178

## 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-03-05 15:41:17 -08:00
Brandon DeRosier
0fc45b3c73 [Impeller] Fix convex triangulation winding bug for multi-contour paths. (flutter/engine#51198)
An extra triangle needs to be inserted after bridging the triangle strip to a new contour, otherwise the triangle winding ends up getting inverted for each consecutive contour.

Before:

<img width="685" alt="image" src="https://github.com/flutter/engine/assets/919017/cef666c1-c188-4c83-ae93-fca117b0bc7f">

After:

<img width="685" alt="image" src="https://github.com/flutter/engine/assets/919017/0cf5e994-5366-4e73-8f9c-4fec1128b303">
2024-03-05 21:21:03 +00:00
Greg Spencer
f98269d78c Skip configuration dependency if unit tests are disabled (flutter/engine#51179)
## Description

This makes the GTK dependency only active if unit tests are enabled, so that it won't create an undesired dependency on embedded platforms.

## Related Issues
 - Fixes https://github.com/flutter/flutter/issues/144421
2024-03-05 20:57:01 +00:00
LongCatIsLooong
8fd9bbee17 Reland "Remove migration flag and unused header files #50216" (flutter/engine#50259)
Forgot to update a pinned dependency in the previous attempt: https://github.com/flutter/tests/pull/340

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-03-05 02:17:05 +00:00
Matan Lurey
b9c4a4c17c Scenario App: Adds a run_{count}.{backend}. file prefix to every run (on CI) (flutter/engine#51102)
Adds a flag, `--prefix-logs-per-run`, that defaults to `true` on CI
envrionments.

If present, instead of writing the file `${LOGS_DIR}/logcat.txt`, we
write `${LOGS_DIR}/{prefix}.logcat.txt`. I don't really like this
solution, but alternatives are using zip files (requires downloading to
view) or waiting on generic log improvements.

Closes https://github.com/flutter/flutter/issues/144402.
2024-03-04 11:12:41 -08:00
Matan Lurey
43f24a8c1f Use Instrumentation.waitForIdleSync() after rotation requests. (flutter/engine#51169)
Fixes https://github.com/flutter/flutter/issues/144553.

Looking roughly at:

-
<https://stackoverflow.com/questions/42482522/test-recreating-android-activity-using-instrumentation-and-junit4>
-
<https://stackoverflow.com/questions/10982370/instrumentation-test-for-android-how-to-receive-new-activity-after-orientation>

... and given the fact it's only the rotation tests that seem especially
flaky, let's give it a shot?

/cc @reidbaker @johnmccutchan if you have other advice.
2024-03-04 11:05:51 -08:00
gaaclarke
b8060622bf [Impeller] implements blur styles inner and outer (flutter/engine#51018)
issue: https://github.com/flutter/flutter/issues/134178

This doesn't yet do textures since there is a bug in rendering mask blurs with textures.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-03-04 18:24:12 +00:00
Liam Appelbe
27ca389132 Experimental platform isolates API (flutter/engine#48551)
This is a prototype of the [PlatformIsolate
API](https://github.com/flutter/flutter/issues/136314).

**UPDATE (Jan 25):** The PR is ready for review. PTAL.

The `PlatformIsolate` creation flow is:

1. `PlatformIsolate.spawn` running on parent isolate
(platform_isolate.dart)
    a. Create `isolateReadyPort`
    b. `PlatformIsolateNativeApi::Spawn` (platform_isolate.cc)
    c. `DartIsolate::CreatePlatformIsolate` (dart_isolate.cc)
d. Isolate created. Entry point invocation task dispatched to platform
thread
    e. `PlatformIsolate.spawn` returns a `Future<Isolate>`
2. On the platform thread, `_platformIsolateMain` is invoked in the
platform isolate
    a. Create `entryPointPort`
b. Send `Isolate.current` metadata and `entryPointPort` back to the
parent isolate via `isolateReadyPort`
3. Back in the parent isolate, `isolateReadyPort.handler` is invoked
a. Send the user's `entryPoint` and `message` to the platform isolate
via `entryPointPort`
b. Use received isolate metadata to create a new `Isolate` representing
the platform isolate and complete the `Future<Isolate>`
4. In the platform isolate, `entryPointPort.handler` is invoked
    a. Run the user's `entryPoint(message)`

The engine shutdown flow is handled by `PlatformIsolateManager`, which
maintains a set of running platform isolates.
2024-03-04 16:47:41 +13:00
Matan Lurey
7b7d9a2f43 Add a basic e2e-test for skia_gold_client. (flutter/engine#51078)
Basically, I take blank images of red/blue/green squares, like this:

![solid_red_square](https://github.com/flutter/engine/assets/168174/b1de63e4-8c3c-43ff-9bcf-b067a7e9d920)

... and use Image Magick to annotate it with the current git hash:

```sh
$ drt ./testing/skia_gold_client/tool/generate.dart

Writing annotation "8069cb4ca1" on images in testing/skia_gold_client/tool/source_images and saving them in testing/skia_gold_client/tool/e2e_fixtures.
Writing to testing/skia_gold_client/tool/e2e_fixtures/solid_red_square.png
Writing to testing/skia_gold_client/tool/e2e_fixtures/solid_green_square.png
Writing to testing/skia_gold_client/tool/e2e_fixtures/solid_blue_square.png
Done: wrote 3 image.
```

![solid_red_square](https://github.com/flutter/engine/assets/168174/0ece31a8-9e64-44a2-ad06-78c04b02650c)

... then, I upload the digests very similar to how we do it in `scenario_app`.

---

The idea here is to have a way for me to know if Skia gold is working the way I/we expect, independent of a more complicated test suite with various race-y or flake-y conditions. We could also augment it with tests of "dimensions" properties.
2024-03-01 01:33:07 +00:00
John McCutchan
0be7a9c4f0 Add et run command (flutter/engine#51037)
The `run` command builds both the host and target engines and then invokes `flutter run` so that it runs the app using the custom engine builds.

It is expected that 'et run' be used inside the directory of a flutter application.

Command line flags passed after `--` will be forwarded to `flutter run`.

Some examples:

- `et run` Build the debug variant and runs the app in that mode.
- `et run -- --profile` Build the profile variant and runs the app in that mode.
- `et run -- --release` Build the release variant and runs the app in that mode.

Also:

- Start a local_engine.json builder definition (it is missing a lot)
- Tweak the test fixture.
- Add a new Matcher to litetest.
- Tweaked the build config linter to only care about duplicate build names within the same builder.
2024-03-01 01:09:04 +00:00
Dan Field
2e9e6107eb Reapply "Bump everything to Android 21" (#51056) (flutter/engine#51070)
This reverts commit 98485b3f82fec45a6a0ac932c3c20285a9a14e02.

Reverted in https://github.com/flutter/engine/pull/51056 because it
caused failures in the framework. No changes, but framework test has
been updated to use an actual robolectric implementation to avoid those
failures.

This should not land until
https://github.com/flutter/flutter/pull/144348 has landed in the
framework.

@gaaclarke @johnmccutchan fyi
2024-02-29 09:00:01 -08:00
Matan Lurey
b2b8311980 The adb logcat filtering will continue until morale improves. (flutter/engine#51069)
Closes https://github.com/flutter/flutter/issues/144346.
2024-02-28 19:10:17 -08:00
Matan Lurey
bc4d5caa20 Test the SurfaceTextureSurfaceProducer-branch in the Android scenario_app (flutter/engine#51061)
This PR does the following:
- Relands https://github.com/flutter/engine/pull/50993.
- Fixes a bug in `SurfaceTextureSurfaceProducer` where it would crash on
release (now tested, yay!)

Closes https://github.com/flutter/flutter/issues/143539.
Closes https://github.com/flutter/flutter/issues/143483.

/cc @gaaclarke @chinmaygarde, this PR should (after landed) test/verify
https://github.com/flutter/engine/pull/50730.
2024-02-28 14:17:21 -08:00