6099 Commits

Author SHA1 Message Date
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
Chris Bracken
b105e9b1cd [macOS] Add TODOs to remove AppKit bug workaround (flutter/engine#54764)
In https://github.com/flutter/engine/pull/40241, I added a workaround for an AppKit bug wherein mouseDown/Up events were ignored when the *Reduced Transparency* accessibility setting was enabled, and the view was hosted in an `NSPopover`.

I filed a Radar and Apple reported the bug fixed in macOS 13.3.1.

When we drop support for macOS 12 in Flutter, we should remove the workaround.

So long as nothing else has been added to these methods at that time, the method overrides themselves should be removed, so that we fall back to the default behaviour.

See: http://www.openradar.me/FB12050037
See: https://developer.apple.com/documentation/appkit/nsresponder/1535349-mouseup

Issue: https://github.com/flutter/flutter/issues/154063
Issue: https://github.com/flutter/flutter/issues/115015

No tests modified since this only adds a comment.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-08-25 15:00:36 +00:00
Jonah Williams
1ba45ac86e [Engine] Add no op surface (flutter/engine#54694)
Still needs to be tested in metalless environment. This should probably print out some kind of error message that tells folks that this is WAI, but I'm not sure if that would be too disruptive for g3.

Fixes https://github.com/flutter/flutter/issues/153883
2024-08-23 17:06:16 +00:00
Jonah Williams
c8fc2ff531 [engine] make Platform thread the UI thread for iOS Impeller. (flutter/engine#54655)
Does it blend?
2024-08-23 17:06:14 +00:00
Jenn Magder
7e82588c31 Test running the macOS engine has no stray logging (flutter/engine#54716)
Assert that running the macOS engine does not log anything unexpected 
See also issue https://github.com/flutter/flutter/issues/111577
Similar Windows check in https://github.com/flutter/engine/pull/47774

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-08-22 22:40:10 +00:00
Matan Lurey
d68876bb1d More diagnostic clean ups (flutter/engine#54265)
Towards https://github.com/flutter/flutter/issues/152636.

Almost all changes are `dart --fix`.
2024-08-22 21:04:17 +00:00
Joel Winarske
1961f2c5cc Export GPU symbols for embedder (flutter/engine#54662)
This PR exports GPU symbols for the embedder library.

*List which issues are fixed by this PR. You must list at least one issue.*
https://github.com/flutter/flutter/issues/153196

*If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-08-22 04:37:31 +00:00
Chinmay Garde
74861200d4 [iOS] Tweak note about OpenGL support on mac in a user facing log. (flutter/engine#54690)
We don't have an OpenGL backend on iOS.
2024-08-21 20:46:04 +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
Matan Lurey
7279070455 Remove spammy warning message on FlutterView (flutter/engine#54686)
@matanlurey:

> As of 2f6952657d, we are now printing a `W/FlutterView( 7775): API level 34 is too low to query bounding rects.` message which is not user actionable. Was this intended to stay in the merged PR? What value is it supposed to have?

@yaakovschectman:

> You might be right about that
2024-08-21 19:57:52 +00:00
Jonah Williams
248dfb2334 [engine] reland weaken affinity of raster/ui to non-e core instead of only fast core (flutter/engine#54616)
Some android devices have only a single fast core. We set the threading affinity for UI/Raster to the fast core, which can lead to the UI/Raster being serialized on this thread. Instead, we should weaken /invert the affinity to "Not slow cores".

FIxes https://github.com/flutter/flutter/issues/153690

Customer money will see some benchmark regressions but they can deal.
2024-08-21 16:31:55 +00:00
yaakovschectman
2f6952657d Use getBoundingRects to add support inset MediaQuery/SafeArea when in freeform mode controls are shown. (flutter/engine#54294)
Original Title: Add FlutterViewDelegate and BoundingRect methods

Check the bounding rect for caption bar when sending viewport metrics to
Flutter to account for freeform mode. Use the more recent
`getBoundingRects` over `getInsets`.

Tests will need to be kept separate until Robolectric publishes a
version that supports API level 35.
Roboletric tests for this pr will be part of google testing until then. 
Pr for tests here https://critique.corp.google.com/cl/657302386. 

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

## 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 `///`).
- [ ] I signed the [CLA].
- [x] All existing and new tests are passing.
2024-08-20 13:09:00 -04:00
Robert Ancell
2bbc3b4b41 Allow the default background color to be changed (flutter/engine#54575)
Fixes https://github.com/flutter/flutter/issues/149920
2024-08-20 08:00:06 +12: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
Matej Knopp
7a1fd055b8 Preserve background frame damage (flutter/engine#54540)
Fixes https://github.com/flutter/flutter/issues/153335

When platform views are present, we always repaint entire frame. We must pass the buffer damage all the way to `GPUSurfaceMetalSkia/GPUSurfaceMetalImpeller` so that they know that the other two surfaces are lagging behind front surface and need to be repainted.

This is currently not being done with platform view present, that's why we miss full frame repaint when removing platform view.

With this merged in, it should be safe to reland https://github.com/flutter/engine/pull/54537 without any changes.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-08-13 20:55:36 +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
Jonah Williams
1fd6a547fb [iOS] keep threads merged when using Skia renderer on iOS (flutter/engine#54514)
Potential fix for money crasher.
2024-08-12 21:27:54 +00:00
Matej Knopp
70d8d63f6e macOS: Fix crash in attributedSubstringForProposedRange with out of bounds range (flutter/engine#54469)
Fixes https://github.com/flutter/flutter/issues/153157

*If you had to change anything in the [flutter/tests] repo, include a
link to the migration guide as per the [breaking change policy].*

## 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-12 20:00:46 +02:00
Loïc Sharma
5b06d21661 [Windows] Improve texture format logic (flutter/engine#54329)
This improves Flutter Window's texture format logic:

1. **If the device has extension `GL_EXT_texture_format_BGRA8888`**: backing stores' texture will be created with format `GL_BGRA_EXT` instead of `GL_RGBA8`. This is what fixes https://github.com/flutter/flutter/issues/150546.
2. **Otherwise**: backing stores' texture will be created with format `GL_RGBA` and the engine will use the color type `kRGBA_8888_SkColorType` when creating the `SkSurface`.

   Previously the engine always used color type `kN32_SkColorType`, which could be either RGBA or BGRA depending on the machine that compiled the engine. This caused Skia validation errors as the texture's format did not match the Skia surface's color type.

   I tested this by editing Flutter Windows to force it down this code path.

Huge kudos to @chinmaygarde for the OpenGL expertise!

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

> [!WARNING]
> Unfortunately, we are unable to test this.
> This bug appears to only affect older devices; none of our devices reproduce this issue.
> We also do not have the infrastructure to do a native screenshot test on Windows. 
> I will get a test exemption for this change.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-08-12 17:51:48 +00: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
c2992b3273 Remove shared mutex from FML and use the C++17 variants. (flutter/engine#54482)
We used to require this only on iOS because the standard library till iOS 9 didn't have support for this. We have moved past that version. No change on other platforms.
2024-08-09 22:59:58 +00: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
Robert Ancell
5c4ffe8f9c Add a precision to the fragment shader (flutter/engine#54109)
This is required for OpenGL ES.

See https://registry.khronos.org/OpenGL/specs/es/3.2/GLSL_ES_Specification_3.20.html#precision-and-precision-qualifiers

https://github.com/flutter/flutter/issues/152297
2024-08-08 20:07:41 +00:00
Jonah Williams
62a1ddeaee [Impeller] perform final blit and gpu end frame tracing earlier. (flutter/engine#54452)
Fixes the reported GPU time regression when rendering platform views. The problem was that we delayed the tracing of the end of the frame until the CATransaction, which artificially stretches out GPU frame time. Instead add a new method SurfaceMTL::PreparePResent which performs the final blit and tracing, call this in the encode callback.

Fixes: https://flutter-flutter-perf.skia.org/e/?queries=sub_result%3Daverage_gpu_frame_time%26test%3Dplatform_views_scroll_perf_ios__timeline_summary&selected=commit%3D41853%26name%3D%252Carch%253Dintel%252Cbranch%253Dmaster%252Cconfig%253Ddefault%252Cdevice_type%253DiPhone_11%252Cdevice_version%253Dnone%252Chost_type%253Dmac%252Csub_result%253Daverage_gpu_frame_time%252Ctest%253Dplatform_views_scroll_perf_ios__timeline_summary%252C

Test: benchmarks.
2024-08-08 19:46:04 +00:00
Hannes Winkler
76e6e34bb5 Add EGL Surface backing store (flutter/engine#43683)
Allows using an EGL surface as a flutter backing store. Way more convenient for GBM than hacking gbm bo's into GL FBOs.

This resolves https://github.com/flutter/flutter/issues/58363

Currently, the embedder API assumes that the compositor (if it exists) will let flutter render into FBOs or Textures and then composite the whole thing onto the actual (EGL) window surface. I think this assumption is also documented a bit in https://github.com/flutter/flutter/issues/38466

However, in my case, I want let the hardware do the composition (using the linux KMS API), and render each flutter layer into it's own EGL surface.

It's possible to hack around this by creating your own GBM BOs, importing those as EGL images, then importing those as GL Render Buffers and attaching those to GL FBOs and that works (tested it). However, that's basically reimplementing 50% of the whole GBM/EGL "window" system integration for no reason.

This PR adds:
1. To the embedder API:
   - a new kind of OpenGL Backing store: `FlutterOpenGLSurface`
     - consisting of just a `make_current` and destruction callback (plus userdata)
     - the make_current callback should make the target surface current, i.e. `eglMakeCurrent(..., surf, surf)`
     - will be called by the engine before rendering onto the backing store
2. Some wiring to call make_current before rendering into the backing store

## TODO:

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-08-08 19:11:22 +00:00
Jason Simmons
51cfba3f31 Fix include of GrVkImageInfo header for the Fuchsia build (flutter/engine#54449)
See https://skia.googlesource.com/skia/+/5fb01f00262bbbef99571953fb5a987b0bed4d45
2024-08-08 18:37:18 +00:00
Matej Knopp
4d9360ac5b Fix FlutterMetalLayer testDealloc flakiness on iOS 18 (flutter/engine#54403)
Fixes https://github.com/flutter/flutter/issues/152990

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-08-08 16:39:17 +00:00
Jonah Williams
95edf0d8db [android] workaround for HC bug. (flutter/engine#54408)
Testing

FYI @jason-simmons 

"Fixes" https://github.com/flutter/flutter/issues/152691
2024-08-08 00:06:58 +00:00
Jason Simmons
f0f2dd5a14 Directly include the Skia header that defines GrVkImageInfo (flutter/engine#54417)
See https://skia.googlesource.com/skia/+/5fb01f00262bbbef99571953fb5a987b0bed4d45
2024-08-08 00:05:38 +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
Jonah Williams
54bfbb4509 [iOS] clean ups to platform view controller (flutter/engine#54335)
Splits FlutterPlatformViews.mm into the primarily C++ class FlutterPlatformViewsController/Pool/Overlay and all of the touch interceptor / gesture stuff.

Renames FlutterPlatformViewsController to PlatformViewsController, because, you know.
Renames FlutterPlatformViewLayer and FlutterPlatformViewLayerPool to OverlayLayer and OverlayLayerPool
2024-08-06 21:33:55 +00:00
Matej Knopp
e3794a82e0 macOS: Update platform node when AXNodeData role changes (flutter/engine#54364)
Fixes https://github.com/flutter/flutter/issues/151428

*If you had to change anything in the [flutter/tests] repo, include a
link to the migration guide as per the [breaking change policy].*

## 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-06 21:51:36 +02:00
Jonah Williams
82c43d466a [iOS] Supported rendering platform views without merging the raster thread. (flutter/engine#53826)
Remove the need to merge raster and platform thread in the presence of platform views by defering UIView mutation and presentation of flutter views into separate platform thread task. Fixes priority inversion problem cause by platform thread blocking on drawable aquisition.

Open questions:

* Fixed ~What is a better interface for handling the partial submit with impeller. (TBD)~
* Fixed ~Update: We Don't | How do we fix this for Skia~ Fixed
* Fixed ~Update: Done, we post a task to the platform thread. Is there a shorter term solution for creating overlay layers on the raster thread.~ Fixed
* Fixed ~Update: seems to. Does this perform well enough (independent of platform/ui thread merge and w/ thread merge).~ Fixed

Fixes https://github.com/flutter/flutter/issues/142841
part of https://github.com/flutter/flutter/issues/150525
2024-08-01 20:40:12 +00:00
hangyu
5f18f2ebfd Set deep linking flag to true by default (flutter/engine#52350)
doc: flutter.dev/go/deep-link-flag-migration

Action item: make sure customers are aware of this change before merging
this PR.

## 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-08-01 12:58:12 -07:00
Bruno Leroux
555c2ff92a [Android] Revert "Reset IME state on clear text input client" (flutter/engine#54277)
## Description

This PR reverts two commits https://github.com/flutter/engine/pull/49829 and https://github.com/flutter/engine/pull/53662.

The main change was in https://github.com/flutter/engine/pull/49829. https://github.com/flutter/engine/pull/53662 was a follow-up to mitigate the impact of https://github.com/flutter/engine/pull/49829.

## Related Issue

Fixes https://github.com/flutter/flutter/issues/148530
Fixes https://github.com/flutter/flutter/issues/152620

Reopens https://github.com/flutter/flutter/issues/70546.
Reopens https://github.com/flutter/flutter/issues/51478
2024-08-01 19:50:07 +00:00
K. P. Krasiński-Sroka
85c39faa9b Properly calculate alwaysUse24HourFormat on MacOS (flutter/engine#53795)
Moves the implementation if isAlwaysUse24HourFormat from iOS's FlutterViewController internals to common utility, and makes use of it on MacOS in order to return correct value of `alwaysUse24HourFormat`.

This PR partially resolves [#32006](https://github.com/flutter/flutter/issues/32006).

Note that on iOS 16+ and MacOS 13+, there is a new API for obtaining this information: https://developer.apple.com/documentation/foundation/locale/components/3952289-hourcycle. However, to keep things simpler, I wanted to not include changes to the logic.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-08-01 18:51:06 +00:00
Matan Lurey
3a829b81ad Remove pre-existing diagnostics with no behavioral changes. (flutter/engine#54264)
Towards https://github.com/flutter/flutter/issues/152636.

Most of these were via `dart --fix`.
2024-07-31 22:48:00 +00:00
Matan Lurey
bed7aa4dea Cleanup dart analyze diagnostics in ignored directories. (flutter/engine#54262)
Towards https://github.com/flutter/flutter/issues/152636.

I also deleted some code that was TODO'd 10 years ago.
2024-07-31 22:47:58 +00: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
Matan Lurey
66d00dddf8 Migrate the remaining real pub packages to pub workspaces. (flutter/engine#54232)
Closes https://github.com/flutter/flutter/issues/147883.
2024-07-31 09:51:27 -07:00
Jason Simmons
7e91d04146 Update flutter_shell_native_unittests for compatibility with Android API 35 emulators (flutter/engine#54235)
Previously this was using a zero EGLConfig handle in tests which use an AndroidContextGLImpeller that creates EGL surfaces.  This apparently worked with older emulators, but the API 35 system image requires a real EGLConfig.

See https://github.com/flutter/flutter/pull/152498
2024-07-31 00:18:08 +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
f2c5ad0b1e [Impeller] delete rasterizer class. (flutter/engine#54196)
The rasterizer class doesn't actually do anything besides call impeller::Surface to get the render target. lets just remove it. Simplifies refactores needed to make https://github.com/flutter/engine/pull/53826 work well.
2024-07-29 22:59:11 +00:00
Jonah Williams
d6245bcd3a [iOS] leak a single overlay layer. (flutter/engine#54189)
Leave at least one overlay layer, to work around cases where scrolling platform views under an app bar continually adds and removes an overlay layer. This logic could be removed if https://github.com/flutter/flutter/issues/150646 is fixed.

Fixes https://github.com/flutter/flutter/issues/152266
2024-07-29 21:21:05 +00: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
Chris Bracken
853222c175 Revert "Set GLArea.has-alpha = true (#54053)" (flutter/engine#54190)
Reason for revert: Regression + no tests. Must have been at the end of a long day, cause I missed the missing test and glaring warning about that.

This reverts commit 0325e590babb33963dc35283cd425b39290919e5.

Re-opens https://github.com/flutter/flutter/issues/152154

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-07-29 20:09:04 +00:00