Flutter's accessibility APIs consist of three main calls from the
embedder to the Dart application:
1. FlutterEngineUpdateSemanticsEnabled: enables/disables semantics support.
2. FlutterEngineUpdateAccessibilityFeatures: sets embedder-specific
accessibility features.
3. FlutterEngineDispatchSemanticsAction: dispatches an action (tap,
long-press, scroll, etc.) to a semantics node.
and two main callbacks triggered by Dart code:
1. FlutterUpdateSemanticsNodeCallback: notifies the embedder of
updates to the properties of a given semantics node.
2. FlutterUpdateSemanticsCustomActionCallback: notifies the embedder
of updates to custom semantics actions registered in Dart code.
In the Flutter framework, when accessibility is first enabled, the
embedder will receive a stream of update callbacks notifying the
embedder of the full semantics tree. On further changes in the Dart
application, only updates will be sent.
The shell was already designed to cleanly shut down the VM but it couldnt
earlier as |Dart_Initialize| could never be called after a |Dart_Cleanup|. This
meant that shutting down an engine instance could not shut down the VM to save
memory because newly created engines in the process after that point couldn't
restart the VM. There can only be one VM running in a process at a time.
This patch separate the previous DartVM object into one that references a
running instance of the DartVM and a set of immutable dependencies that
components can reference even as the VM is shutting down.
Unit tests have been added to assert that non-overlapping engine launches use
difference VM instances.
This does several things:
- It adds CPU time on the IO thread, but avoids GPU time on the GPU
thread.
- For images that are never drawn with mipmaps, it adds about 33%
memory overhead. For images that are drawn with mipmaps, it saves
an entire copy of the base level.
- It fixes https://github.com/flutter/flutter/issues/24517, which is
a driver bug related to mip-mapping and cross-context images.
Overall, I think the tradeoff is good, but I'm curious to see what
benchmarks look like.
`MultiFrameCodec` now uses whatever previously cached required frame is
available instead of panicking if it doesn't have the exact frame
requested by `SkCodec::FrameInfo#fRequiredFrame`.
`SkCodec::FrameInfo#fRequiredFrame` doesn't point to the one and only
frame that's required to decode the given frame. It points to the latest
frame that's disposal method none and filling a greater surface area
than the current frame. The last required frame `MultiFrameCodec` has
actually cached is also valid in these cases and can be supplied as
`fPriorFrame` instead. [flutter/flutter#26757](https://github.com/flutter/flutter/issues/26757#issuecomment-459522530)
has a more detailed explanation.
Fixesflutter/flutter#26757
This reverts commit 25559ed0779604d56c47c5d2341ffd16b137cd10.
Reason for revert: broken in AOT mode.
@pragma('vm:entry-point') placed on a function only instructs
the compiler to retain the function itself, but does not tell
compiler to generate and retain tear-off for this function.
In this PR _runMainZoned was marked as an entry-point but C++
code was trying to tear it off and use a closure, instead of
invoking it directly, which is not supported.
Reuses the implementation that was previously done for Scene.toImage
(see 20c805c973)
This introduces a breaking API change:
Picture.toImage is now asynchronous and returns a Future<Image>
Fixes https://github.com/flutter/flutter/issues/23621
* Update GetCallbackHandle to use Dart_IsTearOff instead of a string
comparison to determine whether or not a closure was provided as an
argument to PluginUtilities.GetCallbackHandle.
Fixes#24394
Previously codec.cc needed all required frames to already be decoded
before it could decode any of their dependent frames. To accomplish this
it would always cache required frames, regardless of cache limit.
However both GIF and WEBP (the only currently supported animated image
formats) only allow the image to depend on one decoded frame at a time.
This means that there's no reason to cache all the required frames since
it's only valid for the image formats to require one previously decoded
frame at a time. (For example, frame 10 and frame 11 in a hypothetical
animated image could all depend on frame 9. But no subsequent frame
after frame 9 could depend on frames 0-8.)
Frames are always added to the cache as long as they're under the limit,
and never removed. Required frames are always stored as a separate
member on `MultiFrameCodec`.
Warning: this logic will break if we decide to support more animated
formats in the future.
Fixesflutter/flutter#24835.
* Support user-provided font-fallback.
* Use tonic to pass to native
* Handle font families as a fallback vector in LibTxt
* Fix docs
* Concatentate fontFamily lists in dart before passing to engine
* Fix formatting
* Reworked font family matching to search all managers
* Fix formatting
* Proper toString null checking to keep format consistent
* Formatting
* Move _listEquals out of textstyle as it is not specific to TextStyle and will later be used for paragraphStyle too
* Clarify TextAffinity docs
* Clarify TextPosition and the definition of upstream/downstream
* Docs fixes from code review, less redundant with 'string in code'
This PR replaces the unused `PrerollContext::child_paint_bounds` with `PrerollContext::cull_rect` so we can prune unnecessary preroll tasks (especially cache) based on clips. This PR fixes https://github.com/flutter/flutter/issues/24712
Performance test has been added (https://github.com/flutter/flutter/pull/25381) to make sure that we won't regress again in the future.
Note that the cull_rect here is very similar to those removed in https://github.com/flutter/engine/pull/6352 . We can't compute cull rects in SceneBuilder because of retained layers. But we can still compute and use them to optimize performance in Preroll.