6185 Commits

Author SHA1 Message Date
Matan Lurey
8e3b58f166 ReleaseonTrimMemoryListener after ImageReaderSurfaceProducer released. (flutter/engine#55760)
Fixes https://github.com/flutter/flutter/issues/156434.

A better fix for the workaround in https://github.com/flutter/flutter/issues/156158.

This should likely be cherrypicked, as it's a memory leak, safe, and avoids workaround code in plugins.
2024-10-09 01:35:17 +00:00
Jonah Williams
086e6a63f5 [Impeller] remove Vulkan command encoder abstraction, use command buffer vk. (flutter/engine#55680)
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.
2024-10-07 19:52:55 +00:00
Chris Bracken
773c37ab82 Revert "iOS: Migrate FlutterEngine to ARC (#55590)" (flutter/engine#55699)
Causing flakes on the _Mac mac_unopt (Cocoon)_ shard.

This reverts commit a2ac734e10115547d8c8ef34610ea6172e3cc98b.

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

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-10-07 16:29:24 +00:00
Jonah Williams
9d8929af60 [Impeller] generate mipmaps for toImage. (flutter/engine#55655)
Fixes https://github.com/flutter/flutter/issues/156161

Mips must be eagerly generated for Picture.toImage and friends so that filter quality (mip sampling) works as expected.
2024-10-04 17:49:55 +00:00
Chris Bracken
a2ac734e10 iOS: Migrate FlutterEngine to ARC (flutter/engine#55590)
Migrates `FlutterEnging` from manual reference counting to ARC. Migrates properties from `retain` to strong and `assign` to `weak` (where referencing an Obj-C object).

No semantic changes, therefore no 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
2024-10-04 15:00:30 +00:00
Jonah Williams
1cdd8d06be [Impeller] remove aiks color_source. (flutter/engine#55603)
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
2024-10-04 02:20:33 +00:00
Robert Ancell
971dbd79fb Refactor FlKeyboardHandler (flutter/engine#55601)
Refactor FlKeyboardHandler to be more GObject and less C++.

Done as we will need to move the handler from FlView to FlEngine to
support multi-view.
2024-10-04 12:00:00 +13:00
Jonah Williams
0854e45692 [Impeller] ensure one AiksContext per app. (flutter/engine#55629)
Reland of https://github.com/flutter/engine/pull/55393
2024-10-03 20:54:04 +00:00
Chris Bracken
36078b8126 iOS: Fix IOSSurfaceNoopTest (flutter/engine#55621)
Previously, we were passing `nullptr` to the `IOSSurfaceNoop` constructor:
56d060d501/shell/platform/darwin/ios/ios_surface_noop.mm (L23-L24)

which calls the IOSSurface constructor:
56d060d501/shell/platform/darwin/ios/ios_surface.mm (L55-L58)

Which calls `FML_DCHECK(ios_context_)`, which really doesn't like it when `ios_context_` is null.

I will later follow up with the next question of... "what exactly is going on with our CI here?", but this unbreaks my local dev testing workflow for the moment :)

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-10-03 19:22:09 +00:00
auto-submit[bot]
5215356e5a Reverts "[Impeller] one aiks context per app. (#55393)" (flutter/engine#55625)
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
2024-10-03 18:46:46 +00:00
Jonah Williams
7bb85d3d81 [Impeller] one aiks context per app. (flutter/engine#55393)
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
2024-10-03 18:13:08 +00:00
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
Chris Bracken
86626a85fb iOS: Migrate accessibility_bridge to ARC (flutter/engine#55570)
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
2024-10-02 15:51:54 +00:00
Chris Bracken
67060c415c iOS: Migrate FlutterPlatformPlugin to ARC (flutter/engine#55571)
Migrates from manual reference counting to automatic reference counting. Migrates ivars to property syntax. Makes a minor update to a doc comment.

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
2024-10-01 23:23:57 +00:00
Robert Ancell
788cdbe3be Deregister views when they are destroyed (flutter/engine#55542) 2024-10-02 10:00:33 +13:00
Robert Ancell
166590d6c2 Allocate a view ID for secondary views (flutter/engine#55541)
Allocate view IDs for secondary Flutter views - another step towards
full multi-view support.
2024-10-02 09:04:31 +13:00
Chris Bracken
219d952197 iOS: Migrate FlutterEngineGroup to ARC (flutter/engine#55503)
This migrates FlutterEngineGroup to automatic reference counting. It also migrates `enginesCreatedCount` from an ivar to property syntax.

I'll look at migrating engine from `NSMutableArray<NSValue*>` to a weak pointer array in a followup patch since it's orthogonal to ARC migration.

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

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-09-30 17:56:52 +00:00
Chris Bracken
6a4e814a68 iOS: Migrate FlutterHeadlessDartRunner to ARC (flutter/engine#55502)
This is a subclass of FlutterEngine, which is still manually reference counted, but that's not problematic since the headers have been migrated to ARC-safe syntax that preserves existing behaviour.

No test changes since this patch makes no semantic changes.

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

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-09-30 16:47:07 +00:00
Chris Bracken
faa6496380 iOS: Migrate FlutterAppDelegate to ARC (flutter/engine#55472)
Migrates the FlutterAppDelegate.mm translation unit to be compiled with the `-fobjc-arc` compiler flag.

No test changes since no this change includes no semantic changes, and thus covered by existing tests such as [`testReleasesWindowOnDealloc`](f6e580d09a/shell/platform/darwin/ios/framework/Source/FlutterAppDelegateTest.mm (L139-L153)).

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

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-09-27 22:44:53 +00:00
auto-submit[bot]
fdbad460a5 Reverts "[Impeller] hash even less stuff per frame. (#55092)" (flutter/engine#55491)
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

![flutter_03](https://github.com/user-attachments/assets/be9c4459-f0c8-426c-b152-38861acb207f)

### After

![flutter_04](https://github.com/user-attachments/assets/1aa7cbd1-6af7-4020-8966-7e3baaef102b)

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()}");
              },
            ),
          ),
        ],
        ),
        ),
      ),
    );
  }
}
```
2024-09-27 17:09:28 +00:00
Jonah Williams
e9a089f2fe [Impeller] hash even less stuff per frame. (flutter/engine#55092)
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

![flutter_03](https://github.com/user-attachments/assets/be9c4459-f0c8-426c-b152-38861acb207f)

### After

![flutter_04](https://github.com/user-attachments/assets/1aa7cbd1-6af7-4020-8966-7e3baaef102b)

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()}");
              },
            ),
          ),
        ],
        ),
        ),
      ),
    );
  }
}
```
2024-09-27 15:34:07 +00:00
Valentin Hăloiu
18b9cd0233 Add format field to EGL surface backing store (flutter/engine#54499)
Trying to use the `GL_BGRA8_EXT` format for the EGL surface backing store on *desktop* OpenGL platforms would fail at: 82d8bc5844/shell/platform/embedder/embedder.cc (L869)

This seems to be a known issue and both the Linux and Windows embedders have some logic to pick a different format depending on the OpenGL context information:

bc8c82d157/shell/platform/windows/compositor_opengl.cc (L23-L34)

bc8c82d157/shell/platform/linux/fl_framebuffer.cc (L81-L104)

This pull-request gets rid of the hard-coded `GL_BGRA8_EXT` format and makes it configurable by adding a `format` field to the `FlutterOpenGLSurface` struct.

_Disclaimer_: This has only been tested on desktop Linux (Wayland) using the `GR_GL_RGBA8` format which seemed to work as expected.

This change is related to the recently introduced EGL surface backing store: https://github.com/flutter/flutter/issues/58363

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-09-27 00:23:13 +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
auto-submit[bot]
248b86a64b Reverts "Reverts "Add SurfaceProducer#onSurfaceAvailable, deprecate onSurfaceCreated. (#55418)" (#55450)" (flutter/engine#55463)
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.
2024-09-26 17:34:17 +00:00
Jonah Williams
33f2dcb7eb [iOS] remove clear color hack. (flutter/engine#54451)
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.
2024-09-26 04:54:11 +00:00
auto-submit[bot]
80ce9f8631 Reverts "Add SurfaceProducer#onSurfaceAvailable, deprecate onSurfaceCreated. (#55418)" (flutter/engine#55450)
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.
2024-09-26 00:45:46 +00:00
Matan Lurey
e89480f02d Move lint suppression from baseline.xml to @SuppressLint. (flutter/engine#55447)
I think you just had the lint identifier wrong?

Closes https://github.com/flutter/flutter/issues/155712.
2024-09-25 22:41:11 +00:00
Jonah Williams
152dfb2fcf [engine] set platform thread name to ui. (flutter/engine#55362)
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.
2024-09-25 22:06:37 +00:00
jesswrd
21ddf3e6e3 Remove usages of WindowManager's getDefaultDisplay (flutter/engine#55002)
Removed deprecated usages of WindowManager's `getDefaultDisplay()` and
replaced them with DisplayManager's `getDisplay()`.

Note: Decided to keep a usage of `getDefaultDisplay()`, which can be
found in FlutterView.java because it is expected to be deleted as a part
of V1 embedding removal. No changes were made to that file.

path to FlutterView.java:
shell/platform/android/io/flutter/embedding/android/FlutterView.java

Fixes [#99421](https://github.com/flutter/flutter/issues/99421)

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide] and the [C++,
Objective-C, Java style guides].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I added new tests to check the change I am making or feature I am
adding, or the PR is [test-exempt]. See [testing the engine] for
instructions on writing and running engine tests.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I signed the [CLA].
- [x] All existing and new tests are passing.

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

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
2024-09-25 17:04:00 -04:00
Matan Lurey
f425edfbf7 Add a boolean that exposes rotation/crop metadata capability. (flutter/engine#55434)
Closes https://github.com/flutter/flutter/issues/144407.
Closes https://github.com/flutter/flutter/issues/155633.
2024-09-25 19:27:08 +00:00
Matan Lurey
2291e92e59 Add SurfaceProducer#onSurfaceAvailable, deprecate onSurfaceCreated. (flutter/engine#55418)
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.
2024-09-25 16:24:06 +00:00
Camille Simon
9be07d79a8 Update setSystemChromeEnabledSystemUIMode docs to note targeting Android 15+ change (flutter/engine#54560)
Updates `setSystemChromeEnabledSystemUIMode` documentation to reflect that edge-to-edge mode is used by default if the Flutter app targets Android 15.

Part of https://github.com/flutter/flutter/issues/150367 and engine counterpart to https://github.com/flutter/flutter/pull/153466.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-09-25 11:30:21 +00:00
Jonah Williams
79e371517d [Impeller] fix Impeller on windows. (flutter/engine#55323)
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
2024-09-24 23:38:52 +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
John McDole
14caa2fe19 Disallow time traveling frame times (flutter/engine#55310)
Address bad developer experience in
https://github.com/flutter/flutter/issues/106277

Leave as an error log and hope for more repro reports


```mermaid
sequenceDiagram
  Animator ->> Animator: AwaitVSync
  Animator ->> VsyncWaiter: AsyncWaitForVsync(callback)
  VsyncWaiter -> VsyncWaiterAndroid: AwaitVSync
  note over VsyncWaiterAndroid: GetUITaskRunner
  VsyncWaiterAndroid -> Choreographer: PostFrameCallback
  Choreographer -> NDK: AChoreographer_postFrameCallback64
  note over Choreographer,NDK: The time that the frame is being<br/>rendered as nanoseconds in the <br/>CLOCK_MONOTONIC time base
  NDK --> Choreographer: callback(nanos)
  Choreographer -> VsyncWaiterAndroid: callback
  note over VsyncWaiterAndroid: // Rollback suspicion<br/>if (frame_time > now) frame_time = now;
  VsyncWaiterAndroid -> VsyncWaiterAndroid: OnVsyncFromNDK(frame_nanos)
  VsyncWaiterAndroid -> VsyncWaiter: FireCallback(\n  frame_start_time,\n  target_time)
  VsyncWaiter -> Animator: callback(frame_timings_recorder)

  Animator -> Animator: BeginFrame(frame_timings_recorder)
  Animator -> Shell: OnAnimatorBeginFrame
  Shell -> Engine: BeginFrame(frame_time, frame_number)
  Engine -> RuntimeController: BeginFrame(frame_time, frame_number)
  RuntimeController -> PlatformConfiguration: BeginFrame(frame_time, frame_number)
  PlatformConfiguration -> hooks.dart: begin_frame_
```
2024-09-24 15:33:45 -07:00
Mahmut Taşkıran
92cc1aac8a Add a check for the surface if it is valid (flutter/engine#55277)
Fixes an issue where the Surface is not valid and the `draw` method is crashing.

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

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-09-24 18:43:06 +00:00
Jonah Williams
428565f27a [Impeller] finish wiring up external textures for macOS embedder. (flutter/engine#55347)
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.
2024-09-24 18:26:51 +00:00
zijiehe@
cbaf3f8fbc [Fuchsia] Remove deprecated and unnecessary parameters from fuchsia*archive (flutter/engine#55324)
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
2024-09-24 15:44:56 +00:00
Robert Ancell
53b8ece3c8 Use GTask integer return APIs and fix documentation on return value on error. (flutter/engine#55353) 2024-09-24 13:25:15 +12:00
Jonah Williams
7e62bd4a14 [iOS] sprinkle some null checks on BringLayersIntoView. (flutter/engine#55334)
A user reported hitting a null check error in this code. Add some null checks.
2024-09-23 18:19:12 +00:00
Callum Moffat
f20fea338e [ios] Update gesture position on every event (flutter/engine#55285)
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
2024-09-18 23:47:18 +00:00
Reid Baker
0f03db48fe FlutterViewTest add back part 4 and 5 (flutter/engine#55243)
- **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
2024-09-17 15:58:59 +00:00
Robert Ancell
3443af6a5c Delay the window until the first frame is received from the Flutter engine (flutter/engine#54703)
Fixes https://github.com/flutter/flutter/issues/151098
2024-09-17 10:48:43 +12:00
Chinmay Garde
f64f4e4188 [Embedder] Warn when embedders try to enable an unsupported renderer. (flutter/engine#55240)
Today, only a generic "internal inconsistency" error returned. But custom builds that selectively disable rendering backends may find this error to be too vague.
2024-09-16 22:29:24 +00:00
Reid Baker
1030f3b153 flutter view add test 2 (flutter/engine#55188)
- **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.
2024-09-16 20:40:19 +00:00
Robert Ancell
e3f49a5875 Match Windows logic for picking RGB/BGR textures. (flutter/engine#55121)
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
2024-09-16 12:17:57 +12:00
Brandon DeRosier
07fce2f8f4 [Impeller] desktop: Add missing dispatch for TextFrameDispatcher in embedder view. (flutter/engine#55197) 2024-09-13 22:34:55 -07:00
Jenn Magder
8706638baf Add xcprivacy privacy manifest to macOS framework (flutter/engine#55078)
Create a `PrivacyInfo.xcprivacy` (this name is required) plist and move it to the top-level of the macOS framework bundle.  `NSPrivacyTracking*` and `NSPrivacyCollectedDataTypes` keys are required, but the values are blank.  macOS explicitly does not need the `NSPrivacyAccessedAPITypes` (see more info in https://github.com/flutter/flutter/issues/143381)

You can see on this PR it's copied to the correct path in the framework https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8737163270670636097/+/u/Global_generators/Release-FlutterMacOS.framework/stdout:

```
  adding: FlutterMacOS.xcframework/macos-arm64_x86_64/FlutterMacOS.framework/PrivacyInfo.xcprivacy (deflated 35%)
```

There's no way to test this except to submit a macOS app with this framework to TestFlight.

I can't find a good spot in the engine to validate the structure of the framework output.  I hereby pledge to add a macOS test to the framework post-roll https://github.com/flutter/flutter/pull/155189 ✋ 

iOS framework variant of this PR https://github.com/flutter/engine/pull/48951
Fixes https://github.com/flutter/flutter/issues/131494

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-09-14 02:44:18 +00:00
Gray Mackall
fde6227383 Synthesize remove events on PointerChange.ACTION_UP and PointerChange.ACTION_POINTER_UP (flutter/engine#55157)
... when the input device type is touch.

Fixes (partially) https://github.com/flutter/flutter/issues/154842 for touch events. Does not fix when using a stylus, that case will require a follow up PR.

Without fix:

https://github.com/user-attachments/assets/10a8ac73-7b27-498b-a76e-0f2cfc3050d7

With fix:

https://github.com/user-attachments/assets/18656f3a-d45a-4b08-9227-cc0abe8c73f7

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-09-14 01:02:23 +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