322 Commits

Author SHA1 Message Date
Chinmay Garde
d83fbb965a Add //flutter/fml/math.h with common math constants. (flutter/engine#30425)
This came up as I was [debugging failures on Windows](https://ci.chromium.org/p/flutter/builders/try/Windows%20Host%20Engine/30618?) due to use of the
non-portable constants.

Fixes https://github.com/flutter/flutter/issues/82216
2021-12-20 16:12:43 -08:00
Chinmay Garde
35a2ccb79a Add unconditional waits on fml::Semaphore. (flutter/engine#30165) 2021-12-07 12:49:01 -08:00
eggfly
2f9a4fba3f Remove remaining usages of getUnsafe() (flutter/engine#29941) 2021-11-29 21:24:01 -08:00
Gary Qian
9e1a29d21c Revert "Listen for Vsync callback on the UI thread directly" (flutter/engine#29923) 2021-11-24 12:33:02 -08:00
Fei Zhang
c45a9152a8 Listen for Vsync callback on the UI thread directly (flutter/engine#29889) 2021-11-24 04:23:01 -08:00
Chris Bracken
42605fc145 Windows: Clean up FML file debug messages (flutter/engine#29824) 2021-11-23 13:47:32 -08:00
Jenn Magder
c08aa6c73d Add 'explicit' to darwin embedder constructors (flutter/engine#29827) 2021-11-19 10:54:29 -08:00
Jenn Magder
b39436f7e5 Fix darwin namespace-comments and brace lint issues (flutter/engine#29828) 2021-11-18 21:06:56 -08:00
Jenn Magder
5291ff4193 Add 'explicit' to Android embedder constructors (flutter/engine#29830) 2021-11-18 21:06:44 -08:00
ColdPaleLight
9ecd4c1899 Make FlutterEngineGroup support dart entrypoint args (flutter/engine#29096) 2021-11-18 18:08:03 -08:00
Zachary Anderson
78d9e276e2 Fix some clang-tidy lints for Linux host_debug (flutter/engine#29734) 2021-11-18 13:08:01 -08:00
Zachary Anderson
03c0f7e453 Add 'explicit' to header files (flutter/engine#29741) 2021-11-17 12:49:16 -08:00
Jenn Magder
dbe42683b9 Fix 'google-readability-braces-around-statements' analyzer warning in macOS and iOS (flutter/engine#29723) 2021-11-12 18:42:29 -08:00
Ryan Macnak
1dfe28a310 Inform the Dart VM when snapshots are safe to use with madvise(DONTNEED). (flutter/engine#29320)
Bug: https://github.com/dart-lang/sdk/issues/44019
Bug: https://github.com/flutter/flutter/issues/92120
2021-10-28 16:53:41 -07:00
Jim Graham
7d144cb994 add flow events to the timeline to track the lifecycle of cache images (flutter/engine#29298) 2021-10-25 13:03:01 -07:00
Callum Moffat
cd18e95d73 [iOS] Fix duplicated keys when typing quickly on HW keyboard (flutter/engine#29113)
* [iOS] Fix duplicated keys when typing quickly on HW keyboard

* Address review (refactor constant)

* Change message loop constant name

* Apply suggestions from code review

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
2021-10-19 14:57:11 -07:00
Dan Field
293ef51fc6 Reland Android systrace (flutter/engine#29080)
* Reland "Use the systrace recorder if systracing is enabled at startup, and enable systracing in release mode on Android (#28903)" (#29071)"

This reverts commit a7660964b41f64991369341364a43c93317a4a51.

* More logcat

* more logs

* Remove wait

* Avoid plugin registrar exception

* DEFAULT instead of LAUNCHER

* use am instead of monkey

* Update android_systrace_test.py
2021-10-08 15:55:50 -07:00
Zachary Anderson
a7660964b4 Revert "Use the systrace recorder if systracing is enabled at startup, and enable systracing in release mode on Android (#28903)" (flutter/engine#29071)
This reverts commit 79063b3c6105c3cf8be757ed6d31dd9a055060d9.
2021-10-07 22:08:10 -07:00
Dan Field
79063b3c61 Use the systrace recorder if systracing is enabled at startup, and enable systracing in release mode on Android (flutter/engine#28903) 2021-10-07 15:59:46 -07:00
David Worsham
6bee1e7989 fuchsia: Implement WakeUp using zx::timer (flutter/engine#29019) 2021-10-06 00:18:44 -07:00
Kaushik Iska
4e77bce9f4 Reland "RTM must to acquire lock before called IsMergedUnsafe (#28514)" (flutter/engine#28581) 2021-09-13 11:44:53 -07:00
nt4f04uNd
0a28704999 Correct outdated weak_ptr docs (flutter/engine#28356) 2021-09-09 13:12:02 -07:00
Kaushik Iska
31087853c9 Revert "RTM must to acquire lock before called IsMergedUnsafe (#28514)" (flutter/engine#28533) 2021-09-09 11:08:51 -07:00
Kaushik Iska
929de2e3bf RTM must to acquire lock before called IsMergedUnsafe (flutter/engine#28514)
I was able to reproduce this on a windows machine with 10000 runs
of this test semi-consistently prior to this fix. After this fix
it seems to have stopped happening.

Fixes: https://github.com/flutter/flutter/issues/88464
2021-09-09 09:30:11 -04:00
Jason Simmons
34f7c9e249 Ensure that Skia persistent cache filenames do not exceed the maximum allowed length (flutter/engine#28315) 2021-09-02 11:56:02 -07:00
Jason Simmons
8e7f83d912 Fix a bug in the Base32 encoder that can cause improper encoding of the first byte (flutter/engine#28328) 2021-08-26 13:31:01 -07:00
eggfly
3506a0c03b Avoid deadlock while creating platform views with multiple engines. (flutter/engine#28224) 2021-08-23 08:57:02 -07:00
Brandon DeRosier
d5eed6ce6e Fix some stack-use-after-scopes found by ASan (flutter/engine#28147)
Fixes for Embedder and RefCounted tests.
2021-08-17 15:23:36 -07:00
gaaclarke
fdc01be73e added log statement to timerfd_settime failure (flutter/engine#27974) 2021-08-16 14:43:34 -07:00
eggfly
f1fd54b45a Implementation of two or more threads merging for multiple platform views (flutter/engine#27662)
Implementation of two or more threads merging for both lightweight multiple engines and standalone multiple engines.
2021-08-06 10:31:59 -07:00
Kaushik Iska
f0b2ba56c4 TimePoint::Now uses DartTimestampProvider (flutter/engine#27737) 2021-08-02 08:21:18 -07:00
Kaushik Iska
39c3ab3162 Create std::chrono timestamp provider and move fml_unittests to use this (flutter/engine#27708) 2021-07-27 11:11:13 -07:00
eggfly
a869375cd7 Re-enable fml_unittests (flutter/engine#27664) 2021-07-26 09:38:01 -07:00
eggfly
4f9f0f102e Fix wrong thread name in thread_checker (flutter/engine#27545) 2021-07-22 07:51:02 -07:00
Brandon DeRosier
e2c58529b5 Add native Android image decoder supported by API 28+ (flutter/engine#26746) 2021-07-21 13:52:29 -07:00
zouquan741
23e6afbec0 Fix leak in CFRef's move assignment operator. (flutter/engine#27441) 2021-07-15 13:36:02 -07:00
Chinmay Garde
17aff107e9 Add [[nodiscard]] decorations to fml::HashCombine. (flutter/engine#27343)
This makes it easier to catch errors when HashCombine was used
instead of HashCombineSeed.
2021-07-13 06:53:25 -07:00
Hunter Freyer
34b8a2b930 Replace flutter_runner::Thread with fml::Thread (flutter/engine#26783)
* Move task_observers.{cc,h} into fml.

This is a preparatory CL. The next CL will cause task_observers.h to
be included from both shell/platform/fuchsia _and_
fml/platform/fuchsia. I imagine it might be gauche for a single file
to be used from both those directories, but it seems way worse for fml
to depend on shell, rather than the other way around.

* Replace flutter_runner::Thread with fml::Thread.

This CL makes the treading logic in Fuchsia's flutter_runner more
consistent with fml expectations, but it still has quirks. Notably:

- Not all async work get posted to a fml::TaskRunner. Some work done
  by Fuchsia libraries gets posted directly to
  async_get_default_dispatcher(). This work doesn't trigger the
  fml::MessageLoop's task observers. As a result, we continue to have
  Fuchsia-specific task observers which fire for all async work,
  regardless of which way it was posted.

- There's awkwardness when trying to run Fuchsia code on a specific
  fml::TaskRunner if that fuchsia code accepts an
  async_dispatcher_t. Since you can no longer get an
  async_dispatcher_t for a given thread, you instead must post a
  closure to the fml::TaskRunner that calls
  async_get_default_dispatcher(), and then calls the fuchsia library
  with the default dispatcher.

- Some tests still use task_runner_adapter.h because async::Loop
  offers more control in unit tests than fml::MessageLoop does.

- If this successfully lands, there will be some cosmetic follow-up
  changes to make, like using ThreadHost instead of an array of
  fml::Threads.

* Increase stack size in flutter runner.

The previous change removes our custom 1MiB limit on the stack of
newly created threads, so these threads revert to the Fuchsia
default. google-internal tests were failing (without any particular
error in the logs) after this change, so here we just set the default
stack size to 1MiB.

Co-authored-by: Hunter Freyer <hjfreyer@google.com>
2021-07-06 10:04:08 -07:00
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