334 Commits

Author SHA1 Message Date
zljj0818
0ef14f3ca3 More rename from GPU thread to raster thread (flutter/engine#22819) 2020-12-03 15:03:02 -08:00
Kaushik Iska
9d46f7efef [embedder] Compositor can specify that no backing stores be cached (flutter/engine#22780) 2020-12-02 13:01:46 -06:00
stuartmorgan
79b158833b Add initial settings message to Windows embedding (flutter/engine#22323)
Sends the flutter/settings update message to the engine after starting
it. For now values other than 24-hour time preference are hard-coded,
but dark mode support can be added later.

Fixes https://github.com/flutter/flutter/issues/65590
2020-11-23 15:58:45 -08:00
gaaclarke
0901a93e5b started providing the GPU sync switch to external view embedders (flutter/engine#22302) 2020-11-17 18:43:01 -08:00
Dan Field
714fb9e81b Opt in fixutres (flutter/engine#22502) 2020-11-13 12:02:07 -08:00
Kaushik Iska
356e31aef5 Reland "remove surface dependance on external view embedder (#22468)" (flutter/engine#22470) 2020-11-12 15:37:12 -08:00
Jim Graham
2fc96daad5 Fix the event size parameters in the Embedder ComplexClip test (flutter/engine#22455) 2020-11-12 09:34:03 -08:00
Kaushik Iska
ae4dbc51b8 Reverts 2 commits that remove surface dependance on external view embedder (flutter/engine#22468)
* Revert "Remove GetExternalViewEmbedder from surface (#22272)"

This reverts commit 9dffddd08d0ad6fa7434c5a5bdff87e09da92e57.

* Revert "Rasterizer is initialized with an external view embedder (#22405)"

This reverts commit 417c869d6bcd70ba82fdd6efc8db1efa19fb997c.
2020-11-12 08:41:11 -08:00
Kaushik Iska
9dffddd08d Remove GetExternalViewEmbedder from surface (flutter/engine#22272)
This decouples surfaces from view embedders.
2020-11-11 13:45:24 -08:00
Kaushik Iska
8b9acb11b8 Move common graphics utils to //flutter/common/graphics (flutter/engine#22320) 2020-11-10 12:34:02 -08:00
Kaushik Iska
ea42f7eaa0 Platform views have CreateExternalViewEmbedder (flutter/engine#22214) 2020-11-06 05:30:48 -08:00
Daco Harkes
b6c5eff614 WeakPersistentHandle migration (flutter/engine#19843)
and roll Dart to 52783837369de45d3372cb6c6b7cdd63e71cd829.
2020-11-03 13:06:53 +01:00
stuartmorgan
ff1528235d Add a proc table version of embedder API (flutter/engine#21813) 2020-10-29 13:13:03 -07:00
Greg Spencer
06b6f8af89 Reland: Migration to PlatformDispatcher and multi-window (flutter/engine#21932)
This re-lands #20496 and #21780 after fixing the semantics-enabling code that was causing the post-submit web_smoke_test to fail.

Below is the description from the original PR:

This is a PR for converting the dart:ui code in the engine to use a multi-window API. The goal here is to convert from the window singleton to an API that has the concept of multiple windows. Also, I'm matching up the new PlatformDispatcher class to talk directly to the PlatformConfiguration class in the engine. I'm not attempting to actually enable creating multiple windows here, just migrate to an API that has a concept of multiple windows. The multi-window API in this PR currently only ever creates one window.

The design doc for this change is here.

The major changes in this PR:

Move the platfom-specific attributes out of Window, and into the new PlatformDispatcher class that holds all of the platform state, so that the platform code need only update the configuration on this class.
Create FlutterView, FlutterWindow, and SingletonFlutterWindow classes to separate out the concepts of a view (of which there may be multiple in a window), a window (of which there may be multiple on a screen, and they host views), and a window where there is only ever expected to be one (this hosts the entire API of the former Window class, and will eventually be the type of the window singleton).
Next step after this PR lands:

Remove the Window class entirely (it is replaced by SingletonFlutterWindow). Some minor changes in the Framework are needed to switch to using SingletonFlutterWindow directly first.

The Window class still exists in this PR, but will be removed as soon as the framework is converted to point to the SingletonFlutterWindow class instead. They share the same API, just have different names (Window is currently a subclass of SingletonFlutterWindow). The intention is that the Window name will be freed up to use as a widget class name in the framework for managing windows. The singleton called window will remain, and keep the same API it has now.
2020-10-22 14:54:25 -07:00
Chinmay Garde
288c5ee97d Ensure root isolate create callback is invoked before the isolate is in the running phase. (flutter/engine#22041)
Embedders that have access to the Dart native API (only Fuchsia now) may perform
library setup in the isolate create callback. The engine used to depend on the
fact the root isolate entrypoint is invoked in the next iteration of message
loop (via the `_startIsolate` trampoline in `isolate_patch.dart`) to ensure that
library setup occur before the main entrypoint was invoked. However, due to
differences in the way in which message loops are setup in Fuchsia, this
entrypoint was run before the callback could be executed. Dart code on Fuchsia
also has the ability to access the underlying event loops directly. This patch
moves the invocation of the create callback to before user dart code has a
chance to run. This difference in behavior on Fuchsia became an issue when the
isolate initialization was reworked in https://github.com/flutter/engine/pull/21820
for null-safety.

Another issue was discovered in that the callback was being invoked twice, I
fixed that too and added a test.

Fixes https://github.com/flutter/flutter/issues/68732
2020-10-21 15:57:10 -07:00
Chinmay Garde
db5c793ed5 Enable loading snapshots with sound null safety enabled. (flutter/engine#21820)
Snapshots compiled with sound null-safety enabled require changes to the way in
which isolates are launched. Specifically, the `Dart_IsolateFlags::null_safety`
field needs to be known upfront. The value of this field can only be determined
once the kernel snapshot is available. This poses a problem in the engine
because the engine used to launch the isolate at shell initialization and only
need the kernel mappings later at isolate launch (when transitioning the root
isolate to the `DartIsolate::Phase::Running` phase). This patch delays launch of
the isolate on the UI task runner till a kernel mapping is available. The side
effects of this delay (callers no longer having access to the non-running
isolate handle) have been addressed in this patch. The DartIsolate API has also
been amended to hide the method that could return a non-running isolate to the
caller.  Instead, it has been replaced with a method that requires a valid
isolate configuration that returns a running root isolate. The isolate will be
launched by asking the isolate configuration for its null-safety
characteristics.

A side effect of enabling null-safety is that Dart APIs that work with legacy
types will now terminate the process if used with an isolate that has sound
null-safety enabled. These APIs may no longer be used in the engine. This
primarily affects the Dart Convertors in Tonic that convert certain C++ objects
into the Dart counterparts. All known Dart Converters have been updated to
convert C++ objects to non-nullable Dart types inferred using type traits of the
corresponding C++ object. The few spots in the engine that used the old Dart
APIs directly have been manually updated. To ensure that no usage of the legacy
APIs remain in the engine (as these would cause runtime process terminations),
the legacy APIs were prefixed with the `DART_LEGACY_API` macro and the macro
defined to `[[deprecated]]` in all engine translation units. While the engine
now primarily works with non-nullable Dart types, callers can still use
`Dart_TypeToNonNullableType` to acquire nullable types for use directly or with
Tonic. One use case that is not addressed with the Tonic Dart Convertors is the
creation of non-nullable lists of nullable types. This hasn’t come up so far in
the engine.

A minor related change is reworking tonic to define a single library target.
This allows the various tonic subsystems to depend on one another. Primarily,
this is used to make the Dart convertors use the logging utilities. This now
allows errors to be more descriptive as the presence of error handles is caught
(and logged) earlier.

Fixes https://github.com/flutter/flutter/issues/59879
2020-10-16 14:53:26 -07:00
Chris Bracken
ef868edd36 Eliminate FLUTTER_NOLINT where possible (flutter/engine#21904)
This removes most of the remaining FLUTTER_NOLINT comments and opts
these files back into linter enforcement.

I've filed https://github.com/flutter/flutter/issues/68273 to require
that all FLUTTER_NOLINT comments be followed by a GitHub issue URL
describing the problem to be fixed.
2020-10-16 12:44:49 -07:00
Kaushik Iska
6109d23046 [embedder] Platform View owns lifecycle of external view embedder (flutter/engine#21847)
Changing it to shared_ptr and migrating the ownership from surface
to platform view.
2020-10-15 17:48:14 -07:00
Yuqian Li
0c645869e3 Revert "Migration to PlatformDispatcher and multi-window #20496" (flutter/engine#21792)
* Revert "Fix documentation build for window changes. (#21780)"

This reverts commit a539d91840d2fbbb4aa07eeed6a92d654db167ab.

* Revert "Migration to PlatformDispatcher and multi-window (#20496)"

This reverts commit a58fec63f196175eedfc5fbaedce9336dab5c508.
2020-10-12 19:26:41 -07:00
Greg Spencer
a58fec63f1 Migration to PlatformDispatcher and multi-window (flutter/engine#20496)
This is a PR for converting the dart:ui code in the engine to use a multi-window API. The goal here is to convert from the window singleton to an API that has the concept of multiple windows. Also, I'm matching up the new PlatformDispatcher class to talk directly to the PlatformConfiguration class in the engine. I'm not attempting to actually enable creating multiple windows here, just migrate to an API that has a concept of multiple windows. The multi-window API in this PR currently only ever creates one window.

The design doc for this change is here.

The major changes in this PR:

Move the platfom-specific attributes out of Window, and into the new PlatformDispatcher class that holds all of the platform state, so that the platform code need only update the configuration on this class.
Create FlutterView, FlutterWindow, and SingletonFlutterWindow classes to separate out the concepts of a view (of which there may be multiple in a window), a window (of which there may be multiple on a screen, and they host views), and a window where there is only ever expected to be one (this hosts the entire API of the former Window class, and will eventually be the type of the window singleton).
Next step after this PR lands:

Remove the Window class entirely (it is replaced by SingletonFlutterWindow). Some minor changes in the Framework are needed to switch to using SingletonFlutterWindow directly first.

The Window class still exists in this PR, but will be removed as soon as the framework is converted to point to the SingletonFlutterWindow class instead. They share the same API, just have different names (Window is currently a subclass of SingletonFlutterWindow). The intention is that the Window name will be freed up to use as a widget class name in the framework for managing windows. The singleton called window will remain, and keep the same API it has now.
2020-10-09 16:29:16 -07:00
George Wright
cc1041232c Add dart_entrypoint_argc/argv to the FlutterProjectArgs (flutter/engine#21737) 2020-10-09 16:17:02 -07:00
Chinmay Garde
6937ec8760 Avoid leaking the FlutterEngineAOTData structure in FlutterEngineCollectAOTData. (flutter/engine#21680) 2020-10-07 17:57:04 -07:00
David Worsham
71497dd042 embedder: Exclude GL code (flutter/engine#21544) 2020-10-01 12:20:10 -07:00
bungeman
fd93916c27 Replace kLegacyFontHost_InitType with kUnknown_SkPixelGeometry. (flutter/engine#21474)
Skia is removing the deprecated legacy display setting globals and
associated kLegacyFontHost_InitType. This change replaces all such uses
with default surface properties with no special flags and an unknown
pixel geometry. Flutter never set the associated globals, leaving them
with their initial default values, which were no special flags and
horizontal RGB pixel geometry. The values used here are different but
this change should make no difference as Flutter never mentions
SkFont::kSubpixelAntiAlias to take advantage of the pixel geometry.
2020-09-29 12:46:08 -04:00
Kaushik Iska
a5f4486147 Reland multiple display support for embedder API (flutter/engine#21464) 2020-09-28 12:35:34 -07:00
George Wright
67cfb02b18 Enable embedder_unittests on Fuchsia (flutter/engine#21418) 2020-09-28 11:12:02 -07:00
Kaushik Iska
bd90847bad Revert multiple display support for embedder API (flutter/engine#21456)
This reverts commits
- 5f34b8442366463b5ad53e3e87e7920a006392eb.
- fc8b468d84f1fef5bf5183dd0b36d9411d454ea7.

See: https://github.com/flutter/flutter/issues/66829
2020-09-28 09:46:46 -07:00
Kaushik Iska
5f34b84423 Embedder API Support for display settings (flutter/engine#21355)
Embedders can now notify shell during startup about the various displays and their corresponding settings.
Adds a notion of Display update type which can later include chages to displays during runtime such as addition / removal / reconfiguration of displays.

We also remove the responsibility of providing the refresh rate from `vsync_waiter` to `DisplayManager`.
Rewires existing platform implementations of the said API to use `Shell::OnDisplayUpdate` to notify the display manager of the startup configuration.

DisplayManager is also thread-safe to account for rasterizer and UI thread accesses.
2020-09-25 11:04:10 -07:00
George Wright
235133f27f Split out embedder_unittests test cases into GL and non-GL tests (flutter/engine#21386) 2020-09-24 17:02:01 -07:00
George Wright
0b0fe27af8 Do not create a TestGLSurface for software-only rendering in EmbedderTest (flutter/engine#21301) 2020-09-21 15:22:03 -07:00
George Wright
4375d79b8e Split out EmbedderTest{Context,Compositor} to handle software and GL separately (flutter/engine#20962) 2020-09-18 15:37:02 -07:00
Chris Bracken
2586db3b22 Clean up C++ includes (flutter/engine#21127)
Cleans up header order/grouping for consistency: associated header, C/C++ system/standard library headers, library headers, platform-specific #includes.

Adds <cstring> where strlen, memcpy are being used: there are a bunch of places we use them transitively.

Applies linter-required cleanups. Disables linter on one file due to included RapidJson header. See https://github.com/flutter/flutter/issues/65676

This patch does not cover flutter/shell/platform/darwin. There's a separate, slightly more intensive cleanup for those in progress.
2020-09-11 21:18:35 -07:00
Chris Bracken
9ff7d7ca44 Copyright header hygiene improvements (flutter/engine#21089)
Add copyright headers in a few files where they were missing.

Trim trailing blank comment line where present, for consistency with
other engine code.

Use the standard libtxt copyright header in one file where it differed
(extra (C) and comma compared to other files in libtxt).

This also amends tools/const_finder/test/const_finder_test.dart to look
for a const an additional four lines down to account for the copyright
header added to the test fixture.
2020-09-11 08:55:37 -07:00
Kaushik Iska
5e969b46ef [embedder] Add gl present callback that takes present info (flutter/engine#20672) 2020-08-26 15:53:01 -07:00
Chinmay Garde
15798a885b Fix race condition and data race in FrameInfoContainsValidWidthAndHeight. (flutter/engine#20706)
The data race: gl_surface_fbo_frame_infos_ in the test context to was appended
to on the raster task runner but read on the platform task runner. This is now
sidestepped by using a callback and pushing that responsibility to the test.
Setting the callback is guarded behind a mutex.

The race condition: The assertions were previously run when the UI thread was
done generating the frames. However, the assertions were run on the results
collected on the raster thread in response the frame requests from UI thread.
Just run the assertions on the raster thread directly.

Fixes https://github.com/flutter/flutter/issues/64344
2020-08-24 11:48:13 -07:00
Kaushik Iska
2021143b42 All shape related structs are together (flutter/engine#20665) 2020-08-20 15:21:02 -07:00
Kaushik Iska
a8c392e6b8 [embedder] Add FBO callback that takes frame info (flutter/engine#20617) 2020-08-19 16:06:02 -07:00
Dan Field
b43d17a5a3 Remove the dummy rasterizer delegate now that flutter_runner is in tree, and cleanup ctor params (flutter/engine#20486) 2020-08-13 14:46:01 -07:00
Greg Spencer
e994f832d2 Move platform specific information to PlatformConfiguration class (flutter/engine#19652) 2020-07-31 17:21:02 -07:00
Siva
03706dce89 Manual roll of Dart from 24c7666def...40fd1c456e (flutter/engine#20092)
* Manual roll of Dart from 24c7666def...40fd1c456e

dart-lang/sdk@40fd1c456e Revert "[dart:io] Add Abort() on HttpClientRequest"
dart-lang/sdk@17d7296a42 [vm/nnbd/bytecode] Fix reuse of type arguments in bytecode
dart-lang/sdk@58b6f40c73 Issue 42797. Understand in legacy libraries that a function returning Never (in Null Safety library) never returns. (reland)
dart-lang/sdk@fc8a6d9f9b [VM/compiler] Dereference TypeRef literal when propagating constants.
dart-lang/sdk@0689ec527a Move "test.dart" (well, most of its contents) into pkg/test_runner.
dart-lang/sdk@1094b3c61d Prepare static error test updater tool to handle web tests.
dart-lang/sdk@b258585f2f [observatory] Migrate from deprecated isInstanceOf to isA.
dart-lang/sdk@dfe1d9b682 Disable OverrideContributor for Cider.
dart-lang/sdk@aea99b2f5c scope debug property assist to Diagnosticables
dart-lang/sdk@4b96f20a79 [dart:io] Add Abort() on HttpClientRequest
dart-lang/sdk@1b1a39708c [build] Use frameworks instead of libs
dart-lang/sdk@3fef522496 Revert "Reland "[vm] Replaces fuchsia.deprecatedtimezone""
dart-lang/sdk@8c664d4f3f Revert "Issue 42797. Understand in legacy libraries that a function returning Never (in Null Safety library) never returns."
dart-lang/sdk@2efb5bebc7 [ dart:_http ] Fix typo in HTTP response timeline event
dart-lang/sdk@0884dae36c Revert "Fix the #include path for ICU headers"
dart-lang/sdk@5171534e81 Scope tweaks. Report REFERENCED_BEFORE_DECLARATION in more places.
dart-lang/sdk@6bba75079a Issue 42797. Understand in legacy libraries that a function returning Never (in Null Safety library) never returns.
dart-lang/sdk@b4ebbb7f5c [build] Update gn to match Fuchsia
dart-lang/sdk@cb428a7a02 [dart2js] Remove old bug work around in collector.
dart-lang/sdk@08663c20ab Change flutter patch to match existing DEPS on master branch
dart-lang/sdk@146ad014d9 update js/meta for the 2.10 dev sdk
dart-lang/sdk@488c718793 [co19] Roll co19 to d79951e06e443213243e54c2c32694b79a221b65
dart-lang/sdk@ba20edd7be Add patch for flutter-engine when changing to version 2.10

* Rev buildroot to latest version.

* Update license.

* update.

* Update gn revision.

* Format BUILD.gn files as the gn revision has been updated.
2020-07-29 13:10:15 -07:00
Adlai Holler
e5614964f4 Use the GrDirectContext factories instead of deprecated GrContext ones (flutter/engine#19962)
This is part of a larger effort to expose the difference between GrDirectContext,
which runs on the GPU thread and can directly perform operations like uploading
textures, and GrRecordingContext, which can only queue up work to be delivered
to the GrDirectContext later.
2020-07-28 13:32:09 -07:00
Emmanuel Garcia
da28c5954a bool SubmitFrame -> void SubmitFrame (flutter/engine#18984) 2020-07-23 16:16:02 -07:00
gaaclarke
ee0e1788d9 Made the linter print out more information in its output and fixed bugs (flutter/engine#19895) 2020-07-22 15:38:09 -07:00
Gary Qian
ef7f2900f2 Desktop embedder ComputePlatformResolvedLocale entrypoint (flutter/engine#19597) 2020-07-16 04:48:02 -07:00
David Worsham
cfa8f4e1a8 Fix Mac / iOS builds (flutter/engine#19728) 2020-07-13 18:34:49 -07:00
David Worsham
cbd3cd9c0d fuchsia: Enable most unittests (flutter/engine#19583)
Tweak the primary flutter build rule so that fuchsia is more similar to
other platforms in how tests and the shell are built.

Only embedder_unittests and GLFW tests are disabled on Fuchsia now.

TEST: Ran unittests on host/fuchsia; workstation on fuchsia
BUG: fxb/53847, fxb/54056
2020-07-13 17:36:19 -07:00
Robert Ancell
2c9a7e1cd7 Fix documentation of unset platform view ID (flutter/engine#19320) 2020-07-10 11:17:14 +12:00
Kaushik Iska
8818677dfd Track motion events for reuse post gesture disambiguation (flutter/engine#19484)
This change makes it so that we track all the motion events encountered by `FlutterView` and all of its subviews in the `MotionEventTracker` class, indexed by a unique `MotionEventId`. This identifier is then passed to the Flutter framework as seen in https://github.com/flutter/flutter/pull/60930. Once the gestures take part in gesture disambiguation and are sent back to the engine, we look-up the original motion event using the `MotionEventId` and dispatch it to the platform.

Bug: https://github.com/flutter/flutter/issues/58837
2020-07-06 22:22:37 -07:00
Chris Yang
b64c39e512 Reland "Add GetBoundingRectAfterMutations to EmbeddedViewParams to calculate the final bounding rect for platform view #19170" (flutter/engine#19212) 2020-06-22 15:10:02 -07:00
Brian Osman
4b38b0942d Revert "Add GetBoundingRectAfterMutations to EmbeddedViewParams to calculate the final bounding rect for platform view (#19170)" (flutter/engine#19204)
This reverts commit 3b375b719da4ce1ff0c5c1b820c6b5aafd5dba1e.
2020-06-22 07:30:59 -04:00