70 Commits

Author SHA1 Message Date
Jonah Williams
e32531f0ee
Switch flutter's dart sdk to full and add dartdevc libraries (#7968) 2019-02-26 14:49:09 -08:00
Michael Klimushyn
28bafe6903
Don't use Wuffs (#7785)
This code path isn't stable yet.

Fixes flutter/flutter#27718
Reopens flutter/flutter#23838
2019-02-11 11:09:45 -08:00
Dan Field
f9252e72f8
allow specifying out directory root (#7753) 2019-02-08 15:15:47 -08:00
liyuqian
3c118b6c3b
Disable wuff on Windows (#7713)
MSVC won't compile wuff...
2019-02-06 11:52:25 -08:00
Jason Simmons
351f5a35f3
Use the Wuffs GIF decoder (#7658)
Fixes https://github.com/flutter/flutter/issues/23838
2019-02-05 14:09:18 -08:00
liyuqian
09a3735ea7
Respect default goma path on Windows (#7643) 2019-01-30 13:00:34 -08:00
Chinmay Garde
1dc01adfa6
Allow generating coverage reports for all unit-tests in the engine. (#7576) 2019-01-24 14:03:15 -08:00
Vyacheslav Egorov
8a71c73d4b
Pass operator_new_alignment value through gn script into GN args. (#7031)
Background:

Some allocators (tcmalloc) don't provide alignment guarantees that
match clang's default expectations, which causes crashes when using
clang compiled binary with such allocators.

For example clang can produce movaps instructions to initialize newly
allocated object - which would crash if result of ::operator new() is
not 16 bytes aligned.
2019-01-15 16:09:46 +01:00
Chinmay Garde
93f75f283a
Don't provide system vulkan header paths to Skia. (#7003)
Skia privately brings in its own copy. https://skia-review.googlesource.com/c/skia/+/172147
2018-11-28 15:31:16 -08:00
Michael Goderbauer
70a1106b50
Unify copyright lines (#6757) 2018-11-07 12:24:35 -08:00
Chinmay Garde
08272ee6aa
Allow specifying custom toolchains and sysroots for host builds. (#6548)
Updates buildroot to https://github.com/flutter/buildroot/pull/180.
2018-10-15 14:18:02 -07:00
Michael Goderbauer
763627fff5
Do not export libdart symbols (#6337) 2018-09-27 18:19:22 +02:00
Chinmay Garde
5b799381f4
Dont make any binaries specify an X11 dependency. (#6353) 2018-09-26 18:15:30 -07:00
Michael Goderbauer
58a1894a1c
Update to latest clang (#6174)
* Roll buildroot to be483cb1cd3a9c4313b2e534034d23a05c3d849e
* Rolls buildtools to c1408453246f0475547b6fe634c2f3dad71c6457
2018-09-06 15:29:04 -07:00
Chinmay Garde
c822ab26cf
Allow building the embedder API for the target toolchains. (#6069) 2018-08-22 16:42:47 -07:00
Jason Simmons
4b271b2e02
Add a Flutter build flag that enables dart_debug checks (#6059) 2018-08-21 08:42:13 -07:00
Stanislav Baranov
0c0034323d
Make 'gn --debug' and 'gn --debug --dynamic' identical. (#5999) 2018-08-10 15:34:41 -07:00
Zachary Anderson
a09b4fdcb7
Adds dynamic, interpreter configs to tools/gn (#5446)
Adds --dynamic and --interpreter flags to
tools/gn. These flags result in engines with
properties as follows:

--dynamic:
- JIT targeting native code on Android and
  DBC on iOS

--interpreter
- Target DBC even if running on Android.

For example:

gn --android --dynamic --interpreter --runtime-mode release

Will generate an engine:
- Without Dart asserts
- Without Observatory
- With JIT compililation to DBC

into out/android_dynamic_release_dbc
2018-06-05 14:52:52 -07:00
Chinmay Garde
983f39c75a
Don't enable LTO on Windows hosts as the toolchain does not read the value. (#5364) 2018-05-24 14:21:42 -07:00
Chinmay Garde
fe7cad4199
Temporarily use expat on Android because the Android font manager depends on the same. (#5308) 2018-05-18 12:55:20 -07:00
Chinmay Garde
f922442d58
Disable SVG canvas and friends. (#5306) 2018-05-18 12:09:14 -07:00
Chinmay Garde
58e84c8bf0
Re-land "Support multiple shells in a single process. (#4932)" (#4998)
* Re-land "Support multiple shells in a single process. (#4932)"

This reverts commit 723c7d01439da4261bc836075fb55651ce9e7f03.
2018-04-13 13:48:15 -07:00
Vyacheslav Egorov
723c7d0143
Revert "Re-land "Support multiple shells in a single process. (#4932)" (#4977)" (#4981)
This reverts commit a3327bff86800b3e654a2988fa7e6049edeb679c.
2018-04-12 18:28:55 +02:00
Chinmay Garde
a3327bff86
Re-land "Support multiple shells in a single process. (#4932)" (#4977)
This reverts commit 9199b40f2a2a6e448cd251de44e020ec3b75002d.
2018-04-11 15:41:23 -07:00
Chinmay Garde
9199b40f2a
Revert "Support multiple shells in a single process. (#4932)" (#4964)
This reverts commit 6baff4c821350bbcb64e7d029574b567f3801a1a.
2018-04-10 15:28:43 -07:00
Chinmay Garde
6baff4c821
Support multiple shells in a single process. (#4932)
* Support multiple shells in a single process.

The Flutter Engine currently works by initializing a singleton shell
instance. This shell has to be created on the platform thread. The shell
is responsible for creating the 3 main threads used by Flutter (UI, IO,
GPU) as well as initializing the Dart VM. The shell, references to task
runners of the main threads as well as all snapshots used for VM
initialization are stored in singleton objects. The Flutter shell only
creates the threads, rasterizers, contexts, etc. to fully support a
single Flutter application. Current support for multiple Flutter
applications is achieved by making multiple applications share the same
resources (via the platform views mechanism).

This scheme has the following limitations:

* The shell is a singleton and there is no way to tear it down. Once you
  run a Flutter application in a process, all resources managed by it
  will remain referenced till process termination.
* The threads on which the shell performs its operations are all
  singletons. These threads are never torn down and multiple Flutter
  applications (if present) have to compete with one another on these
  threads.
* Resources referenced by the Dart VM are leaked because the VM isn't
  shutdown even when there are no more Flutter views.
* The shell as a target does not compile on Fuchsia. The Fuchsia content
  handler uses specific dependencies of the shell to rebuild all the
  shell dependencies on its own. This leads to differences in frame
  scheduling, VM setup, service protocol endpoint setup, tracing, etc..
  Fuchsia is very much a second class citizen in this world.
* Since threads and message loops are managed by the engine, the engine
  has to know about threading and platform message loop interop on each
  supported platform.

Specific updates in this patch:

* The shell is no longer a singleton and the embedder holds the unique
  reference to the shell.
* Shell setup and teardown is deterministic.
* Threads are no longer managed by the shell. Instead, the shell is
  given a task runner configuration by the embedder.
* Since the shell does not own its threads, the embedder can control
  threads and the message loops operating on these threads. The shell is
  only given references to the task runners that execute tasks on these
  threads.
* The shell only needs task runner references. These references can be
  to the same task runner. So, if the embedder thinks that a particular
  Flutter application would not need all the threads, it can pass
  references to the same task runner. This effectively makes Flutter
  application run in single threaded mode. There are some places in the
  shell that make synchronous calls, these sites have been updated to
  ensure that they don’t deadlock.
* The test runner and the headless Dart code runner are now Flutter
  applications that are effectively single threaded (since they don’t
  have rendering concerns of big-boy Flutter application).
* The embedder has to guarantee that the threads and outlive the shell.
  It is easy for the embedder to make that guarantee because shell
  termination is deterministic.
* The embedder can create as many shell as it wants. Typically it
  creates a shell per Flutter application with its own task runner
  configuration. Most embedders obtain these task runners from threads
  dedicated to the shell. But, it is entirely possible that the embedder
  can obtain these task runners from a thread pool.
* There can only be one Dart VM in the process. The numerous shell
  interact with one another to manage the VM lifecycle. Once the last
  shell goes away, the VM does as well and hence all resources
  associated with the VM are collected.
* The shell as a target can now compile and run on Fuchsia. The current
  content handler has been removed from the Flutter engine source tree
  and a new implementation has been written that uses the new shell
  target.
* Isolate management has been significantly overhauled. There are no
  owning references to Dart isolates within the shell. The VM owns the
  only strong reference to the Dart isolate. The isolate that has window
  bindings is now called the root isolate. Child isolates can now be
  created from the root isolate and their bindings and thread
  configurations are now inherited from the root isolate.
* Terminating the shell terminates its root isolates as well as all the
  isolates spawned by this isolate. This is necessary be shell shutdown
  is deterministic and the embedder is free to collect the threads on
  which the isolates execute their tasks (and listen for mircrotasks
  flushes on).
* Launching the root isolate is now significantly overhauled. The shell
  side (non-owning) reference to an isolate is now a little state
  machine and illegal state transitions should be impossible (barring
  construction issues). This is the only way to manage Dart isolates in
  the shell (the shell does not use the C API is dart_api.h anymore).
* Once an isolate is launched, it must be prepared (and hence move to
  the ready phase) by associating a snapshot with the same. This
  snapshot can either be a precompiled snapshot, kernel snapshot, script
  snapshot or source file. Depending on the kind of data specified as a
  snapshot as well as the capabilities of the VM running in the process,
  isolate preparation can fail preparation with the right message.
* Asset management has been significantly overhauled. All asset
  resolution goes through an abstract asset resolver interface. An asset
  manager implements this interface and manages one or more child asset
  resolvers. These asset resolvers typically resolve assets from
  directories, ZIP files (legacy FLX assets if provided), APK bundles,
  FDIO namespaces, etc…
* Each launch of the shell requires a separate and fully configured
  asset resolver. This is necessary because launching isolates for the
  engine may require resolving snapshots as assets from the asset
  resolver. Asset resolvers can be shared by multiple launch instances
  in multiple shells and need to be thread safe.
* References to the command line object have been removed from the
  shell. Instead, the shell only takes a settings object that may be
  configured from the command line. This makes it easy for embedders and
  platforms that don’t have a command line (Fuchsia) to configure the
  shell. Consequently, there is only one spot where the various switches
  are read from the command line (by the embedder and not the shell) to
  form the settings object.
* All platform now respect the log tag (this was done only by Android
  till now) and each shell instance have its own log tag. This makes
  logs from multiple Flutter application in the same process (mainly
  Fuchsia) more easily decipherable.
* The per shell IO task runner now has a new component that is
  unfortunately named the IOManager. This component manages the IO
  GrContext (used for asynchronous texture uploads) that cooperates with
  the GrContext on the GPU task runner associated with the shell. The
  IOManager is also responsible for flushing tasks that collect Skia
  objects that reference GPU resources during deterministic shell
  shutdown.
* The embedder now has to be careful to only enable Blink on a single
  instance of the shell. Launching the legacy text layout and rendering
  engine multiple times is will trip assertions. The entirety of this
  runtime has been separated out into a separate object and can be
  removed in one go when the migration to libtxt is complete.
* There is a new test target for the various C++ objects that the shell
  uses to interact with the Dart VM (the shell no longer use the C API
  in dart_api.h). This allows engine developers to test VM/Isolate
  initialization and teardown without having the setup a full shell
  instance.
* There is a new test target for the testing a single shell instances
  without having to configure and launch an entire VM and associated
  root isolate.
* Mac, Linux & Windows used to have different target that created the
  flutter_tester referenced by the tool. This has now been converted
  into a single target that compiles on all platforms.
* WeakPointers vended by the fml::WeakPtrFactory(notice the difference
  between the same class in the fxl namespace) add threading checks on
  each use. This is enabled by getting rid of the “re-origination”
  feature of the WeakPtrFactory in the fxl namespace. The side effect of
  this is that all non-thread safe components have to be created, used
  and destroyed on the same thread. Numerous thread safety issues were
  caught by this extra assertion and have now been fixed.
  * Glossary of components that are only safe on a specific thread (and
    have the fml variants of the WeakPtrFactory):
    * Platform Thread: Shell
    * UI Thread: Engine, RuntimeDelegate, DartIsolate, Animator
    * GPU Thread: Rasterizer, Surface
    * IO Thread: IOManager

This patch was reviewed in smaller chunks in the following pull
requests. All comments from the pulls requests has been incorporated
into this patch:

* flutter/assets: https://github.com/flutter/engine/pull/4829
* flutter/common: https://github.com/flutter/engine/pull/4830
* flutter/content_handler: https://github.com/flutter/engine/pull/4831
* flutter/flow: https://github.com/flutter/engine/pull/4832
* flutter/fml: https://github.com/flutter/engine/pull/4833
* flutter/lib/snapshot: https://github.com/flutter/engine/pull/4834
* flutter/lib/ui: https://github.com/flutter/engine/pull/4835
* flutter/runtime: https://github.com/flutter/engine/pull/4836
* flutter/shell: https://github.com/flutter/engine/pull/4837
* flutter/synchronization: https://github.com/flutter/engine/pull/4838
* flutter/testing: https://github.com/flutter/engine/pull/4839
2018-04-10 14:57:02 -07:00
Zachary Anderson
1b015918ce
Roll Dart to 0d5cf900b021bf5c9fa593ffa12b15bcd1cc5fe0 (#4689) 2018-02-16 14:59:21 -08:00
Alexander Aprelev
981ebb5e97
Use fallback root certificates on Windows host builds (#4662)
* Use fallback root certificats on Windows, Linux host builds

* Use fallback only on Windows
2018-02-12 22:37:34 -08:00
Jason Simmons
37c132e2ac
Provide the skia_vulkan_header variable now required by Skia's Vulkan build scripts (#4459) 2017-12-13 17:17:05 -08:00
amirh
5afc1e2848
Enable WebP (#4359) 2017-11-15 16:49:50 -08:00
Zachary Anderson
6fb04adde9
Fix comment in last commit (#4315) 2017-11-03 08:53:42 -07:00
Zachary Anderson
9463b32b23
Reland: [GN] Don't set dart_host_toolchain (#4314) 2017-11-02 10:04:06 -07:00
Mikkel Nygaard Ravn
b41511e9a5
Revert "[GN] Don't set dart_host_toolchain (#4308)" (#4310)
This reverts commit 4caa68b8a061595ccdd8de17b530584604947b79.
2017-11-02 09:09:15 +01:00
Zachary Anderson
4caa68b8a0
[GN] Don't set dart_host_toolchain (#4308) 2017-11-01 13:36:18 -07:00
Abhishek Amit
bd64e8dc5a Add flags to allow cross compiling to linux arm (#4120) 2017-09-19 14:09:35 -07:00
Jason Simmons
83ce8c40b1 Set the is_official_build flag that disables GR_TEST_UTILS in Skia (#4072)
Fixes https://github.com/flutter/flutter/issues/11952
2017-09-06 15:55:29 -07:00
Chinmay Garde
7f5bbe186b [GN] Add a --ios-cpu flag to build an iOS armv7 capable Flutter engine. (#4063) 2017-09-05 14:46:39 -07:00
Chinmay Garde
be634bc41b Allow disabling LTO in optimized builds. (#4057) 2017-09-05 13:00:27 -07:00
Chinmay Garde
2e46f6ff75 Switch to Harfbuzz 1.5.0 from Fuchsia. (#4006) 2017-08-25 12:57:43 -07:00
Chinmay Garde
d8ab878c83 Only enable_lto on platforms where the toolchain recognizes the flag. (#3971) 2017-08-09 14:29:05 -07:00
Chinmay Garde
eb33f26513 Update buildroot and opt out of LTO on unopt builds. (#3952) 2017-08-04 13:12:36 -07:00
Ryan Macnak
316fa7e223 Speculatively disable GN argument 'enable_profiling' to test its effect on benchmarks. (#3905) 2017-07-19 12:52:53 -07:00
Brian Osman
ab8584eff2 Roll Skia and enable API guards (#3884)
* Roll Skia and enable API guards
* Update licenses
2017-07-18 09:44:21 -04:00
Ryan Macnak
7d698b84bd Restore setting dart_target_arch to fix Windows build. (#3883)
The Windows build does not have an appropriate target_cpu because it is incomplete and does not build the engine.
2017-07-17 13:33:33 -07:00
Ryan Macnak
7480e32854 Remove word-size mismatch from 32-bit Android debug builds to work wi… (#3879)
Roll Dart to be95b916ddf0af2b204286a438e7169e3bb2c67a.
2017-07-17 09:45:10 -07:00
Ryan Macnak
eb467a8b85 Don't enable_profiling for x86 Android. (#3848)
This somehow introduces text relocations even though we always use -fPIC.
2017-07-06 14:40:34 -07:00
Ryan Macnak
66fbebaca3 Changes to get the profiler working for C code on Android. (#3847)
Roll Dart VM to daa38a2ea21d290e45adb509dc60418b22ec7eba for fix to Thumb profile sample collection.

Roll buildroot to b0b836db790abff26695a944224a4934480f2f48.
2017-07-06 09:40:23 -07:00
Alexander Aprelev
009d470d50 Generate flutter-flavoured dart patched sdk and platform.dill (#3814)
* Build Flutter patched-sdk with kernel artifacts

* Switch to new dart_host_toolchain argument mechanism to let dart patch_sdk know of host_toolchain.

* Update dart dependency

* Updated licenses

* Rename dart dependencies tag so they have just 'dart_'-prefixed dart's names.

* Fix indentation and line breaks for newly added deps.

* Add toolchain for windows host

* Update dart revision

* Licenses

* Update licenses

* Revert changes to licenses_third_party
2017-06-27 02:44:04 +00:00
Chris Bracken
1f765cdba7 Don't override ios deployment target in gn (#3751)
Use the value specified in build/config/ios/ios_sdk.gni in the buildroot
repo.

Updates buildroot to 4d1c1fd7103d6daba559e456a6a68e4385bb28f1
2017-06-07 13:47:13 -07:00
Chinmay Garde
aac4fdca96 Fix Android Vulkan build by accounting for updated GN flags. (#3670) 2017-05-09 14:17:24 -07:00