The Vulkan command buffer wrapper delegates almost all of its functionality to the "CommandEncoderVK". I did not find that this separation was useful, as they have a 1-1 relationship and an identical lifecycle. Lets combine them to reduce the number of things to worry about.
Aiks color source is more or less a one to one copy of the impeller::DisplayListColorSource. We can rip it out, instead of flutter::DisplayList::ColorSource -> impeller::Aiks::ColorSource -> impelller:Entity::ColorSourceContents, just go directly flutter::DisplayList::ColorSource -> impelller:Entity::ColorSourceContents.
Part of https://github.com/flutter/flutter/issues/142054
Reverts: flutter/engine#55393
Initiated by: matanlurey
Reason for reverting: Postsubmit turned red (clang tidy and build).
Original PR Author: jonahwilliams
Reviewed By: {chinmaygarde}
This change reverts the following previous change:
Hoist the content context up to the ios_surface so that overlay layers don't recreate a bunch of expensive machinery.
Fixes https://github.com/flutter/flutter/issues/154836
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.
Keeps fml::scoped_* wrappers used in C++ class declarations in headers, since those are injected into both ARC and non-ARC translation units and these classes are ARC-safe. Once we've migrated all users of those headers to ARC, we can use the underlying classes directly.
No semantic changes, therefore not changes to tests.
Issue: https://github.com/flutter/flutter/issues/137801
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
Reverts: flutter/engine#55092
Initiated by: jonahwilliams
Reason for reverting: framework golden failures.
Original PR Author: jonahwilliams
Reviewed By: {chinmaygarde, jtmcdole}
This change reverts the following previous change:
Follow up to https://github.com/flutter/engine/pull/55060
Currently we have multiple stages of hashing while font rendering, which is relatively expensive for the actualy required workload. First, we hash the contents of all text frames to compute the unique set of glyphs per frame. Then we diff this hash set against the hashmap of glyphs within the atlas. Finally we hash and lookup the final rendered bounds for each glyph.
We can simplify this to 2. hash lookups for glyphs not yet in the atlas and 1. hash lookup for glyphs that are in the atlas. This is done by combing the step where we uniquely compute glyphs per frame with the diff against the current atlas. When this lookup is performed, we also store the glyph position (if found) in the text_frame itself - which allows text contents to skip the last hash, as long as the glyph has already been rendered.
### Before

### After

Using this handy dandy test app:
```dart
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
Widget build(context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('Platform View'),
),
body: SafeArea(child: Stack(children: [
SizedBox(
width: 380,
height: 380,
child: LinearProgressIndicator(),
),
Stack(
children: List<Widget>.generate(1000, (index) {
// The problem already happens with a small amount of widgets.
// Using an excessive amount of widgets is just to make the problem more evident.
return Text("Lots of Texts represent a Widget with complex components.");
}),
),
Align(
alignment: Alignment.bottomCenter,
child:
TextButton(
child: Text("Button"),
onPressed: () {
print("Tap ${DateTime.now()}");
},
),
),
],
),
),
),
);
}
}
```
Follow up to https://github.com/flutter/engine/pull/55060
Currently we have multiple stages of hashing while font rendering, which is relatively expensive for the actualy required workload. First, we hash the contents of all text frames to compute the unique set of glyphs per frame. Then we diff this hash set against the hashmap of glyphs within the atlas. Finally we hash and lookup the final rendered bounds for each glyph.
We can simplify this to 2. hash lookups for glyphs not yet in the atlas and 1. hash lookup for glyphs that are in the atlas. This is done by combing the step where we uniquely compute glyphs per frame with the diff against the current atlas. When this lookup is performed, we also store the glyph position (if found) in the text_frame itself - which allows text contents to skip the last hash, as long as the glyph has already been rendered.
### Before

### After

Using this handy dandy test app:
```dart
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
Widget build(context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('Platform View'),
),
body: SafeArea(child: Stack(children: [
SizedBox(
width: 380,
height: 380,
child: LinearProgressIndicator(),
),
Stack(
children: List<Widget>.generate(1000, (index) {
// The problem already happens with a small amount of widgets.
// Using an excessive amount of widgets is just to make the problem more evident.
return Text("Lots of Texts represent a Widget with complex components.");
}),
),
Align(
alignment: Alignment.bottomCenter,
child:
TextButton(
child: Text("Button"),
onPressed: () {
print("Tap ${DateTime.now()}");
},
),
),
],
),
),
),
);
}
}
```
Reverts: flutter/engine#55450
Initiated by: matanlurey
Reason for reverting: Fixed forward in https://github.com/flutter/packages/pull/7712.
Original PR Author: auto-submit[bot]
Reviewed By: {fluttergithubbot}
This change reverts the following previous change:
Reverts: flutter/engine#55418
Initiated by: bdero
Reason for reverting: [Engine->Framework roll breakage](https://github.com/flutter/flutter/issues/155727#issuecomment-2375489803)
Original PR Author: matanlurey
Reviewed By: {jonahwilliams}
This change reverts the following previous change:
Closes https://github.com/flutter/flutter/issues/155131.
Not only did I rename the method, but I also changed the contract slightly - now `onSurfaceAvailable` is _only_ invoked _after_ `onSurfaceDestroyed` has been called. The cost is a single `boolean`, and it honestly makes the API make a lot more sense than someone having to track this themselves.
/cc @johnmccutchan (OOO), and @flutter/android-reviewers.
Fixes https://github.com/flutter/flutter/issues/125640
This doesn't actually do anything, instead it forces opaque to false. If developers want opaque to be false, they can just set it directly.
Reverts: flutter/engine#55418
Initiated by: bdero
Reason for reverting: [Engine->Framework roll breakage](https://github.com/flutter/flutter/issues/155727#issuecomment-2375489803)
Original PR Author: matanlurey
Reviewed By: {jonahwilliams}
This change reverts the following previous change:
Closes https://github.com/flutter/flutter/issues/155131.
Not only did I rename the method, but I also changed the contract slightly - now `onSurfaceAvailable` is _only_ invoked _after_ `onSurfaceDestroyed` has been called. The cost is a single `boolean`, and it honestly makes the API make a lot more sense than someone having to track this themselves.
/cc @johnmccutchan (OOO), and @flutter/android-reviewers.
When running with merged platform and ui threads, set the dart thread name of the main thread to io.futter.ui. Also change the thread mask settings to avoid creating an unused UI thread.
Closes https://github.com/flutter/flutter/issues/155131.
Not only did I rename the method, but I also changed the contract slightly - now `onSurfaceAvailable` is _only_ invoked _after_ `onSurfaceDestroyed` has been called. The cost is a single `boolean`, and it honestly makes the API make a lot more sense than someone having to track this themselves.
/cc @johnmccutchan (OOO), and @flutter/android-reviewers.
Fixes https://github.com/flutter/flutter/issues/141482
Since the introduction of the flutter compositor, the windows embedder will create an offscreen framebuffer and then blit this to the onscreen framebuffer. Therefore, the onscreen framebuffer should not be constructed as a multisample framebuffer - and the EGL config can match skia.
Also cleans up selection of the impeller PixelFormat, which might not have matched the selected compositor format because it was hardcoded to RGBA_8888
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.
Fixes https://github.com/flutter/flutter/issues/135898
Note that the macOS embedder is still using the apple texture cache object from the SkiaMetalContext. it can't initialize an equivalent ImpellerMetalContext without creating a second copy of the content context and all that jazz, so I'm leaving that as is for now.
This is a precondition to use more high-level templates in fuchsia-gn-sdk to replace build rules in flutter.
Meanwhile fuchsia-gn-sdk does not use pm anymore and this change is also helpful to get rid of the use of pm.
Briefly, it removes all cmx_file parameters and avoids specifying duplicated parameters (binary / target_name / default cml file).
Bug: http://b/353729557, http://b/40935282
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
Previously, gesture origin position relied on hover events. But iOS 18 screen mirroring feature sends only pan/scale gestures, but doesn't hover. So we need to check the gesture location every time.
Fixes https://github.com/flutter/flutter/issues/153897
- **Add light and dark test back to FlutterView.java**
- **Migrate some but not all usages of Robolectric.setupActivity in FlutterViewTest.java**
- **Remove suppress warnings on tests that no longer need it, update documentation for ones that still need the suppression**
Fixes https://github.com/flutter/flutter/issues/154746
Partial work on https://github.com/flutter/flutter/issues/133151
Today, only a generic "internal inconsistency" error returned. But custom builds that selectively disable rendering backends may find this error to be too vague.
- **add test back with no other changes**
- **Add legacy test and setup shadow**
2 and 3 of 5 flutter/flutter/issues/154746
Improved legacy testing by validating a fullscreen and non fullscreen codepaths.
Added `.git-blame-ignore-revs` because git was failing to give blame values with that file missing. I dont think I added a global config anywhere but adding an empty file should not cause a problem.
The existing code had a lot of additional checks that didn't seem to
need to be there.
BGR could be passed back to Flutter, but this was never used in creating
the texture.
There has been a report of a Flutter app on Linux with swapped red and
blue color channels, so this seems like it is likely not working on some
drivers.
The original logic was introduced in
87509d8518cea0e90912cc30b08192b1dd4da760
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.