284 Commits

Author SHA1 Message Date
Kaushik Iska
833796b779 FrameTimings captures raster finish time in wall-clock time (flutter/engine#27074) 2021-07-01 11:36:02 -07:00
Jason Simmons
8f6b21db2b Symbolize crash backtraces using the Abseil debugging library (flutter/engine#26916) 2021-06-23 15:41:01 -07:00
Ren You
7d14b58d2d Revert "Replace flutter_runner::Thread with fml::Thread. (#26193)" (flutter/engine#26717) 2021-06-11 15:09:02 -07:00
Kaushik Iska
9012899d9c Fix issues with RunExpiredTasksWhileFirstTaskUnMergesThreads (flutter/engine#26612) 2021-06-07 11:17:56 -07:00
Hunter Freyer
84d62201b6 Replace flutter_runner::Thread with fml::Thread. (flutter/engine#26193) 2021-06-03 14:39:04 -07:00
chunhtai
4f0008101f Reland "Add API to the engine to support attributed text (#25373)" (flutter/engine#26528) 2021-06-02 10:14:02 -07:00
Kaushik Iska
187c6a3ec2 Revert "Add API to the engine to support attributed text (#25373)" (flutter/engine#26524)
This reverts commit f64abc695eb8badcdb2639a6321ba9575d3c7c3d.
2021-06-01 17:30:58 -07:00
chunhtai
f64abc695e Add API to the engine to support attributed text (flutter/engine#25373) 2021-06-01 11:54:01 -07:00
Kaushik Iska
95e8dbe246 Better logging pthread_setspecific (flutter/engine#26460) 2021-05-27 14:34:02 -07:00
gaaclarke
8380066e70 updated the documenation for message loops a bit (flutter/engine#26257) 2021-05-19 14:49:01 -07:00
Matej Knopp
4e8195b153 Remove counter from eintr wrapper (flutter/engine#26124)
Fixes https://github.com/flutter/flutter/issues/82226

On linux/lldb there are sometimes  spurious EINTR errors
when starting an isolate (without an apparent reason).
This results in threads being prematurely terminated.
2021-05-16 12:58:24 +02:00
gaaclarke
4d98fd9744 Switch PlatformMessages to hold data in Mappings (flutter/engine#25867) 2021-05-13 10:28:25 -07:00
Chris Bracken
d27dbba25a Extract FML command_line target (flutter/engine#26028)
Command-line argument parsing is valuable even in the absence of the
rest of FML's functionality.

This is pre-factoring for uwptool, which adds an adb-like helper tool
for install, uninstall, and launch of UWP applications for Windows
platforms.

See: https://github.com/flutter/flutter/issues/81756
2021-05-07 23:12:34 -07:00
Chinmay Garde
fe6e858ae1 Fix and re-enable flaky test MessageLoopTaskQueue::ConcurrentQueueAndTaskCreatingCounts. (flutter/engine#25826) 2021-04-28 16:09:01 -07:00
Kaushik Iska
dc0fb6e4a7 Reland "TaskSources register tasks with MessageLoopTaskQueues dispatcher" (flutter/engine#25692) 2021-04-21 14:29:02 -07:00
Kaushik Iska
17e7c26da8 Revert TaskRunner changes to fix Fuchsia Test failures (flutter/engine#25690) 2021-04-21 09:15:24 -07:00
Kaushik Iska
988c4ffb83 TaskSources register tasks with MessageLoopTaskQueues dispatcher (flutter/engine#25307) 2021-04-19 07:20:11 -07:00
Dan Field
22da76000a Refactor GPU access switch (flutter/engine#24356) 2021-04-06 22:16:06 -07:00
freiling
a8cea746b9 [fuchsia][shader warmup] Avoid recursively iterating over assets directory when loading skp's due to high cost of openat() on pkgfs (flutter/engine#25006)
* [fuchsia][shader warmup] Fixed SkpWarmupTest

This test regressed due to https://github.com/flutter/engine/pull/23488
and this regression was silent due to https://github.com/flutter/flutter/issues/78277

Credit to @gnoliyil for actually putting together the fix.

* [fuchsia][shader warmup] Avoid recursively iterating over assets directory when loading skp's due to high cost of openat() on pkgfs
2021-04-01 23:23:52 -07:00
Emmanuel Garcia
c34705f5dd Reland: "Fix memory leak and bug in the RunsOnCreationTaskRun" (flutter/engine#25317) 2021-03-31 15:16:38 -07:00
James Clarke
1ac67c93d8 Windows: Fix fml::GetFullHandlePath for WINUWP target (flutter/engine#24422)
Co-authored-by: Chris Bracken <chris@bracken.jp>
2021-03-17 11:52:44 -07:00
Ren You
4885af8ae3 Revert "Fix memory leak and bug in the RunsOnCreationTaskRunner check (#24690)" (flutter/engine#24874)
This reverts commit e0a475111216cf4775e08441100c0b6a24fd8b84.
2021-03-09 06:29:42 -08:00
Chris Bracken
13cf185e1c Correct setup-related typos (flutter/engine#24846)
Corrects uses of setup as a verb to 'set up', leaves noun/noun-phrase
forms of setup as 'setup'. Also settles on 'teardown' as opposed to
tear-down for consistency across the codebase.

A few other minor comment/wording corrections.
2021-03-08 17:31:10 -08:00
Emmanuel Garcia
e0a4751112 Fix memory leak and bug in the RunsOnCreationTaskRunner check (flutter/engine#24690) 2021-03-02 12:39:02 -08:00
Jason Simmons
5c4a3d6a92 Avoid calling Dart timeline APIs during Dart_Cleanup (flutter/engine#24007)
The Dart timeline is not thread safe if an engine thread that is not
controlled by Dart calls Dart_TimelineEvent while another thread is
calling Dart_Cleanup.

Fixes https://github.com/flutter/flutter/issues/74134
2021-02-02 09:12:55 -08:00
Jason Simmons
0af9029a51 Fix a null pointer dereference if dladdr is unable to find a symbol name (flutter/engine#23970) 2021-01-27 14:14:01 -08:00
zljj0818
a18173a94b fix concurrent threads cannot set thread name on Android issue (flutter/engine#23850) 2021-01-26 09:04:02 -08:00
Dan Field
e778949043 Reland path vol tracker (flutter/engine#23840)
This time making sure to deref the native object on GC.
2021-01-21 16:03:43 -08:00
Dan Field
cb57183325 revert path volatility tracker (flutter/engine#23822) 2021-01-21 08:34:02 -08:00
Jason Simmons
fa72fff62d Remove unused fml::Message serializer (flutter/engine#23669) 2021-01-14 14:44:04 -08:00
Jason Simmons
3c26d58ae9 Call JavaVM::AttachCurrentThread only once per thread (flutter/engine#23188) 2021-01-06 17:44:02 -08:00
s-sami
5619043974 Use syslog for logging on Fuchsia (flutter/engine#23429)
Make fml logging use syslog on Fuchsia. This allows logs
to be attributed to flutter and not pollute kernel logs.
2021-01-06 14:02:07 -08:00
Dan Field
dedf9bd1af Reland path volatility tracker, disabling it if deterministic rendering is requested (flutter/engine#23226)
* Reland path volatility tracker (#23063)" (#23220)

This reverts commit b56fc25561417f96e17dacab375e66f474a54c94.

* allow disabling based on whether deterministic rendering is needed
2020-12-22 08:25:20 -08:00
Dan Field
b56fc25561 Revert "Reland path volatility tracker (#23063)" (flutter/engine#23220)
This reverts commit 77c7096efb0b1392acc9793c386561a3c36012ba.
2020-12-21 13:53:18 -08:00
Dan Field
77c7096efb Reland path volatility tracker (flutter/engine#23063)
* Revert "Revert "Set SkPath::setIsVolatile based on whether the path survives at least two frames (#22620)" (#23044)"

This reverts commit feda80cb42f99e2588a9a6b9ab3dd1f812d0f45b.

* Fix tracing
2020-12-14 17:21:55 -08:00
freiling
4903a92b2b SKP based shader warmup (flutter/engine#20643) 2020-11-04 23:19:02 -08:00
Chinmay Garde
2f755560eb Add FML_UNREACHABLE to declare points in code that should never be reached. (flutter/engine#21941)
A version of this macro is present in most code-bases. The use of this macro
must satisfy two requirements:

1: If reached, the process must be terminated in all runtime modes and at all
   optimization levels.
2: If the compiler requires a value to be returned from the function,
   encountering this macro should not make the compiler insist on a return value
  (since the process is about to die anyway).

We used to have a version of this macro that wasn't widely used and didn't
satisfy the two requirements. I have removed the same and another unused macro
in fml/logging.h

Fixes https://github.com/flutter/flutter/issues/68164.
2020-10-16 20:47:43 -07:00
Chinmay Garde
db5c793ed5 Enable loading snapshots with sound null safety enabled. (flutter/engine#21820)
Snapshots compiled with sound null-safety enabled require changes to the way in
which isolates are launched. Specifically, the `Dart_IsolateFlags::null_safety`
field needs to be known upfront. The value of this field can only be determined
once the kernel snapshot is available. This poses a problem in the engine
because the engine used to launch the isolate at shell initialization and only
need the kernel mappings later at isolate launch (when transitioning the root
isolate to the `DartIsolate::Phase::Running` phase). This patch delays launch of
the isolate on the UI task runner till a kernel mapping is available. The side
effects of this delay (callers no longer having access to the non-running
isolate handle) have been addressed in this patch. The DartIsolate API has also
been amended to hide the method that could return a non-running isolate to the
caller.  Instead, it has been replaced with a method that requires a valid
isolate configuration that returns a running root isolate. The isolate will be
launched by asking the isolate configuration for its null-safety
characteristics.

A side effect of enabling null-safety is that Dart APIs that work with legacy
types will now terminate the process if used with an isolate that has sound
null-safety enabled. These APIs may no longer be used in the engine. This
primarily affects the Dart Convertors in Tonic that convert certain C++ objects
into the Dart counterparts. All known Dart Converters have been updated to
convert C++ objects to non-nullable Dart types inferred using type traits of the
corresponding C++ object. The few spots in the engine that used the old Dart
APIs directly have been manually updated. To ensure that no usage of the legacy
APIs remain in the engine (as these would cause runtime process terminations),
the legacy APIs were prefixed with the `DART_LEGACY_API` macro and the macro
defined to `[[deprecated]]` in all engine translation units. While the engine
now primarily works with non-nullable Dart types, callers can still use
`Dart_TypeToNonNullableType` to acquire nullable types for use directly or with
Tonic. One use case that is not addressed with the Tonic Dart Convertors is the
creation of non-nullable lists of nullable types. This hasn’t come up so far in
the engine.

A minor related change is reworking tonic to define a single library target.
This allows the various tonic subsystems to depend on one another. Primarily,
this is used to make the Dart convertors use the logging utilities. This now
allows errors to be more descriptive as the presence of error handles is caught
(and logged) earlier.

Fixes https://github.com/flutter/flutter/issues/59879
2020-10-16 14:53:26 -07:00
Dan Field
9377073f34 Fix windows popup (flutter/engine#21522) 2020-09-30 14:38:44 -07:00
Chinmay Garde
aacf00f3b6 Make scoped_nsprotocol::release() private. (flutter/engine#21467)
This is not used anywhere in the engine. However, this API is easy to misuse as
one might incorrectly assume that it releases the reference on the underlying
object. Callers must use `reset` for this purpose.
2020-09-28 14:02:21 -07:00
Chris Bracken
2586db3b22 Clean up C++ includes (flutter/engine#21127)
Cleans up header order/grouping for consistency: associated header, C/C++ system/standard library headers, library headers, platform-specific #includes.

Adds <cstring> where strlen, memcpy are being used: there are a bunch of places we use them transitively.

Applies linter-required cleanups. Disables linter on one file due to included RapidJson header. See https://github.com/flutter/flutter/issues/65676

This patch does not cover flutter/shell/platform/darwin. There's a separate, slightly more intensive cleanup for those in progress.
2020-09-11 21:18:35 -07:00
Chris Bracken
d03692449b Prefer C++ standard headers to their C counterpart (flutter/engine#21091)
We currently use a mix of C standard includes (e.g. limits.h) and their
C++ variants (e.g. climits). This migrates to a consistent style for all
cases where the C++ variants are acceptable, but leaves the C
equivalents in place where they are required, such as in the embedder
API and other headers that may be used from C.
2020-09-11 17:10:00 -07:00
Emmanuel Garcia
a942137a5d Only clear GL context after changing the thread configuration (flutter/engine#20965) 2020-09-02 22:10:02 -07:00
Emmanuel Garcia
9d05be2966 Add ability to disable the raster thread merger (flutter/engine#20800) 2020-08-28 17:25:00 -07:00
Chris Yang
c85f437dc9 |MessageLoopImpl::FlushTasks| runs one task at a time (flutter/engine#20771) 2020-08-27 14:18:02 -07:00
Emmanuel Garcia
d0947b9852 Ensure loop is woken up at the right time (flutter/engine#20721) 2020-08-24 13:09:44 -07:00
Chris Yang
72162b7a66 Ensure threads are merged when tearing down the Rasterizer (flutter/engine#19919) 2020-08-19 08:31:01 -07:00
David Worsham
4e60afdf2a Fix broken shell_unittests on Fuchsia (flutter/engine#20422)
Fixes https://github.com/flutter/flutter/issues/53399
2020-08-11 17:31:25 -07:00
Zachary Anderson
b7b32e51b4 Enable linting in several files (flutter/engine#20134) 2020-07-31 21:28:36 -07:00
Greg Spencer
d9b08f5411 Lint fixes for fml, tools subdirs (flutter/engine#19990)
This does lint fixes for the fml and tools subdirs.
2020-07-30 12:40:31 -07:00