1653 Commits

Author SHA1 Message Date
gaaclarke
ad894bd2f0 Fixes blend + color filter (flutter/engine#55411)
fixes https://github.com/flutter/flutter/issues/155456

Thanks @jason-simmons for identifying the fix.

## 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-09-25 12:57:45 -07:00
Jonah Williams
1878326071 [scenario_app] delete get bitmap activity. (flutter/engine#55436)
Since we can't see the screenshot we can't really evaluate if this is failing for good/bad reasons. This also uses
 the whoe convertToImageREader / readback debugging API that I want to delete.
2024-09-25 19:14:29 +00:00
Brandon DeRosier
31ac0fc004 [Flutter GPU] Use vm.Vector4 for clear color instead of ui.Color. (flutter/engine#55416)
Resolves https://github.com/flutter/flutter/issues/155627.

Allow setting the clear directly as floats without conversion work. vector_math already has convenient `Colors.[color]` factories and such. Also, `ui.Color` has a color space now, which does not apply here.

Adds a simple golden to verify that clear colors work:
![flutter_gpu_test_clear_color](https://github.com/user-attachments/assets/ba7a4e74-aaf2-48d8-ac13-115a86daeb19)
2024-09-25 18:02:05 +00:00
Brandon DeRosier
e496b1ed26 [Flutter GPU] Add CullMode. (flutter/engine#55409)
Part of https://github.com/flutter/flutter/issues/155636.

New golden `flutter_gpu_test_cull_mode` will draw a red triangle if the CullMode isn't working:
![flutter_gpu_test_cull_mode](https://github.com/user-attachments/assets/cbdf804e-1608-4352-9aa1-d5d9223f3c1a)
2024-09-25 00:52:11 +00:00
Brandon DeRosier
c4514370d7 [Flutter GPU] Add pipeline stencil config. (flutter/engine#55272)
Also adds a golden that depends on https://github.com/flutter/engine/pull/55270.
Resolves https://github.com/flutter/flutter/issues/142731.

Allow setting the stencil compare function, pass/fail operations, and read/write masks.

Flutter GPU has light "shader object" style programs, so all of the stencil configuration state can be set on the `RenderPass` at any time.

New simple golden that exercises stencil ops:
![flutter_gpu_test_triangle_stencil](https://github.com/user-attachments/assets/acc98cd9-41fc-4988-97a2-afb898a8fc0c)
2024-09-24 21:26:29 +00:00
Brandon DeRosier
7242297f80 [Flutter GPU] Add setStencilReference to RenderPass. (flutter/engine#55270) 2024-09-24 11:27:25 -07:00
gaaclarke
9f66178386 Reland: Update Color to do all calculations with floating point components (flutter/engine#55231)
Reason for revert: Broke customer tests
Reland depends on https://github.com/flutter/flutter/issues/155113

This transforms the rest of Color to use the floating point parameters.  This will likely break existing tests very subtly.  For example, colors will be slightly different in golden tests if `lerp` was ever used.

issue: https://github.com/flutter/flutter/issues/127855

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-09-23 17:43:52 +00:00
Brandon DeRosier
a2fe41a763 [Flutter GPU] Remove the redundant smoketest. (flutter/engine#55267)
This is placeholder stuff that I added before the rest of the API to prove that we can call the engine symbols.

Today this is totally redundant as Flutter GPU has a bunch of automated tests which exercise every FFI call.
2024-09-17 22:24:07 +00:00
Brandon DeRosier
759d173073 [Flutter GPU] Add DeviceBuffer.flush & GpuContext.getMinimumUniformByteAlignment. (flutter/engine#53620)
Part of https://github.com/flutter/flutter/issues/150953.

Provide a way to get the required minimum uniform byte alignment when referencing uniform blocks in a device buffer. Allow the user to explicitly flush DeviceBuffers (necessary for devices without shared memory).
2024-09-17 20:31:50 +00:00
Brandon DeRosier
ea026548ce [Flutter GPU] Add golden test for rendering a triangle. (flutter/engine#55262)
Resolves https://github.com/flutter/flutter/issues/144640.

New golden:
![flutter_gpu_test_triangle](https://github.com/user-attachments/assets/0b39380e-1aa5-4369-ae5b-a8764d5701cb)
2024-09-17 20:00:33 +00:00
Jim Graham
7da9ad1862 Delete VolatilePathTracker in favor of Dispatch tracking (flutter/engine#55125)
ui.Canvas and ui.SceneBuilder now use the DlPath object directly from the ui.Path object. This results in increased sharing of the wrapper objects which then increases the sharing of both the converted Impeller paths and Skia's volatile flag.

The VolatilePathTracker mechanism is deleted and rather than count the number of frames that a path is stable for, instead we count the number of times it is used for rendering. If a path is used 100 times in a single frame, it will become non-volatile and start being cached almost immediately. The cached Impeller paths are now also tracked for all instances of the same path, rather than for each call site that originated from a DisplayList dispatch.
2024-09-13 21:49:09 +00:00
Reid Baker
415f89e20a add back test itSendsTextShowPasswordToFrameworkOnAttach with new mock for display metrics (flutter/engine#55110)
Part 1/5 for re adding tests documented in flutter/flutter/issues/154746

## 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.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [x] I signed the [CLA].
- [x] All existing and new tests are passing.
2024-09-13 13:45:37 -04:00
Matan Lurey
c53db189c1 Remove now unused extra args/opts/env from run_tests.py. (flutter/engine#55164)
As a result of https://github.com/flutter/flutter/issues/133569, Dart tests all use the standard `dart test` runner _or_ `engine_repo_tools` to find paths.
2024-09-13 01:22:18 +00:00
Matan Lurey
02d5118165 Remove assert(() {... }) and other unnecessary patterns in dart:ui tests (flutter/engine#55165)
Closes https://github.com/flutter/flutter/issues/155054, where we
decided this was correct to do.

As a bonus I improved an `assert` message :)
2024-09-12 17:40:52 -07:00
Matan Lurey
425e6c707d Remove all references to litetest from the engine repo. (flutter/engine#55163)
Closes https://github.com/flutter/flutter/issues/133569.
2024-09-12 16:26:25 -07:00
Brandon DeRosier
16acb8258a Remove Impeller Scene 👋 (flutter/engine#55118)
Impeller Scene has been fully rewritten as a Dart library for Flutter: https://pub.dev/packages/flutter_scene
2024-09-12 14:56:08 -07:00
gaaclarke
f9093e1b13 Revert "Update Color to do all calculations with floating point components" (flutter/engine#55153)
Reverts flutter/engine#54981

This is causing failures in customer tests that need to be updated:
https://github.com/flutter/flutter/pull/155107/checks?check_run_id=30069840819
2024-09-12 13:01:37 -07:00
Matan Lurey
37f629a23f Migrate more tests from litetest to package:test (flutter/engine#55119)
Partial work towards https://github.com/flutter/flutter/issues/133569.

Commentary on removal of `assert`-conditionals here: https://github.com/flutter/flutter/issues/155054.
2024-09-12 19:01:05 +00:00
gaaclarke
c7d96a38bc Update Color to do all calculations with floating point components (flutter/engine#54981)
This transforms the rest of Color to use the floating point parameters.  This will likely break existing tests very subtly.  For example, colors will be slightly different in golden tests if `lerp` was ever used.

issue: https://github.com/flutter/flutter/issues/127855

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-09-12 16:30:06 +00:00
Matan Lurey
5aee88abfb Migrate const_finder_test to use package:test (flutter/engine#55132)
... instead of some home-grown framework.

This is the last test in the engine that uses custom command line arguments to start. As of this PR, `dart test` including full debugging in an IDE works across all Dart tooling code.

I tried to make this idiomatic as much as possible without changing the logic.
2024-09-12 15:30:33 +00:00
Jim Graham
bc69788f05 [DisplayList] DlPath object provides auto-conversion from Skia to Impeller (flutter/engine#55055)
Switch from using the clumsy manual CacheablePath object to a more automatic DlPath object for holding paths in DisplayLists and dispatching them to either Skia or Impeller with auto-conversion.

For now DlPath is just a wrapper around SkPath with an auto-generating Impeller Path object which is very similar in design from what was done with the CacheablePath object except that it manages the caching of the Impeller path internally without extra burden on Impeller or Skia. There is also no need to communicate with the Dispatch method as to which type of path you prefer, they're all "auto-converting" DlPath objects now.

For now, ui.Path still generates an SkPath and so we wrap it when we record it into a DisplayList, just like the former CacheablePath mechanism. It will be a simple conversion to create the DlPath wrapper in ui.Path, though, so as to maintain the cached Impeller paths across frames even if the DisplayList itself is not preserved.

Eventually DlPath will take on more of a role of hiding the construction and internal representation of the paths so that we could be using SkPath, impeller::Path, or some other internal storage. For now, SkPath will likely remain primary storage for a while so that we can deal with PathOps.
2024-09-12 01:20:59 +00:00
Matan Lurey
bc84a70c7f Move most of the dart:ui tests to package:test. (flutter/engine#55090)
Work towards https://github.com/flutter/flutter/issues/133569.

There are a couple with custom matchers I'd like to migrate in a follow-up PR.
2024-09-11 23:46:07 +00:00
Jenn Magder
b8bb6eff6b Zip and upload Xcode xcresults on scenario test failure (flutter/engine#55093)
The `FLUTTER_ENGINE` has a `/` in it: `ci/ios_debug_unopt_sim`.  
```
path.join(storePath, '$iosEngineVariant.zip');
```
was resolving to `path_to_output/ci/ios_debug_unopt_sim.zip`.  `path_to_output` existed, but the `ci` directory didn't:

> zip error: Could not create output file (/Volumes/Work/s/w/ir/x/w/rc/flutter_logs_dir/ci/ios_debug_unopt_sim.zip)

Change the output zip path to `path_to_output/ci_ios_debug_unopt_sim.zip` with an underscore instead.

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

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-09-11 20:06:32 +00:00
Matan Lurey
c5f302cd01 Move flutter_frontend_server and tweak run_tests.py to allow env variables. (flutter/engine#55089)
Work towards https://github.com/flutter/flutter/issues/133569.

After another PR, `run_tests.py` `extra_args` can be deleted entirely.
2024-09-10 23:35:05 +00:00
Matan Lurey
9ac366a022 Remove the last --disable-dart-dev in the engine. (flutter/engine#55086)
Work towards https://github.com/flutter/flutter/issues/154268.
2024-09-10 21:53:06 +00:00
Matan Lurey
64fbc93023 Move more of the tests in the engine to package:test (flutter/engine#55083)
Partial work towards https://github.com/flutter/flutter/issues/133569.
2024-09-10 21:14:12 +00:00
Matan Lurey
f6915ab4ca Redirect run_ios_tests.sh to run_ios_tests.dart. (flutter/engine#53717)
Part of https://github.com/flutter/flutter/issues/143953.

If this merges cleanly, and is not reverted, we can delete `run_ios_tests.sh` and be done.
2024-09-10 21:05:47 +00:00
Jenn Magder
0a26313116 Unskip Impeller iOS scenario tests (flutter/engine#55012)
The iOS golden scenario tests are supposed to run on Skia and Impeller, but are actually running on Skia twice.  

#### Issue 1: script-side

Regression from https://github.com/flutter/engine/pull/46329.
Currently, the tests log "Running simulator tests with Impeller" but then you see that it's not:
```
Running simulator tests with Impeller
...
2024-09-06 13:38:07.692810-0700 Scenarios[73857:470266] [IMPORTANT:flutter/shell/common/shell.cc(456)] [Action Required] The application opted out of Impeller by either using the --no-enable-impeller flag or FLTEnableImpeller=false plist flag. This option is going to go away in an upcoming Flutter release. Remove the explicit opt-out. If you need to opt-out, report a bug describing the issue.
```
https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8737514337106072353/+/u/test:_Scenario_App_Integration_Tests/stdout

`INFOPLIST_FILE="Scenarios/Info_Impeller.plist"` isn't passed into the xcodebuild any more.  I confirmed #46329 caused this by inserting a comment in the middle of the `xcodebuild` command, which caused the last argument after the comment to not be passed in.

#### Issue 2: test-side

Regression from https://github.com/flutter/engine/pull/45093.
[The logic deciding whether to use Skia or Impeller goldens is incorrect](1da5dd68fd/testing/scenario_app/ios/Scenarios/ScenariosUITests/GoldenTestManager.m (L84-L90)) since `FLTEnableImpeller` is set in the app Info.plist, not the UI test, so the bundle should be "dev.flutter.Scenarios". That means even if the script was passing in the right Info.plist, the tests would fail since they would have compared the Skia screenshots.

#### This PR

1. Once https://github.com/flutter/engine/pull/55016 merges (edit: done), these tests will no longer be running with the software renderer.  Remove all the test skips so they all run on Impeller.
2. Add the missing Impeller golden screenshots.
3. Update the default Info.plist to use Impeller, so if another script mishap happens, it will default to testing Impeller twice, and not Skia.  Add a Skia Info.plist variant instead.
4. Update the test logic to check the right bundle ID Info.plist to decide whether to compare against the Skia or Impeller screenshots.  Prefer Impeller so if another test-side mishap happens, it will also default to testing Impeller and not Skia.  It will only use the Skia goldens if the bool is set in the Info.plist, and that bool is NO (not just if it's missing).
5. All this made the now-default Impeller tests pass, but when passing in `INFOPLIST_FILE="Scenarios/Info_Skia.plist"` the app wasn't launching, with the error:

> Scenarios encountered an error (Failed to install or launch the test runner. (Underlying Error: Simulator device returned an error for the requested operation. Failed to create promise. (Underlying Error: Failed to create app extension placeholder for /Users/chrome-bot/Library/Developer/Xcode/DerivedData/Scenarios-aypjgouuxctxctfazxalyegcximf/Build/Products/Debug-iphonesimulator/Scenarios.app/PlugIns/ScenariosShare.appex. Failed to create promise. (Underlying Error: Failed to set placeholder attributes dev.flutter.Scenarios.ScenariosShare. Failed to create promise. (Underlying Error: extensionDictionary must be set in placeholder attributes for an app extension placeholder. Invalid placeholder attributes.)))))

This is identical to the error in https://github.com/flutter/engine/pull/53717. I finally realized it was because the ScenariosShare app extension requires specific extension keys in its plist, which weren't present in the app Info.plist at `Scenarios/Info_Skia.plist`.  So I changed the `INFOPLIST_FILE` path to `$(TARGET_NAME)/Info_Skia.plist` so it would resolve to target-specific copies like `Scenarios/ScenariosShare/Info_Skia.plist`.  That meant I had to add a few more copies where they didn't exist in the target path.

Dependent on https://github.com/flutter/engine/pull/55016 landing.
Fixes https://github.com/flutter/flutter/issues/131888

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-09-09 21:47:04 +00:00
Jenn Magder
64437a0b8f Turn off software rendering in iOS scenario golden tests (flutter/engine#55016)
Follow-up to https://github.com/flutter/engine/pull/45093.  Remove software rendering for the golden/screenshot compare iOS scenario tests.  Throw an exception if this flag is passed into the test app.  Delete `RenderingSelectionTest`.

This did require updating some screenshots, so there are changes.

Note, these golden tests are still not running on Impeller, but I'm going to follow-up in https://github.com/flutter/engine/pull/55012.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-09-07 02:44:26 +00:00
Jim Graham
6d0f7279e2 [DisplayList] use DlScalar, DlPoint, DlRect exclusively in DlOpReceiver methods (flutter/engine#54982)
Wean the DlOpReceiver interface and implementations off of using the SkScalar, Sk[I]Rect, and SkPoint objects in favor of our own DL/Impeller versions.

The start of an ongoing effort to eventually compartmentalize all use of Skia interfaces into a single backend rendering module that is one of 2 semi-pluggable renderers.
2024-09-06 22:16:05 +00:00
Jonah Williams
1da5dd68fd [Impeller] opt into exp canvas. (flutter/engine#54913)
Switch back to new canvas implementation, which allows us to complete the display list/impeller interop arc of work. While we're at it, switch the subpass size rounding logic to round out if there is no image filter.

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

Part of https://github.com/flutter/flutter/issues/142054
2024-09-06 20:33:22 +00:00
Matan Lurey
d068ccc47d Add more package:test (removing usages of package:litetest) (flutter/engine#54882)
... also removed a few TODOs, deleted a proof of concept directory.

Work towards https://github.com/flutter/flutter/issues/133569.
2024-09-04 22:42:55 +00:00
Kaylee Lubick
ef050da2b8 Use moved Skia Ganesh header files (flutter/engine#54833)
In http://review.skia.org/892736 and http://review.skia.org/893856, Skia
moved its Ganesh headers to align with the Graphite ones. This updates
Flutter to use those moved files.

All changes are mechanical and there is no API difference between the
headers (indeed, the old ones simply `#include` the new ones).

## 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].
- [ ] 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.
- [ ] 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-09-04 07:09:51 -07:00
hellohuanlin
48974293cd [ios][platform_view] fix platform view clipping path intersection (flutter/engine#54820)
It turns out that when there are multiple paths to clip, they are unioned together, rather than intersected. But clipping paths need to be intersected. 

There isn't any good way to intersect arbitrary paths. However, it is easy to intersect rect paths, which is the most common use case. Then we simply fallback to software rendering if we have to intersect non-rect paths. That is: 

**Case 1** Only 1 clipping path (either rect path or arbitrary path):
Hardware rendering. This should be the most common use case

**Case 2** Multiple rect clipping path: 
Hardware rendering. This is also common, and it's the linked issue that we are fixing. 

**Case 3** Other complex case (multiple non-rect clipping path)
Fallback to software rendering. This should be rare. 

After https://github.com/flutter/engine/pull/53826, we don't have a working benchmark that measures the main thread anymore. However, this PR shouldn't impact our ad benchmark, since it only has 1 clipping path. I will verify manually by checking Instruments and make sure no software rendering is happening. But we really should make the benchmark working again, not just for performance improvement, but also for monitoring regression. 

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

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

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-09-03 20:36:48 +00:00
gaaclarke
6596a35625 Reland: Hooks up framework wide gamut to engine wide gamut (flutter/engine#54906)
relands https://github.com/flutter/engine/pull/54567
depends on https://github.com/flutter/engine/pull/54905

This was reverted because the PR that it depends on was reverted.  There is nothing to be addressed here.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-08-30 18:22:04 +00:00
gaaclarke
df9fc7786b Reland: Framework wide color (#54415) (#54737) (flutter/engine#54905)
[This PR](https://github.com/flutter/engine/pull/54415) was reverted
because it required customer testing updates.

issue: https://github.com/flutter/flutter/issues/127855
integration test: https://github.com/flutter/engine/pull/54415

This does the preliminary work for implementing wide gamut colors in the
Flutter framework. Here are the following changes: 1) colors now specify
a colorspace with which they are to be interpreted 1) colors now store
their components as floats to accommodate bit depths more than 8

The storage of this Color class is weird with float/int storage but that
is a temporary solution to support a smooth transition. Here is the plan
for landing this: 1) Land this PR
1) Wait for it to roll into the Framework
1) Land https://github.com/flutter/flutter/pull/153938 which will make
CupertinoDynamicColor implement Color 1) Land another engine PR that
rips out the int storage: https://github.com/flutter/engine/pull/54714

Here are follow up PRs:
1) https://github.com/flutter/engine/pull/54473 - changes DlColor so the
wide gamut colors are rendered 1)
https://github.com/flutter/engine/pull/54567 - Hooks up these changes to
take advantage of wide DlColor 1)
https://github.com/flutter/flutter/pull/153319 - the integration test
for the framework repo

There are some things that have been left as follow up PRs since they
are technically breaking: 1) The math on `lerp` hasn't been updated to
take advantage of the higher bit depth 1) `operator==` hasn't been
updated to take advantage of the higher bit depth 1) `hashCode` hasn't
been updated to take advantage of the higher bit depth 1) `alphaBlend`
hasn't been updated to take advantage of the higher bit depth 1)
`toString` hasn't been updated to take advantage of the higher bit depth

## Reland 2 notes

This was reverted because it changes the math on `_lerpDouble`. While
those changes were mathematcially equivalent, they had different
behaviors when working with non-numbers which created unexpected
changes. The change has been reverted and a test added.

## 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-08-30 10:33:07 -07:00
auto-submit[bot]
7b38e8d173 Reverts "Reland: Framework wide color (#54415) (#54737)" (flutter/engine#54885)
Reverts: flutter/engine#54737
Initiated by: chingjun
Reason for reverting: Breaking internal tests. See b/363125155
Original PR Author: gaaclarke

Reviewed By: {matanlurey, jonahwilliams}

This change reverts the following previous change:
[This PR](https://github.com/flutter/engine/pull/54415) was reverted because it requires a manual roll into the framework.

issue: https://github.com/flutter/flutter/issues/127855
integration test: https://github.com/flutter/engine/pull/54415

This does the preliminary work for implementing wide gamut colors in the Flutter framework. Here are the following changes: 1) colors now specify a colorspace with which they are to be interpreted 1) colors now store their components as floats to accommodate bit depths more than 8

The storage of this Color class is weird with float/int storage but that is a temporary solution to support a smooth transition. Here is the plan for landing this:
1) Land this PR
1) Wait for it to roll into the Framework
1) Land https://github.com/flutter/flutter/pull/153938 which will make CupertinoDynamicColor implement Color
1) Land another engine PR that rips out the int storage: https://github.com/flutter/engine/pull/54714

Here are follow up PRs:
1) https://github.com/flutter/engine/pull/54473 - changes DlColor so the wide gamut colors are rendered
1) https://github.com/flutter/engine/pull/54567 - Hooks up these changes to take advantage of wide DlColor
1) https://github.com/flutter/flutter/pull/153319 - the integration test for the framework repo

There are some things that have been left as follow up PRs since they are technically breaking:
1) The math on `lerp` hasn't been updated to take advantage of the higher bit depth
1) `operator==` hasn't been updated to take advantage of the higher bit depth
1) `hashCode` hasn't been updated to take advantage of the higher bit depth
1) `alphaBlend` hasn't been updated to take advantage of the higher bit depth
1) `toString` hasn't been updated to take advantage of the higher bit depth
2024-08-30 04:31:26 +00:00
auto-submit[bot]
677c70aa8a Reverts "Hooks up framework wide gamut to engine wide gamut (#54567)" (flutter/engine#54884)
Reverts: flutter/engine#54567
Initiated by: chingjun
Reason for reverting: Breaking internal tests. See b/363125155
Original PR Author: gaaclarke

Reviewed By: {jonahwilliams, chinmaygarde}

This change reverts the following previous change:
issue: https://github.com/flutter/flutter/issues/127855
integration test: https://github.com/flutter/engine/pull/54415

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-08-30 04:27:48 +00:00
gaaclarke
fdc343efec Hooks up framework wide gamut to engine wide gamut (flutter/engine#54567)
issue: https://github.com/flutter/flutter/issues/127855
integration test: https://github.com/flutter/engine/pull/54415

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-08-29 23:22:07 +00:00
gaaclarke
3b2f540e54 Reland: Framework wide color (#54415) (flutter/engine#54737)
[This PR](https://github.com/flutter/engine/pull/54415) was reverted because it requires a manual roll into the framework.

issue: https://github.com/flutter/flutter/issues/127855
integration test: https://github.com/flutter/engine/pull/54415

This does the preliminary work for implementing wide gamut colors in the Flutter framework. Here are the following changes: 1) colors now specify a colorspace with which they are to be interpreted 1) colors now store their components as floats to accommodate bit depths more than 8

The storage of this Color class is weird with float/int storage but that is a temporary solution to support a smooth transition. Here is the plan for landing this:
1) Land this PR
1) Wait for it to roll into the Framework
1) Land https://github.com/flutter/flutter/pull/153938 which will make CupertinoDynamicColor implement Color
1) Land another engine PR that rips out the int storage: https://github.com/flutter/engine/pull/54714

Here are follow up PRs:
1) https://github.com/flutter/engine/pull/54473 - changes DlColor so the wide gamut colors are rendered
1) https://github.com/flutter/engine/pull/54567 - Hooks up these changes to take advantage of wide DlColor
1) https://github.com/flutter/flutter/pull/153319 - the integration test for the framework repo

There are some things that have been left as follow up PRs since they are technically breaking:
1) The math on `lerp` hasn't been updated to take advantage of the higher bit depth
1) `operator==` hasn't been updated to take advantage of the higher bit depth
1) `hashCode` hasn't been updated to take advantage of the higher bit depth
1) `alphaBlend` hasn't been updated to take advantage of the higher bit depth
1) `toString` hasn't been updated to take advantage of the higher bit depth
2024-08-29 19:02:59 +00:00
Matan Lurey
1e6dde4eb1 Migrate another big chunk of the engine repo to package:test (flutter/engine#54853)
There are almost no behavioral changes.

Because `dart test` runs with assertions, and the former command does not, I had to tweak some of the engine tool tests because they would assert that there were duplicate names - but I didn't change any actual code besides the test expectations themselves/the fixtures.

This is not all of the engine, but is approximately 1/3 of all imports of `package:litetest` migrated.
2024-08-29 15:35:52 +00:00
Matan Lurey
87727168e8 Remove --disable-dart-dev across flutter/engine. (flutter/engine#54845)
As per the Dart CLI team and @bkonyi, this is no longer providing value and we shouldn't cargo-cult it.

Work towards https://github.com/flutter/flutter/issues/154268.
2024-08-29 00:12:32 +00:00
Matan Lurey
712e7b9a05 Migrateheader_guard_check to package:test. (flutter/engine#54811)
Work towards https://github.com/flutter/flutter/issues/133569.

I also augmented the `run_tests.py` script to support an incremental migration to `package:test`, PTAL.
2024-08-28 21:12:12 +00:00
Jonah Williams
7f1c113985 [Impeller] fix incorrect origins for mesh gradient computation. (flutter/engine#54762)
Fixes https://github.com/flutter/flutter/issues/153964

Changing the origin of the rect used to render a shader could break shaders that expect to render at particular coordinates based on the input vertices. The snapshot functionality correctly handles translating a texture, so the translation was never necessary to begin with.
2024-08-26 21:19:40 +00:00
Jonah Williams
c88eb87bd5 [ui] fix missing color conversion in drawAtlas. (flutter/engine#54750)
Ensure that int32 ui colors are correctly converted to Dl Colors (convert instead of reinterpret cast).
2024-08-26 16:28:21 +00:00
Jim Graham
2932511ae8 Revert "Framework wide color" (flutter/engine#54728)
Reverts flutter/engine#54415

Reverting for failures in the engine roll: https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8738846858081700577/+/u/run_test.dart_for_customer_testing_shard_and_subshard_None/stdout
2024-08-23 08:11:16 +00:00
Brandon DeRosier
adbc360970 [Impeller] Reland 3: Implement draw order optimization. (flutter/engine#54673)
For each clip scope, draw opaque items in reverse order and
translucent/backdrop-independent items in their original order
afterwards. Clips are treated as translucent by the parent scope.

Respects clips, subpass collapse, and the clear color optimization.
2024-08-22 18:22:09 -07:00
gaaclarke
6f9776424c Framework wide color (flutter/engine#54415)
issue: https://github.com/flutter/flutter/issues/127855
integration test: https://github.com/flutter/engine/pull/54415

This does the preliminary work for implementing wide gamut colors in the
Flutter framework. Here are the following changes:
1) colors now specify a colorspace with which they are to be interpreted
1) colors now store their components as floats to accommodate bit depths
more than 8

The storage of this Color class is weird with float/int storage but that
is a temporary solution to support a smooth transition. Here is the plan
for landing this:
1) Land this PR
1) Wait for it to roll into the Framework
1) Land https://github.com/flutter/flutter/pull/153938 which will make
CupertinoDynamicColor implement Color
1) Land another engine PR that rips out the int storage:
https://github.com/flutter/engine/pull/54714

Here are follow up PRs:
1) https://github.com/flutter/engine/pull/54473 - changes DlColor so the
wide gamut colors are rendered
1) https://github.com/flutter/engine/pull/54567 - Hooks up these changes
to take advantage of wide DlColor
1) https://github.com/flutter/flutter/pull/153319 - the integration test
for the framework repo

There are some things that have been left as follow up PRs since they
are technically breaking:
1) The math on `lerp` hasn't been updated to take advantage of the
higher bit depth
1) `operator==` hasn't been updated to take advantage of the higher bit
depth
1) `hashCode` hasn't been updated to take advantage of the higher bit
depth
1) `alphaBlend` hasn't been updated to take advantage of the higher bit
depth
1) `toString` hasn't been updated to take advantage of the higher bit
depth

## 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-08-22 12:36:28 -07:00
Jim Graham
28ee6cf0bb Reland "[DisplayList] Allow random access to ops through indexing" (flutter/engine#54676)
Now also fixes: https://github.com/flutter/flutter/issues/153737

Being able to reorder rendering commands leads to optimization opportunities in the graphics package. A graphics package being fed from a DisplayList either has to take the commands in the order given or implement their own storage format for the rendering data.

With this new dispatching mechanism, the graphics package can both query basic information about the recorded ops and even dispatch them by the index into the list. Query information includes either the "category" of the op (clip/transform/render, etc.) or a specific op type enum. The package can dispatch some categories (or ops) immediately and remember other categories (or ops) along with their state for dispatching later.
2024-08-21 18:20:24 +00:00
Brandon DeRosier
28f75263ff Revert "[DisplayList] Allow random access to ops through indexing" (flutter/engine#54661)
Reverts flutter/engine#54484

Fixes https://github.com/flutter/flutter/issues/153737
2024-08-20 23:16:05 +00:00