25290 Commits

Author SHA1 Message Date
Rulong Chen(陈汝龙)
ba2b335b99 Fix NPE when platform plugin delegate is null (flutter/engine#49391)
Fixes: 
https://github.com/flutter/flutter/issues/140600
https://github.com/flutter/flutter/issues/140031

## 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.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
2024-01-02 08:54:39 -08:00
Rulong Chen(陈汝龙)
62abbc2a03 Add try-with-resource support to TraceSection (flutter/engine#49445)
This PR adds a new way to define scoped trace events in Java, using the try-with-resource construct. This makes code simpler to read, and less error-prone.

Before:
```java
try {
  TraceSection.begin("name");
  // ....
} finally {
  TraceSection.end();
}
```

Now:
```java
try (TraceSection e = TraceSection.scoped("name")) {
  // ...
}
```

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-01-02 16:35:19 +00:00
skia-flutter-autoroll
f4bf7e1ad2 Roll Dart SDK from 4b2415d82948 to 54ae19428139 (1 revision) (flutter/engine#49423)
https://dart.googlesource.com/sdk.git/+log/4b2415d82948..54ae19428139

2023-12-29 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.3.0-273.0.dev

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dart-sdk-flutter-engine
Please CC aaclarke@google.com,dart-vm-team@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter Engine: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-12-29 17:43:08 +00:00
skia-flutter-autoroll
0de19e0064 Roll Dart SDK from 69ef0e9b3570 to 4d83ab20df11 (1 revision) (flutter/engine#49420)
https://dart.googlesource.com/sdk.git/+log/69ef0e9b3570..4d83ab20df11

2023-12-29 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.3.0-271.0.dev

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dart-sdk-flutter-engine
Please CC aaclarke@google.com,dart-vm-team@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter Engine: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-12-29 07:42:26 +00:00
Loïc Sharma
e7b8646416 [Windows] Move DWM flush to Windows proc table for mocking (flutter/engine#49398)
The `FlutterWindowsView` uses the `DwmFlush` win32 API to prevent artifacts during window resizing.

Currently, the view used the `FlutterWindow` to allow mocking this win32 API. However, the window is a complex type with lots of other responsibilities. The `WindowsProcTable` is the new preferred type for mocking win32 API.

Part of https://github.com/flutter/flutter/issues/140626

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-12-27 23:41:19 +00:00
skia-flutter-autoroll
48b0033f3d Roll Dart SDK from 5084fdc1d98a to a95d7384db93 (1 revision) (flutter/engine#49401)
https://dart.googlesource.com/sdk.git/+log/5084fdc1d98a..a95d7384db93

2023-12-27 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.3.0-263.0.dev

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dart-sdk-flutter-engine
Please CC aaclarke@google.com,dart-vm-team@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter Engine: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-12-27 05:33:33 +00:00
Loïc Sharma
ed5f58647f [Windows] Move DWM composition status to Windows proc table for mocking (flutter/engine#49397)
The `FlutterWindowsView` needs the `DwmIsCompositionEnabled` win32 API to check whether it should block presents until the v-blank to prevent screen tearing.

Currently, the view used the `FlutterWindow` to allow mocking this win32 API. However, the window is a complex type with lots of other responsibilities. The `WindowsProcTable` is the new preferred type for mocking win32 API.

Part of https://github.com/flutter/flutter/issues/140626

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-12-26 23:08:34 +00:00
Loïc Sharma
e18aa559bd [Windows] Remove PlatformWindow and RenderTarget abstractions (flutter/engine#49312)
The Windows embedder has three ways to get an `HWND`:

1. `GetWindowHandle` which returns the `HWND`
2. `GetPlatformWindow` which returns the `HWND` wrapped as a `PlatformWindow`
3. `GetRenderTarget` which returns the `HWND` wrapped as a `RenderTarget`

These abstractions are no longer useful now that we removed the UWP embedder. This change removes `PlatformWindow` and `RenderTarget` and uses `HWND` directly.

This change is a refactoring with no semantic changes.
2023-12-26 19:34:06 +00:00
skia-flutter-autoroll
ddffb78df2 Roll Dart SDK from cf2d9652297b to add161c68e6d (1 revision) (flutter/engine#49390)
https://dart.googlesource.com/sdk.git/+log/cf2d9652297b..add161c68e6d

2023-12-26 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.3.0-261.0.dev

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dart-sdk-flutter-engine
Please CC dart-vm-team@google.com,jimgraham@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter Engine: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-12-26 01:31:33 +00:00
skia-flutter-autoroll
15d4e2a739 Roll Dart SDK from c1f9520b30d7 to cf2d9652297b (1 revision) (flutter/engine#49382)
https://dart.googlesource.com/sdk.git/+log/c1f9520b30d7..cf2d9652297b

2023-12-23 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.3.0-260.0.dev

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dart-sdk-flutter-engine
Please CC dart-vm-team@google.com,jimgraham@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter Engine: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-12-23 13:37:04 +00:00
skia-flutter-autoroll
92e0e84d14 Roll Dart SDK from eec6568c209f to 25961234c1bc (1 revision) (flutter/engine#49373)
https://dart.googlesource.com/sdk.git/+log/eec6568c209f..25961234c1bc

2023-12-22 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.3.0-258.0.dev

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dart-sdk-flutter-engine
Please CC dart-vm-team@google.com,jimgraham@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter Engine: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-12-22 21:33:12 +00:00
skia-flutter-autoroll
ba55ba32d0 Roll Dart SDK from fe94d9b88531 to 69423a5dd254 (1 revision) (flutter/engine#49354)
https://dart.googlesource.com/sdk.git/+log/fe94d9b88531..69423a5dd254

2023-12-22 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.3.0-255.0.dev

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dart-sdk-flutter-engine
Please CC dart-vm-team@google.com,jimgraham@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter Engine: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-12-22 04:59:23 +00:00
Dan Field
cfdadd3c74 Fix GetImpellerContext for ShellTestPlatformViewGL (flutter/engine#49337)
I tried to do this for Vulkan too but hit the limit of my patience for today on debugging why the Vulkan backend was segfaulting on shutdown.

Half of https://github.com/flutter/flutter/issues/140419
2023-12-22 00:52:23 +00:00
Jim Graham
9611a0b946 [Impeller] Remove use of private Rect fields from PathBuilder (flutter/engine#49334)
This change removes the last usages of the Rect internal fields from outside the class, allowing the removal of a `friend` declaration and paving the way to reimplement the Rect methods with ltrb fields.
2023-12-21 23:01:01 +00:00
Jim Graham
8d8fc753af [Impeller] Do not skip rendering when mask blur is zero (flutter/engine#49342)
The original fix had a bad return value that caused the rendering to abort rather than proceed normally without the blurring.

I also changed the color being used so that the contents would show up in golden diffs which use a white background for unrendered pixels.
2023-12-21 21:59:50 +00:00
Loïc Sharma
6e4ab692e7 [Windows] Fix incorrect surface manager comment (flutter/engine#49335)
https://github.com/flutter/engine/pull/24428 attempted to make surface resizing less expensive by using ANGLE's automatic resizing instead of manually destroying and then re-creating the surface. This caused 
some issues:

1. Flutter's surface size synchronization logic broke: https://github.com/flutter/engine/pull/24682
2. Resizing frameless windows caused the content to wiggle: https://github.com/flutter/flutter/issues/76465

The second issue caused the automatic resizing change to be reverted. However, the first fix was not reverted resulting in an incorrect comment.

Relanding this resizing performance improvement is tracked by https://github.com/flutter/flutter/issues/79427
2023-12-21 21:58:41 +00:00
Harry Terkelsen
20ef29732d Reland "[web] Enforce onDrawFrame/onBeginFrame render rule" (flutter/engine#49336)
Enforces the render rule on the web except in the HTML renderer, which
must still render to the DOM even outside of `onDrawFrame` or
`onBegineFrame` scopes in order for golden tests to continue to work in
the framework.

This is a reland of https://github.com/flutter/engine/pull/49214 with
one change (checking for `renderer.rendererTag == 'html'` in the
`render` method).

## 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
2023-12-21 13:10:27 -08:00
Jenn Magder
e7d1af70f1 Turn on scenario app screenshots (flutter/engine#49066)
Save a recording/screenshot to the uploaded xcresult when a Scenario test fails.

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

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

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

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

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-12-21 19:01:15 +00:00
Chris Bracken
535bb52c87 Revert onrender change (flutter/engine#49333)
This reverts https://github.com/flutter/engine/pull/49214 and
https://github.com/flutter/engine/pull/48758.

https://github.com/flutter/engine/pull/49214 appears to cause a Flutter
Gold diff during the engine roll. See
https://github.com/flutter/flutter/pull/140434 for an example. It's
unclear to me whether this is an expected diff and should be approved or
unexpected and should be reverting, so reverting to the last previous
rollable state.

## Pre-launch Checklist

- [ ] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] 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.
- [ ] 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 `///`).
- [ ] I signed the [CLA].
- [ ] 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
2023-12-21 11:00:30 -08:00
Yegor
409fb68d25 [web] autofocus in new routes (flutter/engine#47727)
Fixes https://github.com/flutter/flutter/issues/138371

When a new route pops up the expectation is that the screen reader focuses on something in the new route. Since routes typically result in DOM nodes being replaced, the current effect is that the screen reader simply unfocuses from the page, causing the user to have to refocus on back on the page and look for elements to interact with, which is a poor user experience. The current workaround is to use `autofocus`, but that doesn't scale as it's easy to forget, and if the route in question is maintained by a different person you may not even have enough control over it to set `autofocus` on anything. For example, this is the case with Flutter's default date picker. All you have is `showDatePicker` and there's no way to control the focus.

With this change the route (managed by the `Dialog` primary role) will check if a widget requested explicit focus (perhaps using `autofocus`), and if not, looks for the first descendant that a screen reader can focus on, and requests focus on it. The auto-focused element does not have to be literally focusable. For example, plain `Text` nodes do not have input focus (i.e. they are not `isFocusable`) but screen readers can still focus on them. If such an element is found, the web engine requests that the browser move focus to it programmatically (`element.focus()`), which causes the screen reader to move the a11y focus to it as well, but it sets `tabindex=-1` so the element is not focusable via keyboard or mouse.
2023-12-21 18:11:13 +00:00
Jim Graham
910a5fa5d8 Ensure sorted rects in ui.Canvas for legacy compatibility (flutter/engine#49309)
Fixes https://github.com/flutter/flutter/issues/140490
2023-12-21 08:34:23 +00:00
skia-flutter-autoroll
ead5ee45fd Roll Dart SDK from 63a452b45026 to 1d0c3ecd1349 (1 revision) (flutter/engine#49318)
https://dart.googlesource.com/sdk.git/+log/63a452b45026..1d0c3ecd1349

2023-12-21 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.3.0-251.0.dev

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dart-sdk-flutter-engine
Please CC dart-vm-team@google.com,jimgraham@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter Engine: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-12-21 06:19:06 +00:00
Dan Field
ae9289f5c1 [Impeller] Make IPLR files multi-platform (flutter/engine#49253)
This is part of the work towards supporting OpenGLES and Vulkan for runtime stage shaders.

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

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

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

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

I have run some but not all tests locally.
2023-12-21 06:17:26 +00:00
David Iglesias
b3b7451d1e [web] Defer injection of platform views until needed. (flutter/engine#48960)
This PR defers the injection of the contents of a Platform View into the DOM of the page, until the Platform View is really needed by a renderer.

This effectively means that a `platformView` will be injected into the DOM the first time that its `slot` is injected into the Shadow DOM of the Flutter web app.

This makes passing a `(flutter)ViewId` parameter from the framework unnecessary, even in a multi-view app.

The only cases in which this change might be breaking is those where an app tries to locate the just-created Platform View by looking into the DOM from the [`onPlatformViewCreated` callback](https://api.flutter.dev/flutter/widgets/HtmlElementView/onPlatformViewCreated.html). In those cases, [a fix like this](https://github.com/flutter/packages/pull/5660) is needed (use the **only [documented way](https://api.flutter.dev/flutter/dart-ui_web/PlatformViewRegistry/getViewById.html)** to obtain the Platform View contents from its `viewId`)

## Issues

Fixes https://github.com/flutter/flutter/issues/137287
Closes https://github.com/flutter/flutter/pull/136548

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-12-21 04:21:23 +00:00
skia-flutter-autoroll
352a5a9e90 Roll Skia from 29917d8c97ca to 4b16117e94b2 (4 revisions) (flutter/engine#49310)
https://skia.googlesource.com/skia.git/+log/29917d8c97ca..4b16117e94b2

2023-12-20 johnstiles@google.com Revert "Fix fuzzer-discovered Metal issue with sk_LastFragColor."
2023-12-20 johnstiles@google.com Fix fuzzer-discovered Metal issue with sk_LastFragColor.
2023-12-20 johnstiles@google.com Remove unused accessor ThreadContext::Compiler.
2023-12-20 johnstiles@google.com Move Compiler::convertIdentifier method into SymbolTable.

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skia-flutter-autoroll
Please CC brianosman@google.com,jimgraham@google.com,jvanverth@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry
To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-12-21 02:11:14 +00:00
Loïc Sharma
f3381e1080 Reland "[Windows] Move to FlutterCompositor for rendering" (flutter/engine#49262)
## Reland

https://github.com/flutter/engine/pull/48849 was reverted as it incorrectly expected to receive always 1 layer. However, the engine will present 0 layers on an ["empty" app](6981fe6fd3/dev/integration_tests/ui/lib/empty.dart (L8-L19)). This pull request is split into two commits:

1. df604a16c0 is the original pull request, unchanged
2. c30b369289 adds the ability to "clear" the view if the engine presents 0 layers

## Original pull request description

This migrates the Windows embedder to `FlutterCompositor` so that the engine renders off-screen to a framebuffer instead of directly onto the window's surface. This will allow us to support platform views and multiple views on Windows.

Addresses https://github.com/flutter/flutter/issues/128904

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-12-21 01:23:20 +00:00
gaaclarke
53c07de30c Reland [Impeller] new blur: refactored math and fixed expanded padding size (flutter/engine#49302)
https://github.com/flutter/engine/pull/49206 had to reland because it had integration failures.  The changes are in a separate commit below.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-12-21 01:16:23 +00:00
Tong Mu
e986324f93 Multiview pipeline Pt. 1: Skip illegal render calls (flutter/engine#49266)
This is one of a series of changes to reland https://github.com/flutter/engine/pull/47239.

This PR changes `Animator` so that if `Render` is not called after a `BeginFrame`, this call is ignored.

Note that this is slightly different from https://github.com/flutter/engine/pull/47239. Instead of saying that we should ultimately change this skip to an assertion, this PR aims to keep the skip as the final shape. This is because a while ago we (with @goderbauer and @loic-sharma) decided that `PlatformDispatcher` should contain as little logic as possible to allow testing, and instead serve as a minimal native function binding, which means that we should eventually move the code that validates calling convention to the engine. 

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-12-20 22:50:09 +00:00
Bartek Pacia
94d48e76c1 SemanticsUpdateBuilder: make all args non-null (flutter/engine#49148)
This PR is inspired by [the suggestion made here](https://github.com/flutter/engine/pull/47961#discussion_r1406581284).
2023-12-20 22:41:13 +00:00
gaaclarke
ff7148c8c2 [Impeller] fixed Rect::Contains (flutter/engine#49294)
fixes https://github.com/flutter/flutter/issues/140464

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-12-20 22:31:02 +00:00
skia-flutter-autoroll
31dd800cac Roll Dart SDK from 97c3b7e1885a to 1aef027ec953 (1 revision) (flutter/engine#49295)
https://dart.googlesource.com/sdk.git/+log/97c3b7e1885a..1aef027ec953

2023-12-20 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.3.0-248.0.dev

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dart-sdk-flutter-engine
Please CC dart-vm-team@google.com,jimgraham@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter Engine: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-12-20 22:29:31 +00:00
gaaclarke
3236b4534e Revert "[Impeller] new blur: refactored math and fixed expanded padding size" (flutter/engine#49298)
Reverts flutter/engine#49206
2023-12-20 12:58:27 -08:00
gaaclarke
0538fd9c21 [Impeller] new blur: refactored math and fixed expanded padding size (flutter/engine#49206)
This refactors the math so that it makes it easier to conditionally add
padding. That optimization was removed for now since it wasn't quite
working satisfactorily yet.

This also fixes the math used to expand the coverage hint. There is no
visual test for it since it would only ever result in wasteful expansion
that would show up in the benchmarks.

## 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
2023-12-20 11:45:23 -08:00
Tong Mu
2e551cb5c3 Multi-view pointer event (flutter/engine#46213)
This PR adds a new field `view_id` to embedder API's `FlutterPointerEvent`, allowing platforms to specify the source view of pointer events.

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

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-12-20 19:21:22 +00:00
Harry Terkelsen
20f78ab352 [web:multiview] Only call Renderer.clearFragmentProgramCache on hot restart (flutter/engine#48758)
Previously, we would do this any time a view was disposed, which would
clear ALL fragment programs in the app, not just the ones associated
with the view.

## 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
2023-12-20 11:12:28 -08:00
Brandon DeRosier
f9785c0498 [Impeller] Add interactive Blur+Clip AiksTest. (flutter/engine#49283)
I used this interactive toy to inspect the change in https://github.com/flutter/engine/pull/49206. Perhaps this can become our "kitchen sink" interactive toy for debugging blurs in Aiks (where we can easily form clips and add options for other paint state interactions as they become relevant).

Video of `GaussianBlurRotatedAndClippedInteractive`:

https://github.com/flutter/engine/assets/919017/e5be5f38-3644-43c4-a3d0-d08b03fcb7b0

Video of `GaussianBlurFilter` with the "Combined sigma" checkbox to make playing with the new blur easier:

https://github.com/flutter/engine/assets/919017/65bd6567-83be-4337-8827-03e6a3dee9b1
2023-12-20 18:06:13 +00:00
Sergiy Dubovik
b7264de08d [macos] FlutterKeyboardManager memory leak fix (flutter/engine#48824)
We are embedding Flutter into MacOS app, and noticed that there is a
leak. `leaks` tool says there is a cycle reference:

```
12 (2.11K) ROOT CYCLE: <FlutterKeyboardManager 0x29ec55f40> [80]
       8 (432 bytes) __strong _primaryResponders --> ROOT CYCLE: <NSMutableArray 0x29ec560a0> [64]
          7 (368 bytes) ROOT CYCLE: <NSMutableArray (Storage) 0x29ec56140> [32]
             4 (224 bytes) ROOT CYCLE: <FlutterEmbedderKeyResponder 0x29ec56310> [80]
                1 (48 bytes) __strong _sendEvent --> ROOT CYCLE: <__NSMallocBlock__ 0x29ec56360> [48]
                   __strong [capture] --> CYCLE BACK TO <FlutterKeyboardManager 0x29ec55f40> [80]
                1 (48 bytes) __strong _pendingResponses --> <NSMutableDictionary 0x29ec563c0> [48]
                1 (48 bytes) __strong _pressingRecords --> <NSMutableDictionary 0x29ec56390> [48]
             2 (112 bytes) <FlutterChannelKeyResponder 0x29ec56450> [48]
                1 (64 bytes) __strong _channel --> <FlutterBasicMessageChannel 0x29ec564e0> [64]
       2 (1.55K) __strong _layoutMap --> <NSMutableDictionary 0x29ec56630> [48]
          1 (1.50K) <NSMutableDictionary (Storage) 0x123c34a00> [1536]
       1 (64 bytes) __strong _pendingEvents --> <NSMutableArray 0x29ec565f0> [64]
```

This patch uses `weak` pointer to `self` instead of implicit `strong`.

## 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.
2023-12-20 09:04:10 -08:00
Victoria Ashworth
75cf8ed82c Fix testAppExtensionLaunching for Xcode 15/iOS 17 (flutter/engine#49242)
Fixes https://github.com/flutter/flutter/issues/140181.

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

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-12-20 16:58:19 +00:00
skia-flutter-autoroll
07c8907f45 Roll Skia from 8060d6b36066 to 9cb1bb1164ea (2 revisions) (flutter/engine#49288)
https://skia.googlesource.com/skia.git/+log/8060d6b36066..9cb1bb1164ea

2023-12-20 johnstiles@google.com Fix IWYU on the tree.
2023-12-20 johnstiles@google.com Allow an SkSL compiler to be created without shader caps.

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skia-flutter-autoroll
Please CC brianosman@google.com,jimgraham@google.com,jvanverth@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry
To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-12-20 16:20:18 +00:00
skia-flutter-autoroll
f23f13cec1 Roll Skia from d0f09ad481f7 to 8060d6b36066 (1 revision) (flutter/engine#49285)
https://skia.googlesource.com/skia.git/+log/d0f09ad481f7..8060d6b36066

2023-12-20 johnstiles@google.com Remove ShaderCaps from the SkSL frontend entirely.

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skia-flutter-autoroll
Please CC brianosman@google.com,jimgraham@google.com,jvanverth@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry
To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-12-20 15:34:06 +00:00
Kevin Chisholm
1446658062 [release] Update release config (flutter/engine#49254)
Updates automated release note configuration with the following:

* Corrects the label name for impeller changes.
* Adds fallback "Other Changes" section that includes unlabeled changes.
2023-12-20 07:02:01 -06:00
skia-flutter-autoroll
e56eb208be Roll Dart SDK from 4c59838945d9 to 1732c4c92ccd (1 revision) (flutter/engine#49269)
https://dart.googlesource.com/sdk.git/+log/4c59838945d9..1732c4c92ccd

2023-12-20 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.3.0-245.0.dev

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dart-sdk-flutter-engine
Please CC dart-vm-team@google.com,jimgraham@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter Engine: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-12-20 01:59:04 +00:00
Michael Goderbauer
dbfad3bfed Sync lints with flutter/flutter (flutter/engine#49192) 2023-12-20 01:12:30 +00:00
Harry Terkelsen
50beeb112d [web] Enforce onDrawFrame/onBeginFrame render rule (flutter/engine#49214)
Also update tests to conform to the render rule.

The render rule is that the call to `render` should only occur in the scope of an `onDrawFrame` or `onBeginFrame` call. As a side effect, this change also fixes a memory leak which occurs in tests using FakeAsync in the `flutter_test` environment (because they don't render anymore).

Fixes https://github.com/flutter/flutter/issues/137073
Fixes https://github.com/flutter/flutter/issues/137669

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-12-19 23:18:10 +00:00
Bartek Pacia
61a61a8632 [Docs] Add more info about running tests on iOS (flutter/engine#48859)
I wish this info was there, that'd save me from looking inside the script.
2023-12-19 22:54:54 +00:00
skia-flutter-autoroll
5991c11dc0 Roll Skia from 48f959a857da to d0f09ad481f7 (3 revisions) (flutter/engine#49264)
https://skia.googlesource.com/skia.git/+log/48f959a857da..d0f09ad481f7

2023-12-19 johnstiles@google.com Update RTFlip handling to avoid caps-bit checks in the front-end.
2023-12-19 johnstiles@google.com Remove FBFetch/DualSourceBlending caps bit checks from the front-end.
2023-12-19 brianosman@google.com Limit the size of a layer's FilterSpan to 16 filters

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skia-flutter-autoroll
Please CC brianosman@google.com,jimgraham@google.com,jvanverth@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry
To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-12-19 22:53:46 +00:00
Tong Mu
927fd200ed Revert "Reland 2: Multiview Pipeline (#47239)" (flutter/engine#49238)
This reverts commit 87171e73397f7edfd4c145fbaebdd7208954debf.

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

b/307872797

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-12-19 22:30:01 +00:00
skia-flutter-autoroll
05268a49ed Roll Dart SDK from e8cdc554c598 to 4c59838945d9 (2 revisions) (flutter/engine#49261)
https://dart.googlesource.com/sdk.git/+log/e8cdc554c598..4c59838945d9

2023-12-19 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.3.0-244.0.dev
2023-12-19 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.3.0-243.0.dev

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dart-sdk-flutter-engine
Please CC dart-vm-team@google.com,jimgraham@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter Engine: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-12-19 22:07:00 +00:00
Jim Graham
57c1db2af6 Make sure run_tests.py runs dart tests on Skia (flutter/engine#49260)
Today the default renderer on hosts is Skia, but if we ever change the default then we will be testing on Impeller+default(Impeller) rather than both Skia and Impeller. Change the flutter_tester launch arguments to explicitly disable Impeller when we want to test Skia so that we will always test on both platforms.
2023-12-19 21:51:09 +00:00
Zachary Anderson
971c03d9e3 Rolls clang to 725656bdd885483c39f482a01ea25d67acf39c46 (flutter/engine#49248)
We're on a version of clang that crashes a lot on macOS. This PR rolls
clang forward to a new release from the Fuchsia toolchain team. If it
does not fix the crash, we can roll back with
https://github.com/flutter/engine/pull/49249. Both rolling forward and
back require the fixes to the `.mm` file in this PR.
2023-12-19 13:35:42 -08:00