451 Commits

Author SHA1 Message Date
Chris Bracken
0e6d56bc1c Move Abseil from src to flutter third_party dir (flutter/engine#51245)
In combination with:
* https://flutter-review.googlesource.com/c/third_party/abseil-cpp/+/55848
* https://github.com/flutter/buildroot/pull/831

this updates Flutter's references to Abseil from
//third_party/abseil-cpp to //flutter/third_party/abseil-cpp.

Issue: https://github.com/flutter/flutter/issues/144201
Part of: https://github.com/flutter/flutter/issues/67373

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-03-07 01:19:17 +00:00
Jason Simmons
652c0e071c Support gtest-parallel when running Impeller unit tests (flutter/engine#51079)
ImpellerC tests that use a temporary directory will append the current process ID to the directory name to avoid collisions.

The temporary directory will also be deleted after each test case completes.

See https://github.com/flutter/flutter/issues/143379
2024-03-04 20:17:07 +00:00
Zachary Anderson
9f1ed38ee0 Shift //third_party/icu to //flutter/third_party (flutter/engine#50924)
For https://github.com/flutter/flutter/issues/67373
2024-02-23 23:23:27 +00:00
Zachary Anderson
e6d9dca1b7 Shift some deps to //flutter/third_party (flutter/engine#50830)
Part of https://github.com/flutter/flutter/issues/67373
2024-02-21 23:51:16 +00:00
Zachary Anderson
f6629ffe5c Use 'et format' in CI. Check formatting of all files in CI (flutter/engine#50810)
This PR changes the format check on CI to use the command added in
https://github.com/flutter/engine/pull/50747.

Additionally, while making this change, I noticed that the CI check was
not checking the formatting of all files, and that as a result, files
were present in the repo with incorrect formatting. I have fixed the
formatting and fixed the check to always check all files.
2024-02-21 09:38:08 -08:00
Chinmay Garde
6c17d7bf9d Use a GN variable (dart_src) to reference the location of the Dart checkout. (flutter/engine#50624)
Towards https://github.com/flutter/flutter/issues/143335
2024-02-14 21:12:23 -08:00
Dan Field
e83d4c3a30 Do not use AChoreographer on 32 bit devices (flutter/engine#50586)
This is a fix forward alternative to the revert here: https://github.com/flutter/engine/pull/50581

If the revert lands first I'll rebase into this. I'm working on verifying this locally against the devicelab tests.
2024-02-13 17:32:16 +00:00
Dan Field
2f964dfe37 Refactor NDK helpers some more, add methods for SurfaceControl/Transaction, tests (flutter/engine#50540)
Adds more dynamic method lookups in service of https://github.com/flutter/flutter/issues/143105

Moves the TU out to FML so that Impeller can more easily use it.

Adds checking on `AHardwareBuffer_getId` so that it checks the return value before returning what is potentially garbage.

Adds some smoke tests to make sure these things actually work/look up meaningful symbols. Test is in the shell because we have testing infra for this kind of thing there.
2024-02-12 17:12:06 +00:00
Dan Field
9f9ab34867 [Impeller] Log non-default graphics backend usages, use IMPORTANT rather than ERROR (flutter/engine#50448)
Fixes https://github.com/flutter/flutter/issues/142488

- Only logs on iOS if Skia is used instead of Impeller.
- Logs on other platforms if Impeller is used instead of Skia.
- Uses "IMPORTANT" rather than "ERROR" for these logs. This will show up by default since flutter_tools sets ERROR and above as logs to show.
- Adds some tests.
- Makes INFO log print file paths the same as other verbosities.
2024-02-07 21:29:12 +00:00
Chinmay Garde
8ac86e0177 Delete fml::ThreadLocalUniquePtr. (flutter/engine#50310)
Fixes https://github.com/flutter/flutter/issues/141127
2024-02-04 03:04:07 +00:00
Tong Mu
be6209e136 Remove number of arguments from defining Dart FFI (flutter/engine#50153)
The number of arguments are not used. 

And also, even if we need it in the future, they can be derived at compile time:

```cpp
template <typename T>
struct function_traits;

template <typename Ret, typename... Args>
struct function_traits<Ret(Args...)>
{
    using params = std::tuple<Args...>;
};

template <typename T>
constexpr std::size_t get_parameter_count() {
    return std::tuple_size<typename function_traits<T>::params>::value;
}

template <typename T>
struct member_function_traits;

template <typename C, typename Ret, typename... Args>
struct member_function_traits<Ret(C::*)(Args...)>
{
    using params = std::tuple<Args...>;
};

template <typename T>
constexpr std::size_t get_member_function_parameter_count() {
    return std::tuple_size<typename member_function_traits<T>::params>::value;
}

```

(I got the code above with ChatGPT but I verified that they work)

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-02-01 23:58:31 +00:00
Martin Kustermann
891ac4e5bd More correctly name methods regarding event loop that are currently named microtask (flutter/engine#50138)
Flutter implements the UI isolates message via posting to a UI task queue. That task queue has a primary and a secondary queue. The

* primary is used for running tasks resulated to framework (e.g. draw frame)
* secondary is used to run Dart event loop messages (e.g. received data on a socket)

The Dart semantics requires running microtasks before processing the next event loop message.

The way flutter implements by attaching an observer to the secondary queue. Every time a task from the queue is run, all observers are run and one of them is going to run pending microtasks.

In some situations the engine pauses the dart event loop. The terminology used in the code is "microtask" when in reality what it means is "event loop".

=> This PR changes this terminology to reflect what actually happens.
2024-01-31 04:41:28 +00:00
Michael Brase
c4608bbfd1 Use structured logging on Fuchsia (flutter/engine#49918)
This change migrates off of the old fuchsia logging apis to use the
structured logging apis. The initial FIDL connection is made during
global initialization (before main()) and the initial minimum log level
is queried from the system. Later on, once the main loop is initialized,
we setup an async task to listen for additional log interest changes
from the system. The advantage of doing this on the main loop is that we
avoid spawning an additional background thread in the process (the
legacy logging apis use the background thread approach).

One added benefit of this change is it reduces the size of the
dart/flutter runner far packages by about 250kb in release mode, because
libsyslog.so and libbackend_fuchsia_globals.so are no longer needed.

flutter/flutter#141924

## 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-01-29 22:26:47 -06:00
Jason Simmons
33ff97be32 Truncate thread names on Linux to the maximum allowed length (flutter/engine#49781)
Also update some Impeller thread names to fit within that limit.
2024-01-16 17:02:34 +00:00
Chinmay Garde
c6b8349d0a Remove pthread based thread local support. (flutter/engine#49297)
The thread_local storage class was not available pre-C++11. Even when C++11 was available, the C++ runtime in versions of iOS <= 9.0 was not capable of supporting this storage class. So we ended up using pthread directly in that case. The unique pointer support was added later. Now that the storage class has been supported on all Flutter platforms for a while, we can remove the fallback and remove a bunch of code. The ThreadLocalUniquePtr can be removed too but that can be attempted in a separate migration.
2024-01-13 21:28:26 +00:00
Matej Knopp
6818b23a15 Enforce consistent stack size for Flutter threads (flutter/engine#49111)
Fixes https://github.com/flutter/flutter/issues/72156

*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-01-08 10:31:02 +01:00
Michael Brase
7c5452d3ae [fuchsia] Remove LoggingSocketTest.UseSyslogOnFuchsia test (flutter/engine#49524)
This test reads back logged messages on Fuchsia to verify that FML
logging has the log sink setup correctly. However, it relies on internal
implementation details of the Fuchsia log packet format, which recently
changed (to support structured logging) and it broke this test. Since
there isn't a supported way to parse structured log packets outside of
the Fuchsia repository, I'm removing this test to unblock the SDK roll.

flutter/flutter#140950
b/315973146

## 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-01-04 00:30:03 -08:00
Matan Lurey
3aae0411b7 Automatically fix header guards in the rest of the flutter/engine repo. (flutter/engine#49059) 2023-12-15 04:11:06 +00:00
Dan Field
28fbba2098 Delete unused/test only code from FML (flutter/engine#48327)
This is more-or-less a revert of https://github.com/flutter/engine/pull/14011

This code never ended up being used outside of tests, and it's not how we handle asset loading at this point anyway.

I was hopeful we could kill off all runtime dependencies on Dart in `FML` when looking at this, but it looks like trace_event.h still wants to import dart_api_tools.h for some Dart enum types. This may or may not matter if we ever want to build FML for web/wasm. /cc @eyebrowsoffire. If we really need to do that, we can refactor the trace event stuff so that it has a web and Dart implementation that's selected at build time.
2023-11-22 20:49:56 +00:00
Matan Lurey
b1a29657a9 Make {flow|fml|impeller}/... compatible with .clang_tidy. (flutter/engine#48241)
Another few stragglers.
2023-11-21 18:53:06 +00:00
Matan Lurey
aa07289b98 Make fml/... compatible with .clang-tidy. (flutter/engine#48150) 2023-11-17 22:14:38 +00:00
Matan Lurey
6f19a763ec Actually make status_or.h compatible with .clang-tidy. (flutter/engine#48151)
I needed to actually convince the checker I wasn't causing a value read
on a non-value. I think this is right?
2023-11-17 09:07:05 -08:00
Matan Lurey
0371968293 Make fml/status_or.h compatible with .clang_tidy. (flutter/engine#48002)
Work towards https://github.com/flutter/flutter/issues/134969.
2023-11-15 18:08:56 -08:00
Matan Lurey
da57416cbe Re-land "Make fml/... compatible with .clang_tidy (flutter/engine#48030)
Reverts flutter/engine#48004
2023-11-16 00:09:24 +00:00
Chris Yang
c07e3193e7 [ios] introduce weak_nsobject (flutter/engine#47947)
Introduce weak_nsobject from chromium. 

There are some usages of weak_ptr wrapping Objective-C ids, weak_ptr is not really designed for ids and such usages are blocking the arc migration. 

This PR mostly copies the weak_nsobject from chromium, at the same hash that we copied the ARC/MRC compatible scoped_nsobject: fd625125b8

To match how we used weak_ptr for those ids, I made some changes to the weak_nsobject:
- WeakNSObjects needs to be generated by a WeakNSObjectFactory. The WeakNSObjectFactory is owned by the objc class and acts as the generator of the WeakNSObjects. All the WeakNSObjects' derefing thread should be the same of the WeakNSObjectFactory's creation thread.
- chromuim's WeakNSObjects can be detached from the thread and re-attached to a new thread. To match our weak_ptr behavior, I changed WeakNSObjects to be only accessed from a single thread, the same as weak_ptr

This PR also moves the FlutterEngine to use WeakNSObject and updated related classes.

part of https://github.com/flutter/flutter/issues/137801

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-11-15 23:43:24 +00:00
auto-submit[bot]
a934a9bcd8 Reverts "Make fml/... compatible with .clang_tidy." (flutter/engine#48004)
Reverts flutter/engine#47992
Initiated by: bdero
This change reverts the following previous change:
Original Description:
Work towards https://github.com/flutter/flutter/issues/134969.

All changes were made automatically (i.e. with `--fix`).
2023-11-14 00:17:26 +00:00
Matan Lurey
e47c5864ef Make fml/... compatible with .clang_tidy. (flutter/engine#47992)
Work towards https://github.com/flutter/flutter/issues/134969.

All changes were made automatically (i.e. with `--fix`).
2023-11-13 22:52:51 +00:00
gaaclarke
002ab77448 Expanded the performance lints (flutter/engine#47868)
fixes https://github.com/flutter/flutter/issues/137372

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-11-09 23:54:01 +00:00
Chris Yang
5c12a78db9 [ios] making objective-C smart pointers support ARC (flutter/engine#47612)
Moving the implementation from https://codereview.chromium.org/1855483004 into the code base, including:

- scoped_nsobject, scoped_nsprotocol, scoped_block will support both mrc and arc
- Added parent class scoped_typeref for shared code between scoped_block and scoped_nsobject
- moving OwnershipPolicy to its own file

The implementation of the smart pointers are almost identical to https://codereview.chromium.org/1855483004 besides some syntax preference differences between chromium and flutter.

This PR also migrated [VsyncWaiterIosTest.mm](https://github.com/flutter/engine/pull/47612/files#diff-c98ce1a2aca65c29bbc444523b66921a53ecce5ff39a420b4eda7dbfe8ca1cc7) to ARC with scoped_nsobject

fixes https://github.com/flutter/flutter/issues/137802

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-11-07 19:25:45 +00:00
John O'Neil
58bb0adf2c Fix for undefined uint8_t seen on Clang-15+GCC13 (flutter/engine#47288)
This PR is to address an issue we're seeing compiling flutter+impeller in certain configurations. Specifically:

1. Compiling with `clang-15`
2. using the GCC 13 backend to provide headers and cstdlib.

Via the `clang-15` version flag:

```
clang-15 -v
Debian clang version 15.0.7
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/11
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/12
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/13
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/13
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
```

We were building using the gcc 12 backend for a while, but picked up an update that forced us to 13, and then saw this issue.

The issue is seen as `uint8_t` being undefined as in the following partial messages:

```
hex_codec.cc:18:5: error: unknown type name 'uint8_t'
base32.cc:29:32: error: unknown type name 'uint8_t'
```

I'm not sure this is the cleanest fix, or if it might be better handled by adding some compile time switches, but I wanted to provide this to start conversation.

I'm also hoping to get a better idea of tests run against a PR. If there's any I should run manually we can discuss that here.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-10-26 21:10:04 +00:00
Jonah Williams
792bf6d2e2 [Impeller] Allocate exact descriptor count, populate in one go. (flutter/engine#47200)
Rather than doing a guess and check, since we have all of our cmds already stored we can add up the binding counts and allocate the exact descriptor size and populate them in one call.

Also makes render_pass and compute_pass share more (though not all) code.
2023-10-24 19:22:38 +00:00
Chinmay Garde
daa95690cd Update fml::ThreadPriority enum to match style guide. (flutter/engine#47255) 2023-10-24 06:14:21 +00:00
Chinmay Garde
eb3e4ac1c5 Add missing headers to the fml source_set. (flutter/engine#47232)
These being missing came up when internal build rules were being derived from the ones here.
2023-10-23 20:45:23 +00:00
Jia Hao
ff7829558f Add missing import (flutter/engine#47083)
Fixes the following:

c8aa0844f2 results in the following error appearing internally when compiling for Android:

```
In file included from fml/synchronization/sync_switch.cc:5:
./fml/synchronization/sync_switch.h:74:34: error: implicit instantiation of undefined template 'std::vector<fml::SyncSwitch::Observer *>'
  mutable std::vector<Observer*> observers_;
                                 ^
<...>: note: template is declared here
class _LIBCPP_TEMPLATE_VIS vector;
                           ^
1 error generated.
```

*List which issues are fixed by this PR. You must list at least one issue.*
b/306266542

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-10-19 16:47:20 +00:00
Chris Bracken
6fd06e4039 [fml][embedder] Improve thread-check logging (flutter/engine#47020)
Developers working their app's runner code or in the native parts of
plugins are often required to call methods from the platform thread, or
face a crash.
Makes a minor improvement to fml::ThreadChecker's
IsCreationThreadCurrent log message.
This patch originally proposed to emit a much more specific error
message when calling methods that must be called on the platform thread
(typically originating in calls from plugins), however, given that we
don't ship debug engines as part of the SDK, this is really only going
to be useful to engine developpers, or people brave enough to run with
their own local engine build, in any case. 

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

No changed tests since no functional change, just an error message
cleanup.

## 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.
- [ ] 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
2023-10-17 15:32:50 -07:00
Jason Simmons
128b1d06d0 Workaround for a clang-tidy warning in CPUSpeedTracker (flutter/engine#47024)
The newly rolled version of clang-tidy is warning about some accesses to std::optional values.  The function does a has_value check before accessing the values, but the analyzer does not detect that.
2023-10-17 21:50:05 +00:00
gaaclarke
c8aa0844f2 [Impeller] implements a retry mechanism for dart:ui/Image.toByteData. (flutter/engine#46840)
Design doc: [link](https://docs.google.com/document/d/1Uuiw3pdQxNFTA8OQuZ-kuvYg1NB42XgccQCZeqr4oII/edit#heading=h.hn6wreyrz6fm)
fixes: https://github.com/flutter/flutter/issues/135245

One slight deviation from the design doc is that I decided to make ContextMTL respond to changes to the SyncSwitch instead of having it observe the app state directly.  The benefits are:
1) This keeps that functionality in one location
1) It makes writing tests much easier
1) There's no need of conditional compilation between macos and ios
1) There is no need to add an objc class

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-10-16 18:31:13 +00:00
gaaclarke
c053bc814b [Impeller] Started throwing errors if dart:ui/Image.toByteData fails (flutter/engine#46738)
issue: https://github.com/flutter/flutter/issues/135245

This is a first step.  Next we'll implement a retry.

## 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
2023-10-13 09:04:47 -07:00
Chinmay Garde
b66daf88a6 Remove workaround for older versions of MSVC. (flutter/engine#46689)
We don't use the MSVC frontend now anyway. And haven't for a while.
2023-10-10 13:11:51 -07:00
Chinmay Garde
e53f10f782 Remove obsolete tests that were time sensitive. (flutter/engine#46686)
These were always filtered away. On Fuchsia, where the filters were not
in place, there was an ifdef guard.

Followup to
https://github.com/flutter/flutter/issues/80457#issuecomment-1753419263

---------

Co-authored-by: Zachary Anderson <zanderso@users.noreply.github.com>
2023-10-09 13:39:21 -07:00
Matan Lurey
3cea82e53b More Clang Tidy --fix[es] to header files (flutter/engine#46151)
More work towards https://github.com/flutter/flutter/issues/134969.

I decided not to touch the `LOG_X` variables since they are just used in macro expansion.
2023-09-21 21:16:16 +00:00
Matan Lurey
476b46954c Migrate from LOG_X to kLogX. (flutter/engine#46107)
These should be entirely non-breaking, i.e. 1:1 and same backing `int`
value.

(See https://github.com/flutter/engine/pull/46052)
2023-09-20 13:24:01 -07:00
Matan Lurey
792830c13f Make a variety of low-impact Clang tidy fixes. (flutter/engine#46114)
Work towards https://github.com/flutter/flutter/issues/134969.

These are all self-contained, so I bundled them all together.

All fixes are generated by `clang-tidy --fix`, and manual search/replace if that wasn't sufficient.
2023-09-20 19:52:03 +00:00
Jonah Williams
dc05767b39 [Impeller] Affinity adjustments for Vulkan backend. (flutter/engine#46063)
Runs the waiter threads with efficiency affinity and the worker thread with "not performance" affinity.
2023-09-19 23:34:11 +00:00
Matan Lurey
1475e52d11 Deprecate fml::LOG_X in favor of kLogX. (flutter/engine#46052)
This is required to eventually land https://github.com/flutter/flutter/issues/134969 (lint header files).

No changes in behavior in this PR. Future steps:

 - Change existing `LOG_X` references to `kLogX`
 - Delete `LOG_X`
2023-09-19 18:05:38 +00:00
Jonah Williams
88e963e0fd [Android] Add support for setting thread affinity based on core speed. (flutter/engine#45673)
https://github.com/flutter/flutter/issues/134452

This patch parses the speed of all CPU data out of /proc and constructs a table that allows us to request high level CPU affinities: performance, efficiency, and not performance. These affinties are applied where appropriate during Android thread construction.
2023-09-19 03:50:05 +00:00
Matan Lurey
0f4cb0b4c8 Make fml::ScopedCleanupClosure std::move-able and add unit tests. (flutter/engine#45772)
Fixes https://github.com/flutter/flutter/issues/134568.
2023-09-14 18:37:49 +00:00
Jason Simmons
2ae4942db0 Use the Clang unreachable code warning flag in the engine tree (flutter/engine#44458) 2023-08-08 17:40:03 +00:00
Jason Simmons
75f91264d1 Do not log exceptions from JNI lookups of APIs that are known to be unavailable on older devices (flutter/engine#44357)
These exceptions are benign but were being logged every time an app is launched on a device with an Android API level below 26.
2023-08-07 14:35:05 +00:00
Derek Xu
dedec555f2 Handle deprecation of Dart_TimelineEvent Embedder API (flutter/engine#42497)
This PR changes usages of `Dart_TimelineEvent` to
`Dart_RecordTimelineEvent` as `Dart_TimelineEvent` was deprecated in
https://dart-review.googlesource.com/c/sdk/+/308721.
2023-08-02 16:09:31 -04:00