1348 Commits

Author SHA1 Message Date
Jonah Williams
192939c3a6 [impeller] merge aiks directory into impeller/display_list directory. (flutter/engine#55471)
Aiks has been gutted, and most of the reming types need to be merged with dl/entity types and deleted. this is difficult to do with impeller/display_list and aiks as separate gn targets as it requires circular deps.

Lets merge them and remove the aiks directory.
2024-10-02 19:07:57 +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
Jonah Williams
dd7948b2fe [Impeller] add basic culling checks during text frame dispatcher. (flutter/engine#55168)
Fixes https://github.com/flutter/flutter/issues/155133

Dl dispatching still relies on cull rects computed during that dispatch process. Make sure that the text frame dispatcher doesn't populate text frames that are way offscreen.

This culling is more conservative than the rendering dispatcher. We'd need to do some refactoring so the logic isn't repeated multiple times.
2024-09-24 23:37:06 +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
Jonah Williams
9235fbb695 [impeller] add Android flag for disabling surface control for debugging. (flutter/engine#55185)
I've found a few instances where Vulkan worked correctly but surface control did not. lets add a debugging flag we can ask folks to try to narrow down the issue.
2024-09-13 21:39:20 +00: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
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
Jonah Williams
0a0883219e [engine] dispatch platform channel messages through event loop, except navigation on start. (flutter/engine#55027)
This is a re-land of https://github.com/flutter/engine/pull/55006, except that we special case the navigation channel to immediately dispatch its message if the isolate is not yet running.

This preserves the existing behavior relied upon by several iOS add2app tests, as well as the still used embedder v1 - and potentially undicovered future embedders.
2024-09-08 17:38:18 +00:00
auto-submit[bot]
f84f9c92b5 Reverts "[engine] reland: always post tasks for platform channel responses. (#55006)" (flutter/engine#55022)
Reverts: flutter/engine#55006
Initiated by: jonahwilliams
Reason for reverting: still failling mac module test
Original PR Author: jonahwilliams

Reviewed By: {jason-simmons}

This change reverts the following previous change:
Reland of https://github.com/flutter/engine/pull/54975

Fixes the initial route behavior for iOS. Previously the initial route setting would _always_ be posted as a task, which after merging the threads would fire after isolate creation, thus it would not actually update the initial route setting. Fixed Engine constructor so that it reads the initial route from the settings.
2024-09-07 02:56:46 +00:00
Jonah Williams
8ca7e1cd90 [engine] reland: always post tasks for platform channel responses. (flutter/engine#55006)
Reland of https://github.com/flutter/engine/pull/54975

Fixes the initial route behavior for iOS. Previously the initial route setting would _always_ be posted as a task, which after merging the threads would fire after isolate creation, thus it would not actually update the initial route setting. Fixed Engine constructor so that it reads the initial route from the settings.
2024-09-06 23:48:09 +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
547dbe4c4c [impeller] fake image for fake tests. (flutter/engine#54974)
Simulator only change to allow toImage and toByteData to not fail when there is no metal context w/ impeller.
2024-09-06 18:53:53 +00:00
auto-submit[bot]
f3c121ecb5 Reverts "[engine] always force platform channel responses to schedule a task. (#54975)" (flutter/engine#55000)
Reverts: flutter/engine#54975
Initiated by: jtmcdole
Reason for reverting: I believe this change caused flutter/flutter to break in an engine roll. It was one of two changes - the other being a webui change.

Tests broken:

module_test_ios:  testDualCold

router test:

```
[2024-09-05 17:43:20.837343] [STDOUT] stderr: [ +135 ms] VMServiceFlutterDriver: Connected to Flutter application.
[2024-09-05 17:43:20.841927] [STDOUT] stdout: [   +4 ms] 00:00 +0: 
Original PR Author: jonahwilliams

Reviewed By: {jason-simmons, johnmccutchan}

This change reverts the following previous change:
If we use runNowOrPostTask on platform channel responses, then we may not wake up the dart message loop. If nothing else wakes it up, then the embedder may hang on platform channel responses.

This fixes several google3 integration tests when run in merged thread mode.
2024-09-06 15:54:46 +00:00
Jonah Williams
326bd99dc9 [engine] always force platform channel responses to schedule a task. (flutter/engine#54975)
If we use runNowOrPostTask on platform channel responses, then we may not wake up the dart message loop. If nothing else wakes it up, then the embedder may hang on platform channel responses.

This fixes several google3 integration tests when run in merged thread mode.
2024-09-05 20:49:56 +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
Jonah Williams
5cfb3bbf9d [Impeller] delete impeller image class. (flutter/engine#54767)
This class does nothing but wrap impeller::Texture. Lets just use impeller::Texture.
2024-08-26 00:20:32 +00:00
Jonah Williams
02a6c7a676 [Impeller] use blit pass to resize decoded images. (flutter/engine#54606)
Fixes https://github.com/flutter/flutter/issues/153623
Fixes https://github.com/flutter/flutter/issues/153788

* Avoids slow CPU resizer
* Avoids us having to write any code at all to resize these images
* Avoids reading from the GPU staging buffers that are not read cached (similar to Glyph cache performance issues).

Also changes the single frame codec upload to either use the device private storage path or to defer upload until the GPU returns. This allows us to ensure that mips are always constructed and makes sure that we don't need to keep around the CPU texture reisze that depends on the Skia software backend.

Separately, I updated the deferred task system to allow separate success/failure tasks to make it easier to track the final state.
2024-08-21 20:22:09 +00:00
Jonah Williams
8b7101800f [Impeller] finish experimental canvas changes. (flutter/engine#54569)
Make sure the old dispatcher cannot be used if the new dispatcher is enabled. Migrate tests using old canvas to new canvas, mostly to make deleting the old one easier...
2024-08-19 19:37:17 +00:00
Jonah Williams
67cc9696a8 [Impeller] Switch from AIKS canvas to DL based canvas implementation. (flutter/engine#53781)
The first part of switching Impeller/Aiks to using the display list instead of re-recording rendering operations. This should eventually let us cut CPU overhead of the raster thread for complex applications, though it should have no impact on GPU performance.

This does introduce a GLES only rendering bug that I haven't had luck tracking down, but is almost certainly due to switching to DL computed depth values. I'd like to handle this as a follow up when we prioritize GLES. https://github.com/flutter/flutter/issues/153504

Part of https://github.com/flutter/flutter/issues/142054
2024-08-15 19:03:43 +00:00
Zachary Anderson
2afd56d187 Revert "Reland: Partial repaint platform views" (flutter/engine#54537)
Reverts flutter/engine#54231

Speculatively reverting for
https://github.com/flutter/flutter/issues/153335
2024-08-13 08:20:10 -07:00
Brandon DeRosier
b19fe31562 Revert "[Impeller] remove scene3d support." (flutter/engine#54502)
Reverts flutter/engine#54453

Not quite ready to remove Impeller Scene yet because I'm still porting
the animation functionality. Keeping it around allows me to switch back
and forth to compare without having to recompile the engine.

Over a month ago I said something like "we can revert this a couple of
weeks from now" in one of the Impeller meetings. But for better or worse
(better, I think), I ended up spending a ton of time trying to make the
PBR good first (which doesn't exist in this C++ version).
2024-08-12 10:28:51 -07:00
Chinmay Garde
f60c0e325a Remove fml::size. (flutter/engine#54476)
std::size because standard in C++17.
2024-08-09 20:01:28 +00:00
Jonah Williams
198d1f1077 [Impeller] remove scene3d support. (flutter/engine#54453)
Now that Flutter GPU is a preview, the technical debt from having an ifdef controlled additional rendering mode can be removed.
2024-08-09 16:38:56 +00:00
Matej Knopp
a02e474f1b Reland: Partial repaint platform views (flutter/engine#54231)
Relands https://github.com/flutter/engine/pull/54219 reverted in
https://github.com/flutter/engine/pull/54230.

The tracked area of `PlatformViewLayer` now covers entire frame ensuring
full repaint when platform view is removed.
Added `FullRepaintAfterRemovingLayer` test.

## 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-07 18:14:13 +02:00
Matan Lurey
4d74b4b05a Cleanup the shell test, removing unused code (flutter/engine#54238)
Guess we'll find out!
2024-07-31 17:31:24 +00:00
auto-submit[bot]
55758e1e8e Reverts "Do not disable partial repaint based on thread merging state (#54219)" (flutter/engine#54230)
Reverts: flutter/engine#54219
Initiated by: jonahwilliams
Reason for reverting: incorrect rendering on last frame after platform view is removed.
Original PR Author: knopp

Reviewed By: {jonahwilliams}

This change reverts the following previous change:
Currently we force full repaint when thread merging is detected, but that is not a good way to determine whether platform view is in hierarchy when thread merging is no longer needed. Alternative solution here makes the PlatformViewLayer  force full repaint when diffing.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-07-30 21:00:26 +00:00
Jonah Williams
9650917c7e [engine] Split encode and submit into two different surface frame callbacks. (flutter/engine#54200)
This makes it much easier to implement the deferred submit required for https://github.com/flutter/engine/pull/53826
2024-07-30 19:58:21 +00:00
Matej Knopp
e078967646 Do not disable partial repaint based on thread merging state (flutter/engine#54219)
Currently we force full repaint when thread merging is detected, but
that is not a good way to determine whether platform view is in
hierarchy when thread merging is no longer needed. Alternative solution
here makes the PlatformViewLayer force full repaint when diffing.

## 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-07-30 21:36:02 +02:00
Jonah Williams
9808dcbb8f [engine] remove raster stats feature. (flutter/engine#54187)
This debugging tool does not give accurate measurements and we've decided to remove it.

See also: https://github.com/flutter/flutter/issues/131941
2024-07-29 20:30:52 +00:00
Jonah Williams
d11db4f8c9 [engine] support combined UI/Platform thread for iOS/Android. (flutter/engine#53656)
Experimentally support merging UI and platform thread on Android/iOS. This works by changing the shell holder to set the UI thread to the platform thread. Several shell APIs that post messages from the platform to ui thread were changed to use RunNowOrPostTask to immediately call the UI task if the threads are the same.

Experimentally, this seems to work reasonably well if there are no platform views. On Android with TLHC it works fine either way, while iOS currently takes a big performance hit.

This can be opted into via a Plist:

```
	<key>FLTEnableMergedPlatformUIThread</key>
	<true/>
```

Or via AndroidManifest.xml:

```
 <meta-data
            android:name="io.flutter.embedding.android.EnableMergedPlatformUIThread"
            android:value="true" />
```

https://github.com/flutter/flutter/issues/150525
2024-07-09 19:32:20 +00:00
Jonah Williams
ef889f9d05 [Impeller] implement experimental canvas in snapshot controller. (flutter/engine#53750)
Fixes https://github.com/flutter/flutter/issues/150994

This ensures that the dart:ui API toImage and toImageSync use the experimental canvas API when the define is set. No other changes.
2024-07-09 19:19:57 +00:00
Jim Graham
34bb05029e [DisplayList] Switch to recording DrawVertices objects by reference (flutter/engine#53548)
The Vertices objects are already allocated in a shared object by default so copying them inline into the recording buffer is usually a waste of time rather than reusing the memory allocated for the shared object by recording a reference. Note that the shared DlVertices objects already inline all of their data so we have good data locality as it is without further copying the data into the buffer.

Might help with https://github.com/flutter/flutter/issues/150513
2024-06-25 17:41:14 +00:00
Kaylee Lubick
2e2f3e35cd Update uses of GrVkBackendContext and other deprecated type names (flutter/engine#53491)
As of [this CL](https://skia-review.googlesource.com/c/skia/+/859125),
`GrVkBackendContext` is an alias for `skgpu::VulkanBackendContext`, so
this updates Flutter to use the GPU-backend agnostic version. See
<https://issues.skia.org/issues/309785258>.

## 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-06-24 07:39:16 -04:00
Jim Graham
c9b612ff9a [DisplayList] Create DrawDashedLine for paragraph code (flutter/engine#53411)
With this minor addition to the DlCanvas/DisplayList API the code in the paragraph builder no longer needs to worry about PathEffect objects and their varying support on the backends.

At this point all PathEffect code in the engine is obsolete and can be deleted, but I'll leave that for a follow-on PR.

The only PathEffect related thing I did delete was support for rendering primitives with a PathEffect in the DL Rendering tests, both because it is a vestigial attribute and also because it would interfere with the new DrawDashedLine rendering test (a PathEffect on top of a PathEffect...).
2024-06-17 22:50:20 +00:00
Jonah Williams
acf48b5a05 [engine] null check texture registry in OnPlatformViewMarkTextureFrameAvailable. (flutter/engine#53334)
From the issue, it looks like an NPE in this closure, we're not sure what else it could be besides the weak ptr - which could be null.

Fixes https://github.com/flutter/flutter/issues/149895
2024-06-11 16:48:03 +00:00
Tong Mu
48799ceebf Make pointer events ignore invalid views (flutter/engine#51925)
With this PR, Flutter will now ignore pointer events for an invalid view, i.e. views that have not been add or have been removed.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-06-06 07:18:20 +00:00
Kaylee Lubick
89547e5ba6 Migrate off deprecated GrVkBackendContext fields (flutter/engine#53122)
Context: https://g-issues.skia.org/issues/309785258

Skia would like to remove these deprecated fields, so this updates
Flutter's use of them to use the new ways.

Note that `VulkanWindow` seems to be unused (or no longer used?) since
there was a mistyped define (`SK_VUKLAN` -> `SK_VULKAN`) causing the
code I am fixing to never be run.

## 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-06-03 14:48:43 -04:00
auto-submit[bot]
ea811b97ba Reverts "Manual roll of Clang from 725656bdd885 to 145176dc0c93 (#52823)" (flutter/engine#52890)
Reverts: flutter/engine#52823
Initiated by: zanderso
Reason for reverting: Engine crashes on framework CI following this roll https://ci.chromium.org/ui/p/flutter/builders/prod/Linux_android%20flutter_gallery__transition_perf_with_semantics/12126/overview
Original PR Author: jason-simmons

Reviewed By: {zanderso}

This change reverts the following previous change:
See https://github.com/flutter/flutter/issues/143178
2024-05-16 22:01:38 +00:00
Jason Simmons
31d7cb2870 Manual roll of Clang from 725656bdd885 to 145176dc0c93 (flutter/engine#52823)
See https://github.com/flutter/flutter/issues/143178
2024-05-16 17:16:21 +00:00
Chinmay Garde
f3934883b0 Delete Settings::msaa_samples. (flutter/engine#52780)
Fixes https://github.com/flutter/flutter/issues/148257
2024-05-13 23:51:11 +00:00
Chinmay Garde
f20b17a2ae [Impeller] Prepare a SkiaGPU-less iOS build. (flutter/engine#52748)
The size of the LTO build of the engine with the dylib compressed is as follows:

```sh
$ du -k libFlutter*
5236	libFlutter.dylib.tar.gz
4324	libFlutterSlimpeller.dylib.tar.gz
```

Sizes are in KiB. This represents a binary size reduction of 17.41% of the compressed artifacts. The compression ratios will likely differ based on the compression scheme.

Uncompressed, the sizes are:

```sh
$ du -k libFlutter*
16920	libFlutter.dylib
14044	libFlutterSlimpeller.dylib
```

This represents a binary size reduction of 16.99% which is in the same ballpark.

The really mucky bit was backing out the raster cache and persistent cache. I want to clean that up in a later patch so that those TUs are part of a separate submodule.

Opting out of Impeller will lead to a fatal log at startup saying the opt-out is disallowed.

Fixes https://github.com/flutter/flutter/issues/126606
2024-05-13 21:43:47 +00:00
Jonah Williams
578e769483 [Impeller] treat glyph atlas texture as source of truth, remove copy of SkBitmap. (flutter/engine#52567)
Work towards part of https://github.com/flutter/flutter/issues/138798

Allow updating single glyphs in the glyph atlas, without replacing the entire bitmap. Required to efficiently append/update to large atlases.
2024-05-10 21:39:47 +00:00
Ian Hickson
8966c48831 Remove rasterizerTracingThreshold, checkerboardRasterCacheImages, and checkerboardOffscreenLayers, etc (flutter/engine#52446) 2024-05-02 04:35:04 +00:00
gaaclarke
4429b2f2fe [Impeller] Implements retry for Picture.toImage (flutter/engine#52470)
fixes https://github.com/flutter/flutter/issues/146990

## 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-05-01 08:53:54 -07:00
Tong Mu
94448fc97f Move PointerDataPacketConverter from PlatformView to RuntimeController (flutter/engine#51952)
This is a refactor that moves the `PointerDataPacketConverter` from `PlatformView` to `RuntimeController`. 

This change is made for the following reasons:
- Currently, the pointer data conversion contains no platform specific logic (because the current converter's only responsibility is to make the event sequence conform Flutter's protocol). Therefore these logics should reside in a platform-independent place.
- The converter typically converts one event to many. It's better to have this conversion later than earlier.
- It removes a member from `PlatformView`, making it closer to a pure virtual class.

The reason to choose `RuntimeController` as the destination is because `RuntimeController` manages a map for views, which is required for the converter to implement a later patch https://github.com/flutter/engine/pull/51925.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-04-26 23:45:21 +00:00
Jonah Williams
9dbe934a9b [Impeller] kick off registration and initial PSO compilation of runtime effect earlier. (flutter/engine#52381)
I thought about changing this API so that it blocks on compilation, but I think that isn't necesasary as the workload can happen while the UI thread is building. Plus, even blocking on shader completion does not guarantee that we won't need to compile a variant anyway.

While I was at it I moved the descriptor sets computation to the runtime effect constructor.

With this change the pipleine variant used during the frame is produced much faster than the initial 12ms compilation.

![image](https://github.com/flutter/engine/assets/8975114/42626676-0a71-4503-a3e9-4109c36fbbef)

Fixes https://github.com/flutter/flutter/issues/113719
Fixes https://github.com/flutter/flutter/issues/141222
2024-04-25 20:23:56 +00:00
Alexander Markov
4b268e1ac8 Cleanup obsolete Dart VM flags (flutter/engine#52197)
Remove obsolete Dart VM flags from the lists of allowed Dart VM flags in
the engine.
2024-04-17 10:18:19 -07:00
Jason Simmons
50771f3ad4 Roll reclient, libpng, and zlib (flutter/engine#52072)
Based on https://github.com/flutter/engine/pull/52067
2024-04-16 18:31:30 +00:00
Tong Mu
dc82dbb0b9 Move Shell::Add/RemoveView to PlatformView and refine embedder API doc (flutter/engine#52003)
This PR moves the methods to add or remove views from `Shell` to
`PlatformView`. By design, the `Shell` is supposed to be a messenger
that glues classes together, while `PlatformView` is the operator that
embedders that do not use the embedder API should operate on. The
current design was made due to lack of knowledge to this design.

This also makes `PlatformView` aware of views, which might be a
prerequisite to https://github.com/flutter/engine/pull/51925.

This PR also adds some details to embedder API `AddView` and
`RemoveView`.

## 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
2024-04-11 13:26:24 -07:00
Jonah Williams
1c2ffb9b30 [Engine] allow --enable-asserts flag to be passed to dart vm in profile mode. (flutter/engine#52029)
Allows https://github.com/flutter/flutter/issues/145729
2024-04-10 21:53:52 +00:00