When there are no pending timers, we should sit in glfwWaitEvents instead of
continuously calling glfwPollEvents. This reduces CPU utilization
significantly.
All the headers for Flutter.framework are now in framework/Headers and all the
source files for Flutter.framework are now in framework/Source. Previously it
was unclear that FlutterAppDelegate and main_ios.mm weren't part of
Flutter.framework. (They still build as part of the framework, but that's
something I'll fix in a later patch.)
Previously the AOT snapshot was packaged as a dynamic library (similar to the
scheme used on iOS). This change eliminates the need for a native code
toolchain when building for AOT.
This include build system changes for selecting Dart's precompiler mode
plus a way to locate and load the precompiled snapshot library from an
Android application
Instead, make Layer::Paint take a new PaintContext that has just exactly
the state that it needs, mirroring PrerollContext. Also, rename
PaintContext to CompositorContext because it holds the context for the
whole compositor.
Dart invokes Start/StopTracing callbacks within the _setVMTimelineFlags service
method whenever the embedder timeline stream toggles on or off. Flutter's
implementation of these callbacks was modifying the set of enabled streams,
which could override the intended behavior of _setVMTimelineFlags.
Start/StopTracing will now only control Flutter's embedder-specific log.
Also needed to change the Flutter engine's --trace-startup flag to set the
corresponding timeline stream flag on the Dart VM.
The PlatformView may not receive the surfaceDestroy notification before its
activity is destroyed (this was happening on the Android emulator).
If this happens, allow the PlatformView to be detached and have it release
its window during destruction.
Dart has the tendency to call `exit()` on arbitrary threads. This causes
the assertion to trip. Since this should only happen when Dart is
running the shell in non-interactive mode, we leak the message loop
without proper shutdown.
We should never hit this path on iOS.
This patch cleans up the public Java interface to the Flutter engine. The code
that we intend to be re-usable is now in the io.flutter.view package. The two
public classes are:
* FlutterMain, which controls initialization of the system, and
* FlutterView, which is an Android view that hosts a Flutter app.
We'll need to interate on these interface over time, but at least these names
are more reasonable.
Currently there's no good way of synchronizing layout changes with children in
Mozart. Previously we flickered when we were out of sync with our child. Now we
jank instead because that's a more acceptable artifact while we work on
improving Mozart.
Fixes https://github.com/flutter/flutter/issues/3024