1698 Commits

Author SHA1 Message Date
Chris Bracken
5a3f245710 iOS,macOS: Add Obj-C cflags to all Obj-C targets (flutter/engine#56386)
Ensure that all Objective-C code in the codebase is being built with the standard set of Flutter Objective-C compiler flags with ARC enabled.

Also bumps the cflags config up to the top of the first block within each target in which Objective-C sources appear, so that the location is consistent.

Migrates The following targets to ARC, which had been missed in previous passes since they didn't declare the standard Flutter Obj-C[++] cflags:
* `//flutter/fml:fml_unittests`
* `//flutter/impeller/golden_tests:metal_screenshot`
* `//flutter/impeller/playground:playground`
* `//flutter/impeller/backend/metal:metal`
* `//flutter/impeller/backend/metal:metal_unittests`
* `//shell/gpu:gpu_surface_metal_unittests`
* `//flutter/shell/platform/embedder:embedder_unittests`

This patch includes no semantic changes.

Issue: https://github.com/flutter/flutter/issues/137801

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-11-06 20:17:08 +00:00
Chinmay Garde
bcb04a6ea8 [Impeller] Avoid errors due to triangle fans usage on Molten. (flutter/engine#56321)
Added the test case for https://github.com/flutter/flutter/issues/157885 to the corpus but Jonah fixed it in https://github.com/flutter/engine/pull/56310.

Fixes https://github.com/flutter/flutter/issues/158024 which is more of an inconvenience on macOS.
2024-11-06 18:36:48 +00:00
Matan Lurey
b60b012f51 Add and document and explicit toARGB32. (flutter/engine#56329)
Closes https://github.com/flutter/flutter/issues/157128.
2024-11-06 01:07:20 +00:00
Chris Bracken
8582bd3b7a fml: delete scoped_nsobject.h,mm (flutter/engine#56382)
fml::scoped_nsobject and fml::scoped_nsprotocol classes are no longer
necessary now that the entire codebase has been migrated to ARC.

This also eliminates the fml_arc_unittests target which tests that code.
All references to that target in documentation, run_tests.py have been
removed. This target was used in various `et` build/query unit tests and
has been replaced with the fml_unittests target in those cases.

Issue: https://github.com/flutter/flutter/issues/137801
2024-11-05 12:59:05 -08:00
Chris Bracken
8f6ef1c909 iOS: Eliminate fml::scoped_nsobject pointer use (flutter/engine#56295)
Eliminates use of `fml::scoped_nsobject` now that the codebase has been migrated to ARC.

Issue: https://github.com/flutter/flutter/issues/137801

No changes to tests since this patch makes no semantic changes.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-11-04 18:58:05 +00:00
Jason Simmons
90c1427af1 Write run_tests console logs to stdout instead of stderr (flutter/engine#56312)
Users of this script typically expect that the normal output of the tests will be written to stdout.  However, the logging.StreamHandler writes to stderr by default unless another stream is specified.
2024-11-01 21:34:53 +00:00
Jason Simmons
09c811781d [Impeller] Fix handling of destination opacity in advanced blends (flutter/engine#56251)
The framebuffer blend pipeline needs to support a dst_input_alpha parameter in order to implement the AbsorbOpacity flag.

Also, dst_input_alpha should only be applied to the alpha channel of the unpremultiplied destination color.

Fixes https://github.com/flutter/flutter/issues/157716
2024-11-01 01:02:10 +00:00
gaaclarke
f81ed55e63 reland: Allow BufferViews to have non-owning references to DeviceBuffers (flutter/engine#56286)
relands https://github.com/flutter/engine/pull/56224

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-10-31 23:46:55 +00:00
auto-submit[bot]
528967bfae Reverts "Allow BufferViews to have non-owning references to DeviceBuffers (#56224)" (flutter/engine#56285)
Reverts: flutter/engine#56224
Initiated by: jonahwilliams
Reason for reverting: merge issue.
Original PR Author: gaaclarke

Reviewed By: {jonahwilliams}

This change reverts the following previous change:
issue: https://github.com/flutter/flutter/issues/157538

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-10-31 22:48:46 +00:00
gaaclarke
1d90823917 Allow BufferViews to have non-owning references to DeviceBuffers (flutter/engine#56224)
issue: https://github.com/flutter/flutter/issues/157538

## 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-10-31 15:28:10 -07:00
Jim Graham
861a9a4ac8 [Impeller] Do not use fast mask blur for stroked shapes (flutter/engine#56247)
A compound test for whether to use the fast blur mechanism for shapes was failing to check for a stroked shape due to misplaced parentheses.
2024-10-31 21:33:18 +00:00
Chris Bracken
8a97900ef4 iOS: migrate Metal testing types to ARC (flutter/engine#56156)
This migrates Flutter's TestMetalContext and TestMetalSurface to ARC.

Also migrates to using `sk_cfp::retain` (which retains the passed in pointer) rather than `sk_cfp::reset`, which only releases the previous pointer but doesn't retain the incoming pointer.

No changes to tests since no semantic changes.

Issue: https://github.com/flutter/flutter/issues/137801

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-10-31 20:50:03 +00:00
Chris Bracken
a4bb83e6e8 iOS: Eliminate strong retain loop in Scenario tests (flutter/engine#56249)
`FlutterViewControllerTest testDrawLayer` created a callback which strongly referenced itself in its own body as part of an asynchronous recursive loop. The recursion was unnecessary and the test consistently passes, even if run on repeat > 100 times without it.

Now that there's only one call, eliminates the unnecessary local and inlines it into the `dispatch_after` call.

This was originally introduced in https://github.com/flutter/engine/pull/50072.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-10-31 00:37:26 +00:00
Brandon DeRosier
3fed10bf0d [Flutter GPU] Fix MSAA sample size and HostBuffer alignment. (flutter/engine#56218)
- Align HostBuffer emplacements properly (fix Metal validation failures).
- Correctly set the pipeline sample size.
- Throw an error when attempting to bind `deviceTransient` textures.
2024-10-29 22:52:21 +00:00
Jim Graham
80d757ef56 Change default TileMode for blur ImageFilter objects to null (flutter/engine#55552)
Fixes https://github.com/flutter/flutter/issues/154935

Historically ImageFilter.blur supported setting a TileMode and had a default mode of `clamp`, but few developers actually set the value and the default was not appropriate for some common uses like as a backdrop filter where the clamp mode produces flashing when scrolling high frequency pixel content underneath a blurred title bar.

This PR removes the default tile mode instead allowing a null value as the default which will allow the engine to use an appropriate context-dependent default tile mode depending on the action being performed. Typically:

- decal for rendering operations and saveLayers and ImageFilterLayer
- clamp for image operations
- mirror for backdrop filters
2024-10-29 22:47:32 +00:00
Jason Simmons
ac991b9a6e [Impeller] Clip the DrawImageRect source rect to the bounds of the image (flutter/engine#56183)
The destination rect will then be updated to a mapping of the clipped source rect.

This matches the behavior of Skia's SkCanvas::drawImageRect.

Fixes https://github.com/flutter/flutter/issues/157167
2024-10-29 17:10:31 +00:00
Brandon DeRosier
40062dbfe5 [Flutter GPU] Replace HostBuffer with Dart version. (flutter/engine#56054)
Resolves https://github.com/flutter/flutter/issues/157431.
2024-10-28 21:16:17 +00:00
Gray Mackall
c5d163fccb Delete v1 android engine embedding (flutter/engine#52022)
Fixes https://github.com/flutter/flutter/issues/143531

Other failures from the initial attempt are fixed in https://github.com/flutter/flutter/pull/146523/
2024-10-23 21:12:52 +00:00
Brandon DeRosier
026062f08b [Flutter GPU] Fix assert failure in createDeviceBufferWithCopy. (flutter/engine#56039)
Resolves https://github.com/flutter/flutter/issues/157336

`DartByteData` gets raw pointers into the Dart heap via `Dart_TypedDataAcquireData`. So it must be destructed before `AssociateWithDartWrapper` is called, which mutates the heap.

Re-enables failing test for Linux unopt.
2024-10-23 05:08:03 +00:00
yaakovschectman
32d9706cec Fix typo in testing script (flutter/engine#56029)
Just fix the spelling of `warning`.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-10-22 19:08:12 +00:00
Brandon DeRosier
3b568c8d68 [Flutter GPU] Fix conditional when checking DeviceBuffer bounds. (flutter/engine#56017)
Resolves https://github.com/flutter/flutter/issues/157324

Fix a silly off-by-one that I didn't catch because none of the tests are using `DeviceBuffer` directly. 🤦
2024-10-22 10:58:38 +00:00
Brandon DeRosier
493177b5ed [Flutter GPU] Add missing MSAA stuff. (flutter/engine#55424)
Resolves https://github.com/flutter/flutter/issues/144264.
2024-10-22 01:16:25 +00:00
Jim Graham
6b912e50de [Impeller] New impeller round rect class (flutter/engine#55946)
Impeller geometry class analogous to SkRRect - soon to be the standard round rectangle class throughout most of the engine that doesn't talk directly to Skia.

More unit tests are being written, but this PR will enable developers to look at the API of the new class and comment as well as test its effect on any goldens (there should be none).
2024-10-20 18:59:23 +00:00
gaaclarke
4ffade7c5b Started filtering out close line segments in rrect polylines. (flutter/engine#55929)
fixes https://github.com/flutter/flutter/issues/156422

tests: AiksTest.GradientOvalStrokeMaskBlurSigmaZero

This filtering needs to happen somewheres.  I opted for putting it inside of the AddLinearComponent instead of where it was affected me in the test: 45237cc63f/impeller/geometry/path_builder.cc (L180)

This seems preferable.  A tiny line segment should never matter.  The rub is that its only happening here.  We might want to do this in other places as well.  It's equally unimportant to have a tiny curve.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-10-18 21:54:04 +00:00
Jonah Williams
f0f29ce37f [Impeller] add mechanism for sharing bdf inputs. (flutter/engine#55701)
Introduces a mechanism to allow backdrop filters to 1) share backdrop inputs and 2) fuse filter applications for faster blurs.

This is a proposed solution to https://github.com/flutter/flutter/issues/131568

Implemented:
* Developer can specify a "backdrop id" which indicates that a backdrop layer should share the input texture and potentially cached filter for a layer.
* Removes second save layer for each backdrop filter
* Removes save layer trace event for backdrop filter
* Can fuse backdrop filters if there is more than one identical filter

TBD:
* Adjust heruristic to avoid applying bdf filter to entire screen

Suggestions: applying a bdf should be a distinct operation from a save layer in the DL builder/dispatcher. The saveLayer implmenentation in the impeller dispatcher is super convoluted because it needs to handle both.

### Video

Video starts with normal bdf then I hot reload to specify that the bdfs share inputs/filters. This is running on a pixel 8 pro

Change to the macrobenchmark app is just:
```dart
  Widget build(BuildContext context) {
    Widget addBlur(Widget child, bool shouldBlur) {
      if (shouldBlur) {
        return ClipRect(
          child: BackdropFilter(
            filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5),
            backdropId: 1, // Added ID
            child: child,
          ),
        );
      } else {
        return child;
      }
    }
```

https://github.com/user-attachments/assets/22707f97-5825-43f1-91b4-1a02a43437f5

Requires framework changes in https://github.com/jonahwilliams/flutter/pull/new/backdrop_id
2024-10-18 15:38:34 +00:00
Brandon DeRosier
518ada1675 [Flutter GPU] Remove Command/VertexBuffer usage from Flutter GPU. (flutter/engine#55893)
Resolves https://github.com/flutter/flutter/issues/156764.
Resolves https://github.com/flutter/flutter/issues/155335.

- Remove Command/VertexBuffer from Flutter GPU.
- Separate vertex/index count into `impeller::RenderPass::SetElementCount(size_t count)` & accurately document its behavior.
- Make Flutter GPU uniform/texture bindings re-assignable.
- Remove unnecessary templates.
2024-10-17 22:39:19 +00:00
Yegor
4a93a6a08b Introduce SemanticsFlag.hasSelectedState to the engine API (flutter/engine#55780)
Introduce `SemanticsFlag.hasSelectedState` to the engine API. At this point the flag is not backed by any engine functionality. See also: https://github.com/flutter/flutter/issues/66673#issuecomment-2402903402

| ⚠️ WARNING           |
|:----------------------------|
| Submit _AFTER_ https://github.com/flutter/flutter/pull/157017 and https://github.com/flutter/flutter/pull/157061 land in the framework     |

A step towards https://github.com/flutter/flutter/issues/66673
2024-10-17 22:01:34 +00:00
Jonah Williams
d3ed232dab [Impeller] flood input coverage with destructive color filter. (flutter/engine#55758)
Fixes https://github.com/flutter/flutter/issues/126389
Fixes https://github.com/flutter/flutter/issues/137090
Fixes https://github.com/flutter/flutter/issues/154035

If this bit is set, the output of a color filter should flood to the input of a filter to parent clip. We're not checking this right now and so all color filter content is treated as bounded.

This needs to flood the input as the image filter (which occurs afterwards) should process the flooded input.
2024-10-17 02:30:01 +00:00
Jonah Williams
61460afe48 [Impeller] remove STB backend. (flutter/engine#55842)
Delete the STB typographer backend.

Fixes https://github.com/flutter/flutter/issues/156429
2024-10-14 18:16:20 +00:00
Jim Graham
9e747c2eb6 Delete last usages of MockCanvas test mechanism (flutter/engine#55840)
The MockCanvas API was originally used to test the output of rendering methods to match them against a reference set of "MockData" structures. This API has been superseded by just using a DisplayListBuilder to record reference operations and then to compare the resulting DisplayList objects.

This PR deletes the last remaining uses of MockCanvas as well as the mechanism itself.
2024-10-12 05:15:17 +00:00
AthulJoseph
3214f65fa3 [Impeller] Added support to set polygon mode in Flutter GPU. (flutter/engine#55804)
Added support to set polygon mode in Flutter GPU. This fixes the issue [#142732](https://github.com/flutter/flutter/issues/142732).
2024-10-12 01:07:36 +00:00
Jim Graham
3f0d57e071 [DisplayList] Create DlFoo type variants to start moving away from Skia types in API (flutter/engine#55812)
This is the beginning of the bulk of de-skia-fication work in the engine. All of the standard types in the DlCanvas API now have overloads that specify the corresponding Dl type, mainly for Dl*Rect and DlPoint types. This enables further work to switch from SkFoo types to DlFoo types in the various engine modules culminating in the elimination of the old methods that use the Sk types.

All of the former methods that used the basic Sk types are now implemented as inlinable translation overloads and the underlying implementations of DlCanvas now implement only the newer style interfaces so that they don't need to be further modified as we eliminate the old Skia types from the interface.

There are still a couple of Skia types remaining in the DlCanvas API without any DL type variants which will be handled in a future phase:
- SkRRect
- SkRSXform
- SkTextBlob (will be hidden behind a common interface along with TextFrame)
- SkImageInfo (only used in a few calling sites)
2024-10-11 00:42:23 +00:00
gaaclarke
90cea20d09 fixes mask blurs on stoked gradient geometry (flutter/engine#55717)
fixes https://github.com/flutter/flutter/issues/155930

This starts taking into account the translation of the entity that is
snapshotted when performing the gaussian blur. I'm uncertain under what
conditions, but sometimes the snapshot logic would need this offset. The
linked issue and added tests demonstrate those cases.

## 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-10-08 15:20:50 -07:00
Jason Simmons
d8d3d6ac4b [Impeller] Do not scale the miter limit applied to stroked text (flutter/engine#55745)
Fixes https://github.com/flutter/flutter/issues/156224
2024-10-08 22:07:19 +00:00
AthulJoseph
a01daf5555 Added support to set primitive type (flutter/engine#55514)
Added a way to specify the PrimitiveType when encoding commands in the RenderPass.

This partially fixes the issue #142732
2024-10-08 21:57:10 +00:00
Jim Graham
ab7af6ffb2 Honor blur tile mode in BackdropFilter widget on Skia backend (flutter/engine#55640)
The blur ImageFilter has a tile mode that describes how to sample pixels near the edge of the source. When used as a BackdropFilter this behavior is important as the wrong tile mode can cause distracting flashing as app content is scrolled under foreground widgets that blur their background. Unfortunately the Skia backend used to default the tile mode for all backdrop filters to `clamp` mode with no way to update it and that mode was the one that produced the most distracting flashing.

Recently Skia opened up control over the tile mode used for backdrop filters and we now take advantage of that capability so that app developers can now set the tile mode to a nicer value.
2024-10-05 04:58:30 +00:00
Brandon DeRosier
3b3ffcb8cd [Flutter GPU] Add WindingOrder. (flutter/engine#55413)
Resolves https://github.com/flutter/flutter/issues/155636.

(Extends test in https://github.com/flutter/engine/pull/55409)
2024-10-05 02:04:04 +00:00
Jim Graham
7f99da5b92 [Impeller] Use a squircle-sdf-based algorithm for fast blurs (flutter/engine#55604)
Use a Squircle Signed Distance Field based algorithm to do a very fast approximation of rrect blurs.

This PR is to provide reference within the team to discuss the future of the algorithm compared to the Gaussian approximation functions that are currently in use. It isn't a complete solution, but can be completed easily with a little more work.

Notably, it doesn't handle elliptical round rects, only circular corners.
Could stand to include an attribution to the source (https://raphlinus.github.io/graphics/2020/04/21/blurred-rounded-rects.html)
2024-10-04 20:24:15 +00:00
Jonah Williams
9d8929af60 [Impeller] generate mipmaps for toImage. (flutter/engine#55655)
Fixes https://github.com/flutter/flutter/issues/156161

Mips must be eagerly generated for Picture.toImage and friends so that filter quality (mip sampling) works as expected.
2024-10-04 17:49:55 +00:00
Jonah Williams
959b7c6b60 [Impeller] clamp render target size at max texture size. (flutter/engine#55628)
Part of https://github.com/flutter/flutter/issues/128912

If an intermediate render target would be larger than the max texture size, then clamp the texture.
2024-10-04 03:39:14 +00:00
Jason Simmons
3ad82894c5 [Impeller] Do not cull in TextFrameDispatcher::drawDisplayList if the transform has perspective (flutter/engine#55602)
Fixes https://github.com/flutter/flutter/issues/155947
2024-10-03 19:26:05 +00:00
Jonah Williams
c95afa281b Fix npe during skia dispatch of drawAtlas (flutter/engine#55497)
Colors are optionally provided, so make sure to null check the array.

Fixes https://github.com/flutter/flutter/issues/155783
2024-09-28 19:13:18 +00:00
Jason Simmons
faa865b425 [Impeller] Apply some recent color filter fixes to BlendFilterContents::CreateForegroundAdvancedBlend (flutter/engine#55470)
Some recent changes affecting color filters (https://github.com/flutter/engine/pull/55411, https://github.com/flutter/engine/pull/55448) need to be done for both Porter-Duff and advanced blend modes
2024-09-27 21:42:49 +00:00
Jonah Williams
b9d92a4d0c [Impeller] remove entity pass and re-combine canvas implementations. (flutter/engine#55019)
Shouldn't land until experimental canvas bakes a while

Major milestone along the route to making display list the impeller API. Removes the secondary compositor in entity pass. After this point, we can begin ripping out the DL->Aiks conversions and making entities more efficient.

Fixes https://github.com/flutter/flutter/issues/132417
Fixes https://github.com/flutter/flutter/issues/126386
Fixes https://github.com/flutter/flutter/issues/155114

Part of https://github.com/flutter/flutter/issues/142054
2024-09-26 21:20:23 +00:00
gaaclarke
015281d470 fixes color filter + advanced blends (flutter/engine#55448)
fixes https://github.com/flutter/flutter/issues/155691

I'm also renaming the test I just introduced, it was named wrong, talking about "image filter", not "color filter".

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