1471 Commits

Author SHA1 Message Date
Matan Lurey
a70095b10c Run and record adb shell screenrecord during Android scenario app (flutter/engine#51832)
More grasping at straws to solve https://github.com/flutter/flutter/issues/145988.

At some point this could be moved to `--verbose` if it isn't useful.

This will automatically be copied into `${FLUTTER_LOGS_DIR}`, yay!

Example:

https://github.com/flutter/engine/assets/168174/c8caca7a-88ec-4d09-88bd-ebfc531f6512
2024-04-01 22:49:47 +00:00
Matan Lurey
4ae59a2770 Remove tests related to StrictMode that were never running on CI. (flutter/engine#51827)
Closes https://github.com/flutter/flutter/issues/60635 as not planned.
2024-04-01 21:26:58 +00:00
Matan Lurey
9f1dd63dac Remove log statements that did not help. (flutter/engine#51825)
Introduced in https://github.com/flutter/engine/pull/51789, but none of the crashes/hangs on CI seem related to these events, so removing.
2024-04-01 21:19:53 +00:00
Matan Lurey
a16ee1a7ac Remove testing/android_background_image which does not run/exist on CI. (flutter/engine#51815)
I am guessing this just either served it's purpose (https://github.com/flutter/flutter/issues/26654, https://github.com/flutter/flutter/issues/26728) or didn't and was never followed up. I can't find any examples of it running on CI - I suspect if we want a test like this, we're better off just adding it to `scenario_app` versus creating more 1-off Android integration test environments.
2024-04-01 18:59:50 +00:00
Matan Lurey
6969c285f3 Remove unused and untested timeline data branch for scenario_app (flutter/engine#51816)
All of this appears to be completely unused and untested, and I don't see value in fixing it.
2024-04-01 18:06:52 +00:00
Matan Lurey
1fd40fb2e4 Never panic in finally { ... }, check output logs on success only. (flutter/engine#51814)
Work towards https://github.com/flutter/flutter/issues/145988.

Should be a NO-OP in behavior, but hopefully make some of the false negatives less confusing (i.e. getting "missing X outputted files when the test is about to fail anyway".
2024-04-01 17:33:02 +00:00
Zachary Anderson
2512c698ae Prefix non-local build config names with ci/ (flutter/engine#51474)
Part 1 of https://github.com/flutter/flutter/issues/145263

This PR updates the names of builds outside of `local_engine.json` to be
prefixed with the string `ci/` (or `ci\` on Windows). For better or
worse, the "name" field of a build is used to construct a path used as
the source directory of a copy operation (I think the CAS archive
step?). Because of that, changing the name of a build also requires
updating the build output directory of the ninja build.

This PR also adds tests to make sure the naming of these builds remains
consistent.
2024-03-31 12:43:02 -07:00
Matan Lurey
12ad79de4f Add more Java and Dart logging to scenario_app (for now) (flutter/engine#51789)
Work towards https://github.com/flutter/flutter/issues/145988.

... as well as handle `sigTerm` (perhaps would help us actually write out logs? we'll see)
2024-03-30 01:14:23 +00:00
Matan Lurey
61573f8d69 Implement Paint.from(other) for dart:ui. (flutter/engine#51110)
(Tenatively) Closes https://github.com/flutter/flutter/issues/142871.

I personally think this is a reasonable request, and we (framework authors) can make some users happy in a fairly simple way (https://github.com/flutter/flutter/issues/142871, https://github.com/flutter/flutter/issues/40497).

Some questions:

1. Is the web implementation good enough or would we want to "ship" with an optimized impl?
2. Can folks imagine other edge cases to test beyond correctness and deep/immutable copies?
2024-03-29 21:46:05 +00:00
Matan Lurey
e1a5c99a2a Remove the tests for rotate and crop from the Android scenario_app. (flutter/engine#51769)
Closes https://github.com/flutter/flutter/issues/145957.

As @jonahwilliams and @johnmccutchan and I discussed (https://github.com/flutter/flutter/issues/144407), the functionality that was being tested was actually _Android's_ ability to rotate and crop `SurfaceTexture`-backed textures. This same functionality doesn't even exist in the `ImageReader`-based textures (read: modern Android devices):

> Due to an oversight by Android, ImageReader backed surfaces do not respect metadata applied to the surface (rotation & crop). Rotation information is not available at all and crop information is corrupted by the ImageReader (only the width/height is propagated the origin offset is not).

We might decide to re-add this functionality in the Dart `Texture` widget, but given we'll be migrating our plugins to `SurfaceProducer` (again, read: using `ImageTexture` for most Android phones), it's pointless to test this (and isn't even testing Flutter's code).

This reduces our test suite significantly (8 tests down to 2), which should also help with runtime and flakiness.

/cc @zanderso who I'm sure will be stoked.
2024-03-29 20:10:09 +00:00
Matan Lurey
42daa3bb56 Add a minimal example of using package:test. (flutter/engine#51726)
Work towards https://github.com/flutter/flutter/issues/133569.

This PR is a proof of concept that shows we're able to use `package:test` in `flutter/engine` instead of `package:litetest`.

I think it also shows that, if we're going to continue to vend dependencies this way, we might want to re-think our strategy in terms of using `pub` as a management tool - it's quite unwieldy already. For example, here is every `pubspec.yaml` file in the repo:

```sh
$ find . -name 'pubspec.yaml' -exec sh -c 'echo "$0 $(wc -l < "$0")"' {} \;

# Some files omitted in third_party or similar.
./impeller/tessellator/dart/pubspec.yaml       11
./tools/const_finder/pubspec.yaml       35
./tools/api_check/pubspec.yaml       90
./tools/build_bucket_golden_scraper/pubspec.yaml       47
./tools/licenses/pubspec.yaml       53
./tools/path_ops/dart/pubspec.yaml       26
./tools/engine_tool/pubspec.yaml       76
./tools/dir_contents_diff/pubspec.yaml       19
./tools/compare_goldens/pubspec.yaml        3
./tools/golden_tests_harvester/pubspec.yaml       55
./tools/gen_web_locale_keymap/pubspec.yaml       37
./tools/githooks/pubspec.yaml       63
./tools/android_lint/pubspec.yaml       35
./tools/clang_tidy/pubspec.yaml       76
./tools/pkg/engine_repo_tools/pubspec.yaml       41
./tools/pkg/process_fakes/pubspec.yaml       36
./tools/pkg/engine_build_configs/pubspec.yaml       73
./tools/pkg/git_repo_tools/pubspec.yaml       60
./tools/header_guard_check/pubspec.yaml       70
./sky/packages/sky_engine/pubspec.yaml        8
./shell/vmservice/pubspec.yaml        8
./ci/pubspec.yaml       57
./testing/benchmark/pubspec.yaml       77
./testing/skia_gold_client/pubspec.yaml       66
./testing/pkg_test_demo/pubspec.yaml      116
./testing/smoke_test_failure/pubspec.yaml       31
./testing/dart/pubspec.yaml       71
./testing/android_background_image/pubspec.yaml       22
./testing/litetest/pubspec.yaml       33
./testing/symbols/pubspec.yaml       24
./testing/scenario_app/pubspec.yaml       67
./web_sdk/web_engine_tester/pubspec.yaml       14
./web_sdk/web_test_utils/pubspec.yaml       22
./web_sdk/pubspec.yaml       60
./lib/snapshot/pubspec.yaml        8
./lib/gpu/pubspec.yaml       14
./lib/web_ui/pubspec.yaml       60
./flutter_frontend_server/pubspec.yaml       39
```

I'll file a follow-up issue to discuss pub-package management in the engine.
2024-03-29 18:44:04 +00:00
Matan Lurey
55c4543094 Implement .engine-release.version files for engine Skia Gold tests (flutter/engine#51739)
Work towards https://github.com/flutter/flutter/issues/144835.

Doc (_sorry, internal only_): [go/flutter-engine-goldens-workflow](http://goto.google.com/flutter-engine-goldens-workflow).

This implements the majority of the proposed workflow, that is, optionally having a plain-text version at the root of the directory, and using it to apply a unique suffix we can review in release branches. As it stands, this is a NO-OP outside of tests (it will have no impact, and can be ignored).

What's missing before using this feature in release branches:

- Optimization work with the infra team (not sure if blocking or not):
  https://github.com/flutter/flutter/issues/145842
- A dry-run of this with the release team to make sure it works as intended

@gaaclarke As implemented, I _think_ we don't need anything special for [`dir_contents_diff`](286169bb52/tools/dir_contents_diff), but maybe I'm wrong - I think only the _test_ names are being changed, not the names on disk.

/cc @zanderso as well.
2024-03-29 17:36:08 +00:00
Jonah Williams
f4b9b15cf7 [Impeller] dont clamp mipmap level to 0 with Vulkan textures. (flutter/engine#51761)
Mipmaps are not working at all right now with Vulkan. Opening without fix so we see goldens changing.
2024-03-28 23:32:57 +00:00
gaaclarke
03996c0fe2 Reland: [Impeller] adds a plus advanced blend for f16 pixel formats (flutter/engine#51756)
Relands https://github.com/flutter/engine/pull/51589

The fix is in 74397bc171c74d2bfb24e82b47f2aa29d70c1711. I couldn't
figure out how to get a test in the engine to cover it. The test is in
the devicelab.

Here's what I attempted:
```c++
TEST_P(AiksTest, BlendModePlusAlphaColorFilterAlphaWideGamut) {
  if (GetParam() != PlaygroundBackend::kMetal) {
    GTEST_SKIP_("This backend doesn't yet support wide gamut.");
  }
  EXPECT_EQ(GetContext()->GetCapabilities()->GetDefaultColorFormat(),
            PixelFormat::kR16G16B16A16Float);

  Canvas canvas;
  canvas.Scale(GetContentScale());
  canvas.DrawPaint({.color = Color(0.1, 0.2, 0.1, 0.5)});
  canvas.SaveLayer({
      .color_filter = ColorFilter::MakeBlend(BlendMode::kPlus,
                                             Color(Vector4{1, 0, 0, 0.5})),
  });
  Paint paint;
  paint.color = Color(1, 0, 0, 0.5);
  canvas.DrawRect(Rect::MakeXYWH(100, 100, 400, 400), paint);
  paint.color = Color::White();
  canvas.Restore();
  ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture()));
}
```

## 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-28 13:36:21 -07:00
auto-submit[bot]
ebe91c2a5c Reverts "[Impeller] adds a plus advanced blend for f16 pixel formats (#51589)" (flutter/engine#51741)
Reverts: flutter/engine#51589
Initiated by: jonahwilliams
Reason for reverting: draw vertices devicelab test is crashing due to SIGABRT in blend contents

![image](https://github.com/flutter/engine/assets/8975114/8bfaec63-29e9-43c2-8954-181d0ad1c413)

Original PR Author: gaaclarke

Reviewed By: {jonahwilliams}

This change reverts the following previous change:
fixes https://github.com/flutter/flutter/issues/142549

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-03-28 05:41:48 +00:00
Brandon DeRosier
7f453eb089 [Impeller] Reland: Use the scissor to limit all draws by clip coverage. (flutter/engine#51731)
Reland https://github.com/flutter/engine/pull/51698.

This reverts commit 7922740184.

Attempts to improve https://github.com/flutter/flutter/issues/145274.

Our new clipping technique paints walls on the depth buffer "in front" of the Entities that will be affected by said clips. So when an intersect clip is drawn (the common case), the clip will cover the whole framebuffer.

Depth is divvied up such that deeper clips get drawn _behind_ shallower clips, and so many clips actually don't end up drawing depth across the whole framebuffer. However, if the app does a lot of transitioning from a huge clips to a small clips, a lot of unnecessary depth churn occurs (very common in Flutter -- this happens with both the app bar and floating action button in the counter template, for example).

Since progressively deeper layers in the clip coverage stack always subset their parent layers, we can reduce waste for small intersect clips by setting the scissor to the clip coverage rect instead of drawing the clip to the whole screen.

Note that this change _does not_ help much with huge/fullscreen clips.

Also, we could potentially improve this further by computing much stricter bounds. Rather than just using clip coverage for the scissor, we could intersect it with the union of all draws affected by the clip at the cost of a bit more CPU churn per draw. I don't think that's enough juice for the squeeze though.

Before (`Play/AiksTest.CanRenderNestedClips/Metal`):

https://github.com/flutter/engine/assets/919017/7858400f-793a-4f7b-a0e4-fa3581198beb

After (`Play/AiksTest.CanRenderNestedClips/Metal`):

https://github.com/flutter/engine/assets/919017/b2f7c96d-a820-454d-91df-f5fae4976e91
2024-03-28 00:42:48 +00:00
gaaclarke
d96b1f7e73 [Impeller] adds a plus advanced blend for f16 pixel formats (flutter/engine#51589)
fixes https://github.com/flutter/flutter/issues/142549

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-03-27 23:48:24 +00:00
auto-submit[bot]
0946357650 Reverts "Fail pre-submit if a negative image is encountered as part of goldctl imgtest add. (#51685)" (flutter/engine#51718)
Reverts: flutter/engine#51685
Initiated by: matanlurey
Reason for reverting: goldctl does not disambiguate negatives from untriaged images (see 9b9adad080/gold-client/cmd/goldctl/cmd_imgtest_test.go (L325)).
Original PR Author: matanlurey

Reviewed By: {mdebbar, gaaclarke}

This change reverts the following previous change:
`flutter/engine`-side fix for https://github.com/flutter/flutter/issues/145043.

- Before this PR, if a negative image was encountered, we'd silently pass pre-submit, merge, and turn the tree red.
- After this PR, a negative image both makes pre and post-submit red.

Added tests, and fixed up some unrelated tests that were accidentally setting `pid` instead of `exitCode`. Oops!

/cc @zanderso and @eyebrowsoffire (current engine sheriff).
2024-03-27 18:58:47 +00:00
Brandon DeRosier
1cc55b8a1c [Impeller] Transform geometry to safe depth ranges instead of forcing discrete depth values. (flutter/engine#51673)
Resolves https://github.com/flutter/flutter/issues/144333. (Specifically, this [follow-up issue](https://github.com/flutter/flutter/issues/144333#issuecomment-2002399870))

When drawing objects with a perspective transform, the rasterizer applies perspective correction for interpolated vertex attributes. By absorbing W and replacing Z with a discrete value, we were essentially removing all perspective information and disabling perspective correction.

Instead, we can manipulate the Entity transform to remap the output Z range to fit within the small depth slices that each Entity is allotted.

The golden draws a clip sandwich:
1. Draw and restore a difference clip _before_ drawing the airplane image. This clip will get drawn to the depth buffer behind the airplane image.
2. Draw an oval clip that applies to the airplane image. This clip will get drawn in front of the airplane image on the depth buffer.
3. Draw the airplane image with a 3D rotation and perspective transform.
4. Draw a semi-translucent blue circle atop all previous draws.

Before:

https://github.com/flutter/engine/assets/919017/c2a7d012-714e-4234-83ac-61c792172f30

After:

https://github.com/flutter/engine/assets/919017/de3b78ff-00bf-4bc9-8821-8e86b9a9e6bf
2024-03-27 17:25:07 +00:00
Matan Lurey
c935c3ba36 Fail pre-submit if a negative image is encountered as part of goldctl imgtest add. (flutter/engine#51685)
`flutter/engine`-side fix for https://github.com/flutter/flutter/issues/145043.

- Before this PR, if a negative image was encountered, we'd silently pass pre-submit, merge, and turn the tree red.
- After this PR, a negative image both makes pre and post-submit red.

Added tests, and fixed up some unrelated tests that were accidentally setting `pid` instead of `exitCode`. Oops!

/cc @zanderso and @eyebrowsoffire (current engine sheriff).
2024-03-27 16:46:22 +00:00
hellohuanlin
34f5c82ffc [ios]ignore single edge pixel instead of rounding (flutter/engine#51687)
The previous PR https://github.com/flutter/flutter/issues/143420 rounds out the layers and rounds in the platform views. This results in missing pixel on the edge of the intersection when there's fractional coordinate (as shown in the screenshot below), because platform view is below the layers. 

It turns out that we have to round out both platform view and layers, because: 
- rounding in platform view rects will result in missing pixels on the edge of the intersection. 
- rounding in layer rects will result in missing pixels on the edge of the layer that's on top of the platform view. 

This PR simply skips the single (or partial) pixel on the edge, which is a special case, while still preserve the `roundOut` behavior for general non-edge cases. 

Before the fix, notice a very thin gray line cutting through the purple box: 

<img src="https://github.com/flutter/engine/assets/41930132/1482d81a-337e-4841-ac08-eff08bbc71ef" height="500">

Then after the fix, the gray line is gone: 

<img src="https://github.com/flutter/engine/assets/41930132/0eddae69-ab62-4de6-8932-c67cc5aced73" height="500">

*List which issues are fixed by this PR. You must list at least one issue.*

https://github.com/flutter/flutter/issues/143420

*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
2024-03-27 16:46:19 +00:00
hellohuanlin
9c54875efc [ios][platform_view][performance] overlay intersection (flutter/engine#50637)
Address the performance of platform view due to an extra overlay. This overlay was added due to the following rounding problem: 

> For example, if we interleave flutter widget and platform view in a list, and let's say we have a flutter widget (top = 0, bottom = 100.1), and a platform view below that widget (top = 100.1, bottom = 200). They are NOT supposed to be overlapping. However, after rounding out, we will get flutter widget (top = 0, bottom = 101), and platform view (top = 100, bottom 200). This will result in 1 pixel overlap as long as there's a floating point in the coord.

(Quote myself from the discussion below). 

*List which issues are fixed by this PR. You must list at least one issue.*

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

*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
2024-03-21 23:48:34 +00:00
Jason Simmons
762d37fd2e Move //buildtools to //flutter/buildtools (flutter/engine#51526) 2024-03-21 17:06:44 +00:00
K Lubick
95d17af1aa Migrate use of deprecated GrDirectContext::MakeMetal (flutter/engine#51537)
This was deprecated in https://skia-review.googlesource.com/c/skia/+/826397. Furthermore, some metal files were relocated, so this changes those also.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-03-20 18:07:33 +00:00
Gray Mackall
ee36c0eae0 Upgrade to gradle 8.3 (flutter/engine#51422)
Fixes https://github.com/flutter/flutter/issues/145165

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-03-20 17:26:35 +00:00
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