628 Commits

Author SHA1 Message Date
Loïc Sharma
a9e12287f6 [dart:ui] Introduce PlatformDispatcher.implicitView (flutter/engine#39553)
This introduces `PlatformDispatcher.implicitView`, a low-level primitive for the framework's bootstrapping. Most code, including the framework after bootstrapping, will use `View.of(context)` instead of this new API. This new primitive will let us deprecate the `window` global.

Goals:

1. **Enable multi-window**. The `PlatformDispatcher.implicitView` is nullable. If `null`, the app must create a window to get a view it can draw into.
2. **Backwards compatibility**. For "single window" apps, `PlatformDispatcher.instance.implicitView` should behave as similar to `window` as possible.
    1. The `PlatformDispatcher.instance.implicitView.viewId` should be `0`.
    1. The `PlatformDispatcher.instance.implicitView` must be available synchronously at root isolate startup. This allows the framework to determine if it can make single window assumptions at startup.
    2. The `PlatformDispatcher.instance.implicitView` reference must not change after startup: if it is null at startup, it must always be null; if it is non-null at startup, it must always be non-null. If "single window" app enters headless mode, the implicit view must remain non-null.

In the future, the embedder will control whether an implicit view is created: mobile & legacy desktop apps will have an implicit view, multi-window desktop apps won't have an implicit view. This requires updating the engine's embedder API and is out-of-scope for this change. For now, all apps will have an implicit view.

Part of https://github.com/flutter/flutter/issues/120306
2023-02-16 16:32:14 -08:00
Jason Simmons
5f09e0fdf0 Remove Libtxt and Minikin (flutter/engine#39499) 2023-02-13 17:16:04 +00:00
Loïc Sharma
c6f9e5cebd [Shell] Update stale comments after multi-view (flutter/engine#39298) 2023-01-31 23:58:10 +00:00
Ben Konyi
d3f45828bf Reland "Remove references to Observatory (#38919)" (flutter/engine#39139)
This reverts commit 5dd945442b230a2c0549ee6d798fda71e031a4a9.
2023-01-30 09:50:09 -05:00
Ahmed Ashour
51c0a9ec65 Remove superfluous words from comments (flutter/engine#39068)
* Remove superfluous words.

* Format

* Duplicate in consecutive lines.
2023-01-24 09:54:19 -08:00
Ben Konyi
002fce29e0 Revert "Remove references to Observatory (#38919)" (flutter/engine#39035)
Reason for revert: breaking Flutter -> plugins roll

This reverts commit 1f603711c7b7afe52dff3872a5035789e3ddba02.
2023-01-20 12:33:40 -05:00
Ben Konyi
1f603711c7 Remove references to Observatory (flutter/engine#38919)
Observatory is being deprecated for Dart 3.0 so it should no longer be referenced in tooling messaging / flags.

See https://github.com/dart-lang/sdk/issues/50233
2023-01-19 09:20:46 -05:00
Chris Bracken
dc3033d922 Clarify semantics action dispatch id parameter (flutter/engine#38356)
Previously the embedder API documented this as an action ID, but it's
actually the semantics node ID. This fixes the docs and renames the
parameter to clarify its purpose.

This callback is registered in the framework render bindings:
9102f2fe0b/packages/flutter/lib/src/rendering/binding.dart (L43)

Handled by `_handleSemanticsAction`:
9102f2fe0b/packages/flutter/lib/src/rendering/binding.dart (L360-L366)

Which invokes `SemanticsOwner.performAction`, where the node is looked up by ID:
9102f2fe0b/packages/flutter/lib/src/semantics/semantics.dart (L3258-L3277)
2022-12-16 13:40:48 -08:00
Dan Field
020577edbb Make NotifyIdle reject close and past deadlines. (flutter/engine#37737)
This patch also eliminates some extraneous tracing that is happening
every frame. It is possible to get the same trace calls by enabling
the API stream if needed.

Also refactors the NotifyIdle callsites to just always work in
TimeDeltas rather than converting back and forth between them and
TimePoints, which I think reads more clearly.
2022-11-18 18:17:53 +00:00
Siva
7296b2b66d Add call to Dart_NotifyDestroyed when the flutter view is destroyed. (flutter/engine#37539)
* Add calls to Dart_NotifyDestroyed when the flutter view is destroyed.

* Add unit test case.

* Format.

* Ensure the destroy task runs.

* Address code review comments.
2022-11-17 13:11:21 -08:00
Kaushik Iska
ca224262c5 Do not call Dart_NotifyIdle when in Dart_PerformanceMode_Latency (flutter/engine#37499) 2022-11-10 21:28:38 -05:00
Martin Kustermann
725ac26098 Remove usages of deprecated old native "<name>" syntax. (flutter/engine#37104)
The old native "<name>" syntax is being replaced with external functions that
have a @pragma("external-name", "<name>").

See https://github.com/dart-lang/sdk/issues/28791
2022-10-28 12:30:44 +02:00
gaaclarke
cb4c9f4727 Clang-tidy: made verbose print out commands and fixed quoting problem for warnings as errors (flutter/engine#37015) 2022-10-26 08:19:12 +00:00
Dan Field
181a1728f1 Always use fml::TaskRunnerAffineWeakPtr for SnapshotDelegate (flutter/engine#36772) 2022-10-14 18:09:29 -07:00
Jonah Williams
aadc2d3094 Add ImmutableBuffer.fromFilePath (flutter/engine#36623) 2022-10-05 22:18:03 +00:00
gaaclarke
e41c775200 Removed instances of unnecessary values (flutter/engine#36221) 2022-09-26 21:28:04 +00:00
Dan Field
63e8e223aa [Impeller] toImageSync for Impeller (flutter/engine#36365) 2022-09-23 20:31:03 +00:00
gaaclarke
b5f7f557ac Made sure to call the plugin registrant when registering a background isolate (flutter/engine#36383) 2022-09-23 18:36:09 +00:00
Dan Field
08312a825e Lint and fix bugprone-use-after-move violations (flutter/engine#35978) 2022-09-09 02:41:03 +00:00
gaaclarke
42c469183e Started handling messages from background isolates for iOS (flutter/engine#35174) 2022-09-08 00:03:27 +00:00
Dan Field
7cea2d1361 Try to deflake service isolate startup (flutter/engine#35950) 2022-09-06 13:26:49 -07:00
yaakovschectman
8e3c8bc88f Engine startup event timed after VM initializes (flutter/engine#35713)
* Engine startup event timed after VM initializes

* Formatting

* Update FlutterEngineMainEnter event comment

* Remove engine_start_time

* Remove unused variable
2022-08-31 10:48:44 -04:00
Jonah Williams
27b4f29d7e Include TextureLayer in contents of toImageSync (flutter/engine#35608) 2022-08-23 02:16:06 +00:00
Casey Hillers
1c20221e24 Revert "Include TextureViews in the output of Scene.toImage[Sync]" (flutter/engine#35587) 2022-08-22 10:26:09 +00:00
Jonah Williams
ed952f4503 Include TextureViews in the output of Scene.toImage[Sync] (flutter/engine#35527)
Update Picture rasterization for toImage to accept a layer tree, optionally flattening on the raster thread if present.
Update Deferred GPU image for toImageSync to accept a layer tree, flattening it the first time it creates an image, storing the resulting display list.

This is also a performance fix for the zoom page transition, which currently does too much work on the UI thread on frame 1
2022-08-19 16:28:30 -07:00
Jonah Williams
1245043020 Support hot reload of asset fonts (flutter/engine#35213) 2022-08-08 18:06:05 +00:00
Dan Field
a41257c563 Reland "dart:ui conversion from native to FfiNative" (#33116)" (flutter/engine#34700)
* Reland "dart:ui conversion from native to FfiNative" (#33116)"

This reverts commit d85395558f3d72c64d9c75e00c6ebdd5bf4583e3.

Resolves merge conflicts and updates modified/newly added
methods, and fixes the incorrect argument counts
on some of the Path methods.
2022-07-18 15:51:07 -07:00
ColdPaleLight
e1fe7327b1 Use the correct 'SnapshotDelegate' in 'RuntimeController::Spawn' (flutter/engine#34523) 2022-07-13 01:09:04 +00:00
Bernardo Eilert Trevisan
a08a568e0a Relanded "Implement support for explicit specification of JIT snapshots (#34244)"
This reverts commit b989d4723510771017ef598403a2366a8f1bcac7.
2022-07-08 15:19:30 -04:00
Jason Simmons
b989d47235 Revert "Implement support for explicit specification of JIT snapshots (#34244)" (flutter/engine#34517)
This reverts commit 042ee2546c1569850f628e33e34385299e2df3c7.
2022-07-07 16:59:07 -07:00
Bernardo Eilert Trevisan
042ee2546c Implement support for explicit specification of JIT snapshots (flutter/engine#34244) 2022-07-07 22:48:05 +00:00
Dan Field
0586f7b588 Drop --enable-display-list flag, remove associated branched code (flutter/engine#34233) 2022-06-23 00:07:04 +00:00
Chris Bracken
53a9648da9 [lint] Merge impeller .clang-tidy into main config (flutter/engine#33692)
Merges most (but not all) of the impeller .clang-tidy rules into the
main .clang-tidy config. Merges:

readability-identifier-naming.PrivateMemberSuffix (_)
readability-identifier-naming.EnumConstantPrefix (k)
modernize-use-default-member-init.UseAssignment
Does not merge:

readability-identifier-naming.PublicMethodCase (CamelCase)
readability-identifier-naming.PrivateMethodCase (CamelCase)
These last two are not merged due to the non-trivial number of existing
field accessors that use field_name() methods to directly return
field_name_. While these are permitted by the C++ style guide, we may
want to move to a single, simple rule and name everything in CamelCase.
These can be enabled in a followup patch.

No new tests added, since this change is style-only.
2022-06-21 11:52:42 -07:00
Alexander Markov
8292927857 Remove uses of --lazy-async-stack Dart VM flag (flutter/engine#33964) 2022-06-10 10:12:56 -07:00
Chris Bracken
56fbdd0232 [lint] Enforce k prefix for global constants (flutter/engine#33666)
Enforces that all global constants are prefixed with a 'k' as per the
style guide and updates the codebase into conformance where necessary.

This does not change any public API.

Additional testing provided by the addition of the lint rule.

Ref: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#begin-global-constant-names-with-prefix-k
2022-05-27 18:33:38 -07:00
Zachary Anderson
00607f96ea Reland: Roll clang and buildroot (flutter/engine#33339) 2022-05-14 06:04:14 -07:00
Jonah Williams
8aef5df7b1 Add support for loading asset directly from ImmutableBuffer (flutter/engine#32999) 2022-05-10 19:39:04 -07:00
Chris Bracken
09285aac02 Use empty in place of size checks vs 0 (flutter/engine#33151) 2022-05-06 13:09:04 -07:00
Chris Bracken
1af24ccf62 Set Platform.executable on startup (flutter/engine#33127)
Previously, using Platform.executable (from dart:io) returned null (if
non-null-by-default was disabled) or threw an exception (if NNBD was
enabled) since we weren't setting it.

We now pass the executable name to Dart during VM startup based on the
first value in the FlutterProjectArgs::command_line_argv array passed to
FlutterEngineRun (or FlutterEngineInitialize) on startup. argv[0] (if
specified) is explicitly documented as being required to be the
executable name in embedder.h. In the case where no argv[0] is
specified, we instead set Platform.executable to "Flutter" in order to
avoid violating the (non-nullable) type annotation on
Platform.executable.

Note that dart::bin::SetExecutableName() does NOT make a copy of the
input string, so that value needs to be available for the entire lifetime
of the VM.

This also adds EmbedderConfigBuilder::SetExecutableName() to support
setting a fake executable name in unittests. By default, we continue to
set the name "embedder_unittest" unless overridden using this method.

See: https://api.flutter.dev/flutter/dart-io/Platform/executable.html
See: https://github.com/dart-lang/sdk/issues/48427

Issue: https://github.com/flutter/flutter/issues/83921
2022-05-05 11:14:16 -07:00
Zachary Anderson
d85395558f Revert "dart:ui conversion from native to FfiNative" (flutter/engine#33116) 2022-05-04 16:24:06 -07:00
Clement Skau
ca1dc06bc1 dart:ui conversion from native to FfiNative (flutter/engine#29607) 2022-05-04 09:29:05 -07:00
Zachary Anderson
524c17fcab Add a dart:ui-internal flag to check if impeller is enabled (flutter/engine#33040) 2022-05-03 11:27:07 -07:00
Zachary Anderson
a5caec7780 Delete DartIsolateTest::ValidLoadingUnitSucceeds (flutter/engine#32970) 2022-04-27 16:09:04 -07:00
Dan Field
5c27c4acbf Avoid calling Dart_TimelineGetMicros when systrace is enabled (flutter/engine#32968) 2022-04-27 14:59:03 -07:00
Ryan Macnak
393e331f6f Set the VM's file callbacks. (flutter/engine#32837)
These are used to output various tracing enabled by VM flags.
2022-04-26 15:06:03 -07:00
Jason Simmons
d9de6d31cf Disable the timeline in release mode on Android unless systrace is enabled (flutter/engine#32909) 2022-04-26 10:54:03 -07:00
Dan Field
f51504259a Do not depend on Dart in FML (flutter/engine#32846) 2022-04-21 19:22:45 -07:00
Dan Field
9e46531319 Remove redundant trace events (flutter/engine#32812) 2022-04-21 13:28:03 -07:00
Kaushik Iska
d8e73006e0 Add service protocol method to facilitate getting snapshots (flutter/engine#32628) 2022-04-13 13:39:05 -07:00
Dan Field
4101b52aca Unify unhandled error reporting, add PlatformDispatcher.onError (flutter/engine#32078) 2022-04-09 14:44:04 -07:00