- 13 11月, 2018 1 次提交
-
-
由 Michael Goderbauer 提交于
-
- 08 11月, 2018 1 次提交
-
-
由 Michael Goderbauer 提交于
-
- 23 10月, 2018 1 次提交
-
-
由 Chinmay Garde 提交于
TL;DR: Offscreen surface is created on the render thread and device to host transfer performed there before task completion on the UI thread. While attempting to snapshot layer trees, the engine was attempting to use the IO thread context. The reasoning was that this would be safe to do because any textures uploaded to the GPU as a result of async texture upload would have originated from this context and hence the handles would be valid in either context. As it turns out, while the handles are valid, Skia does not support this use-case because cross-context images transfer ownership of the image from one context to another. So, when we made the hop from the UI thread to the IO thread (for snapshotting), if either the UI or GPU threads released the last reference to the texture backed image, the image would be invalid. This led to such images being absent from the layer tree snapshot. Simply referencing the images as they are being used on the IO thread is not sufficient because accessing images on one context after their ownership has already been transferred to another is not safe behavior (from Skia's perspective, the handles are still valid in the sharegroup). To work around these issues, it was decided that an offscreen render target would be created on the render thread. The color attachment of this render target could then be transferred as a cross context image to the IO thread for the device to host tranfer. Again, this is currently not quite possible because the only way to create cross context images is from encoded data. Till Skia exposes the functionality to create cross-context images from textures in one context, we do a device to host transfer on the GPU thread. The side effect of this is that this is now part of the frame workload (image compression, which dominate the wall time, is still done of the IO thread). A minor side effect of this patch is that the GPU latch needs to be waited on before the UI thread tasks can be completed before shell initialization.
-
- 19 10月, 2018 1 次提交
-
-
由 Michael Klimushyn 提交于
An integration test will be added to the framework's repo as a followup. Addresses flutter/flutter#22009
-
- 27 7月, 2018 1 次提交
-
-
由 Chinmay Garde 提交于
-
- 24 7月, 2018 1 次提交
-
-
由 Jason Simmons 提交于
-
- 14 7月, 2018 1 次提交
-
-
由 Jason Simmons 提交于
-
- 14 6月, 2018 1 次提交
-
-
由 Ben Konyi 提交于
* Reland "Added IsolateNameServer functionality (#5410)" This reverts commit c3976b3c. * Fixed issue with isolate_name_server_test which caused test to timeout * Disabled thread_annotations on Android as they aren't supported in the NDK headers for std::mutex. Readded thread annotations to IsolateNameServer.
-
- 13 6月, 2018 2 次提交
-
-
由 Ben Konyi 提交于
* Added IsolateNameServer functionality, which allows for the association of string names with isolate SendPort ids that can be used to establish inter-isolate communications.
- 11 5月, 2018 1 次提交
-
-
- 19 4月, 2018 1 次提交
-
-
由 Jason Simmons 提交于
The WeakPtrFactory must be deleted on the thread where it was created. However, the service isolate is created and destroyed on threads from the Dart thread pool, and the creating thread may not be the same as the destroying thread.
-
- 14 4月, 2018 1 次提交
-
-
由 Chinmay Garde 提交于
* Re-land "Support multiple shells in a single process. (#4932)" This reverts commit 723c7d01.
-
- 13 4月, 2018 1 次提交
-
-
由 Vyacheslav Egorov 提交于
This reverts commit a3327bff.
-
- 12 4月, 2018 1 次提交
-
-
由 Chinmay Garde 提交于
This reverts commit 9199b40f.
-
- 11 4月, 2018 2 次提交
-
-
由 Chinmay Garde 提交于
This reverts commit 6baff4c8.
-
由 Chinmay Garde 提交于
* 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
-
- 07 2月, 2018 1 次提交
-
-
由 Zachary Anderson 提交于
This relands https://github.com/flutter/engine/pull/4629 with a tonic roll to fix the build.
-
- 03 2月, 2018 2 次提交
-
-
由 Zachary Anderson 提交于
This reverts commit 8f638591.
-
由 Zachary Anderson 提交于
-
- 16 11月, 2017 1 次提交
-
-
由 Ian McKellar 提交于
The UIDartState is now always owned by the isolate and always freed in the isolate cleanup callback. In the isolate shutdown callback, if the isolate being shut down is the main isolate, the RuntimeController is informed which in turn notifies the RuntimeHolder and thus the ApplicationControllerImpl. The ApplicationControllerImpl tears down the whole Flutter application. This fixes Fuchsia bug: MI4-328
-
- 19 10月, 2017 1 次提交
-
-
由 P.Y. Laligand 提交于
-
- 18 10月, 2017 1 次提交
-
-
由 Siva 提交于
* Fix for issue 12526 Ensure that child isolates do not clear the dart_ui_state_ field present in the dart controller. The commit https://github.com/flutter/engine/commit/dd1e0b59ece026737b05640cf020a6e590cfc10c implemented code to reset the dart_ui_state_ back to null when an isolate was being shutdown to ensure there was no use after free issues when the main isolate exeutes Isolate.current.kill() it however it was also clearning the field when a child isolate was shutdown causing SEGVs later. * Address code format issues.
-
- 20 9月, 2017 1 次提交
-
-
由 Ian McKellar 提交于
If an isolate shuts down (for example if an app calls Isolate.current.kill()), the UIDartState* on DartController will refer to a freed object. This wires through notification that the is shutting down through to the DartController so it can clean up appropriately. This also makes gives the vm-service isolate an UIDartState* so that the shutdown callback can behave correctly.
-
- 15 9月, 2017 1 次提交
-
-
由 Alexander Aprelev 提交于
* Revert "Make Travis happy again (#4101)" This reverts commit c99b2559. * Revert "Support cleaner Dart isolate shutdown handling. (#4096)" This reverts commit 05751f7b.
-
- 14 9月, 2017 1 次提交
-
-
由 Ian McKellar 提交于
If an isolate shuts down (for example if an app calls Isolate.current.kill()), the UIDartState* on DartController will refer to a freed object. This wires through notification that the is shutting down through to the DartController so it can clean up appropriately.
-
- 12 9月, 2017 1 次提交
-
-
由 George Kulakowski 提交于
-
- 26 8月, 2017 1 次提交
-
-
由 Carlo Bernaschina 提交于
Dart_DebugName should be used just to make debug outputs more readable. We remove the dependency from this API and form the UIDartState debug name in the engine using the predefined format: <script_uri>$main-<main_port> This will allow the engine to change the format of the isolate name without breaking the engine. Related https://codereview.chromium.org/3004563003/
-
- 01 4月, 2017 1 次提交
-
-
- 21 10月, 2016 1 次提交
-
-
由 Adam Barth 提交于
We no longer offer mojo handles via this mechanism.
-
- 12 10月, 2016 1 次提交
-
-
由 Adam Barth 提交于
After this patch, platform messages now take the same path through the system that semantics data does (on Android). Support on iOS will be in another patch.
-
- 08 10月, 2016 1 次提交
-
-
由 Adam Barth 提交于
This transport uses the Dart and JNI APIs directly instead of indirecting through Mojo.
-
- 29 9月, 2016 1 次提交
-
-
由 Chinmay Garde 提交于
-
- 08 9月, 2016 1 次提交
-
-
由 Adam Barth 提交于
We can now use the real thing on Fuchsia.
-
- 17 8月, 2016 1 次提交
-
-
由 John McCutchan 提交于
-
- 13 8月, 2016 4 次提交
-
-
由 Adam Barth 提交于
-
由 Adam Barth 提交于
Now lib/ui depends on sky/engine rather than the reverse.
-
由 Adam Barth 提交于
* Move dart:mojo.internal to //flutter/lib/mojo To be parallel with the other built-in libraries. * Move DartRuntimeHooks into //flutter/lib/ui This code manipulates natives.dart, which is part of //flutter/lib/ui.
-
由 Adam Barth 提交于
This pulled a refactoring of how we keep track of the primary threads.
-
- 09 8月, 2016 1 次提交
-
-
由 John McCutchan 提交于
Add an association between FlutterViews and Dart Isolates to the PlatformView service protocol support (#2886)
-