- Introduce PlatformViewRenderTarget interface.
- Refactor VirtualDisplayController and PlatformViewWrapper to extract
SurfaceTexturePlatformViewRenderTarget into a separate class.
In a future CL I will add an ImageReaderPlatformViewRenderTarget which
will enable Platform Views on Impeller/Vulkan.
Tracking issue: https://github.com/flutter/flutter/issues/130892
## Description
This adds checks for the app delegate to make sure that it supports the Flutter-specific selectors before calling them, so that a non `FlutterAppDelegate` can be used for the `NSApplicationDelegate` on `NSApp`.
## Related Issues
- https://github.com/flutter/flutter/issues/124829
- https://github.com/flutter/flutter/issues/127476
## Tests
- Added a test to make sure things don't crash if the app delegate isn't a `FlutterAppDelegate`.
Fixes the following errors when building with a C++20 toolchain.
I don't really know C++ that well so any pointers would be appreciated.
For the change to the lambda, we can't follow the recommendation to capture `*this` explicitly because that wouldn't compile under C++17. This PR changes the semantics slightly to capture `surface_` by reference, which might be still okay?
For b/289776142
```
error: implicit capture of 'this' with a capture default of '=' is deprecated [-Werror,-Wdeprecated-this-capture]
93 | if (surface_) {
| ^
note: add an explicit capture of 'this' to capture '*this' by reference
91 | raster_thread_merger_->SetMergeUnmergeCallback([=]() {
| ^
| , this
```
```
error: bitwise operation between different enumeration types ('CGImageAlphaInfo' and '(unnamed enum at third_party/apple_sdks/xcode_14_2/iphonesimulator/System/Library/Frameworks/CoreGraphics.framework/Headers/CGImage.h:53:9)') is deprecated [-Werror,-Wdeprecated-anon-enum-enum-conversion]
159 | static_cast<CGBitmapInfo>(kCGImageAlphaPremultipliedLast |
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
160 | kCGBitmapByteOrder32Big), // CGBitmapInfo bitmapInfo
| ~~~~~~~~~~~~~~~~~~~~~~~
```
This change also:
- removes reliance from both tests on `fuchsia.ui.scenic.Scenic`
protocols
- migrates `touch-input-test` to get display info from
`fuchsia.ui.display.singleton.Info` instead of
`fuchsia.ui.gfx.DisplayInfo`
- adds support for `fuchsia.ui.display.singleton.Info` in
`portable_ui_test` to support the above
- migrates `flutter-embedder-test` to capture screenshots using
`fuchsia.ui.composition.Screenshot` instead of
`fuchsia.ui.scenic.Screenshot`
- updates screenshot tooling accordingly
- removes the embedding view hit test disabled case from `touch-input
test`, since disabling the hit region is not currently supported in
Flutter's integration with Flatland afaict ([this
logic](4f384979af/shell/platform/fuchsia/flutter/flatland_external_view_embedder.cc (L411-L434))
appears to set hit regions to the full view size by default, and
Flatland appears to drop the value
[here](4f384979af/shell/platform/fuchsia/flutter/flatland_external_view_embedder.cc (L578)))
- removes hit test configurability on `touch-input-test` and
`flutter-embedder-test` embedding views
Bug: fxbug.dev/125514
Fixes https://github.com/flutter/flutter/issues/130514
The context wasn't current so we couldn't get the GL version.
The extension lookup was throwing an invalid enum error, the desktop opengl docs say to use a different method.
Fixes https://github.com/flutter/flutter/issues/129862
This reverts commit cd52c0ce82b37bc9d16bea26fbd1753174c49e42.
These changes were exposing an underlying bug in the DisplayListMatrixClipTracker that has now been fixed independently (https://github.com/flutter/engine/pull/43664). There are no changes to the commit being relanded here, it has been tested on the Wondrous app which demonstrated the regression before the NOP culling feature was reverted and it now works fine due to the fix of the underlying cause.
The change in [0] has propagated now everywhere, so we can use
`utf8.encode()` instead of the longer `const Utf8Encoder.convert()`.
Also it cleans up code like
```
Uint8List bytes;
bytes.buffer.asByteData();
```
as that is not guaranteed to be correct, the correct version would be
```
Uint8List bytes;
bytes.buffer.asByteData(bytes.offsetInBytes, bytes.length);
```
a shorter hand for that is:
```
Uint8List bytes;
ByteData.sublistView(bytes);
```
[0] https://github.com/dart-lang/sdk/issues/52801
Actually works now, though there is some issue with the default fbo stencil so I've filled https://github.com/flutter/flutter/issues/130048
Other issues:
* ~~Rendering looks wrong~~
* ~~Resizing window hangs~~
* ~~Reactor isn't set up correctly and all blit passes are currently failing.~~
* ~~Needs to handle falling back to sample count of 1 like we do on Android~~.
These sources have long been obsolete for most of the engine, except for the Fuchsia sources. They do not need to be built for any other platform so this PR moves them into a Fuchsia platform-specific build directory so that they are only present in the Fuchsia binaries.
Most of the #include directives for SkPicture are removed except where they are still functional. Many comments rewritten to no longer be SkPicture-centric.
- DL unit tests still use it for consistency testing
- rasterizer/engine still use it for screen shot support
- Fuchsia still uses it extensively
Addresses most of https://github.com/flutter/flutter/issues/128060
Most of the uses of SkPicture and Recorder are removed from the engine sources. The few that remain are:
- DisplayList <-> Skia consistency testing code
- Legacy code only used from Fuchsia
- Dart CanvasKit uses which aren't actually using the local Skia sources or libraries
These are all comment and include file changes and so the testing is in the building.
As noticed in https://github.com/flutter/flutter/issues/126209
## 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 Hixie said 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.
Dart is being removed from the Fuchsia SDK, so remove references to it
here.
Also remove references to workstation_eng and replace with terminal.
workstation_eng is no longer a thing.
Eagerly remove the PlatformView from the view hierarchy on Android.
Fixes [#107297](https://github.com/flutter/flutter/issues/107297)
## 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 Hixie said 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.
Fixes https://github.com/flutter/flutter/issues/130036
Also fixes a potential issue where the shell wasn't getting destroyed at the end of the test.
Since no log is actually printed ont he second go, the destructor of `LogMessage` never clears the static pointer, and the next test that tries to print a log tries to print to that pointer which is now garbage.
Reverts flutter/engine#42584. (Thanks to @jonahwilliams for bisecting)
With this change, layers are getting clipped incorrectly when rendering
platform views in Wondrous.
We'd like to (or already are) using the concurrent message loop for high priority rendering tasks like PSO construction and render pass encoding. The default priority level for the engine managed concurrent message loop is 2, which is a significantly lower priority than the raster thread at -5. This is almost certainly causing priority inversion.
We must move back to dedicated runners so we can adjust thread priorities.
https://github.com/flutter/flutter/issues/126209
## 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 Hixie said 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.