95 Commits

Author SHA1 Message Date
Chris Bracken
0d1a8035df Provide batching for semantics updates (flutter/engine#7988)
Some embedders prefer to minimise the number of semantics node/custom
action updates sent back to the host platform -- for example due to
expensive serialisation mechanisms, etc.

This patch provides a 'batch end' signal that provides embedders with an
indication of when a self-consistent set of semantics node or custom action
updates have been sent.

We overload the node/action ID with information that conveys a batch end
by using an ID (-1) that is never allotted to semantics nodes by the
framework.
2019-02-27 12:12:45 -08:00
Ben Konyi
0669ddc849 Link dart:* sources into engine for debugger source support (flutter/engine#7908)
Link dart:* sources into engine for debugger source support

Currently, dart:* libraries appear to have no source in
debuggers like Observatory. With this change, these sources will be
available in debug mode applications. Sources for dart:* libraries are
lazily loaded on a script-by-script basis.

Refer to https://dart-review.googlesource.com/c/sdk/+/93375 for the Dart
SDK change.
2019-02-26 13:28:04 -08:00
Chris Bracken
92397389c1 Correct FlutterSemanticsNode member name style (flutter/engine#7942)
Correct struct members whose names were camelCase rather than
snake_case. This is a breaking API change, but does not break ABI.
2019-02-24 22:33:55 -08:00
Chinmay Garde
d0f9af0324 Allow embedders to specify a vsync waiter. (flutter/engine#7914)
Fixes https://github.com/flutter/flutter/issues/28240
2019-02-21 23:02:32 -08:00
Chinmay Garde
8d12a45c6a Allow embedders to add events to the timeline. (flutter/engine#7917)
Fixes https://github.com/flutter/flutter/issues/28283
2019-02-21 22:42:49 -08:00
Jason Simmons
4290d0349c Embedder API for setting the persistent cache path (flutter/engine#7915)
Fixes https://github.com/flutter/flutter/issues/28278
2019-02-21 17:30:17 -08:00
Chris Bracken
b9ceb3090d Add accessibility semantics support to embedder (flutter/engine#7891)
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.
2019-02-20 18:59:29 -08:00
Chinmay Garde
c37c0d78b0 Respect the custom GL proc table when creating the resource context on the IO thread. (flutter/engine#7893)
Fixes https://github.com/flutter/flutter/issues/28229
2019-02-20 17:23:14 -08:00
stuartmorgan
7524aa2d8c Expose more pointer phases in embedder.h (flutter/engine#7813)
Adds 'add', 'remove', and 'hover' to the set of pointer phases that are
available to embedders. This is necessary for them to send hover events
to the engine.
2019-02-19 07:06:57 -08:00
Jason Simmons
a0f4916009 Remove the Dart JIT snapshot data from AOT builds of the embedder library (flutter/engine#7806)
Also extend the embedder unit tests to cover AOT execution
2019-02-15 09:43:23 -08:00
nathanrogersgoogle
7517ae90c3 Add flow events connecting pointer events to frames (flutter/engine#7807) 2019-02-13 22:27:12 -08:00
Chinmay Garde
8d53a804f3 Allow embedders to specify pointer device IDs. (flutter/engine#7790) 2019-02-11 16:49:45 -08:00
Chinmay Garde
46842b5f57 Update documentation for command line args in FlutterProjectArgs. (flutter/engine#7733) 2019-02-07 14:14:44 -08:00
Chris Bracken
7ff50beb59 Add FlutterProjectArgs::root_isolate_create_callback (flutter/engine#7651)
Allows embedders to specify a callback to be invoked in isolate scope
once root isolate has been created and marked runnable.

As an example of where this is useful, embedder unit test fixtures may
want to include Dart functions backed by a native implementation. On
isolate creation, this patch allows the unit test author to call
Dart_SetNativeResolver in root isolate scope.
2019-02-06 14:16:47 -08:00
Chris Bracken
03b5b4a509 Fix two typos in embedder docs (flutter/engine#7649) 2019-01-30 18:11:08 -08:00
Chinmay Garde
f7b24f4d90 Document make_resource_current on FlutterOpenGLRendererConfig and warn if the callback is not set. (flutter/engine#7648) 2019-01-30 16:13:00 -08:00
stuartmorgan
9292896011 Rename FlutterResult in embedder.h (flutter/engine#7567)
FlutterResult is also the name of a class in the Objective-C API
surface, which is problematic when building a framework that contains
both (such as a macOS implementation of the Flutter framework).
2019-01-29 14:01:31 -08:00
Chinmay Garde
1d7eebcc1b [embedder] Avoid looking for the kernel binary in AOT builds. (flutter/engine#7577) 2019-01-24 14:22:39 -08:00
Brian Osman
3dd1198f0d Remove SkColorSpaceXformCanvas, use color-managed SkSurfaces instead (flutter/engine#7548)
Behavior (visual) changes should be very minor. Things that are to be expected:
* A few things were not color managed correctly by the transform canvas (color emoji, some color filters). Those will be handled correctly with the tagged surfaces (although we're always transforming to sRGB, so nothing should change until we target a wider gamut).
* Image filtering will happen in the source color space, rather than the destination. Very minor.
* The transform canvas did caching of images in the destination color space. Now, the conversion happens at draw time. If there are performance issues, images can be pre-converted to the destination with makeColorSpace().
2019-01-22 15:34:51 -05:00
Chinmay Garde
1f528fef75 Allow embedders to specify AOT snapshot buffers. (flutter/engine#7538) 2019-01-18 16:32:35 -08:00
Chinmay Garde
00fc057d88 Configure the embedder in AOT in "profile" and "release" runtime modes. (flutter/engine#7533) 2019-01-18 12:24:21 -08:00
Chris Bracken
86d1e4f835 Deprecate FlutterProjectArgs.main_path, packages_path (flutter/engine#7497)
As of Dart 2, running from Dart source is no longer supported.  Dart
code should now be compiled to kernel form and will be loaded by from
kernel.blob in the assets directory. We retain the struct members for ABI
stability. package_path is also not required since kernel blobs are
self-contained.
2019-01-16 12:47:39 -08:00
KyleWong
8c111d9e25 Edit the bundleid so that it conform to UIT specifications. (flutter/engine#7503) 2019-01-16 11:35:39 -08:00
Chinmay Garde
1aa19e022b Wire up support for external OpenGL textures for the embedder. (flutter/engine#7087) 2019-01-09 15:21:39 -08:00
Chris Bracken
fff4720f2c Verify RunConfiguration is valid before running (flutter/engine#6922)
In cases where a valid IsolateConfiguration cannot be inferred, (e.g.,
settings.kernel_list_asset is missing) RunConfiguration can be created
with a null IsolateConfiguration. In such cases, bail out early with
kInvalidSettings.

Also adds a redundant paranoid check to EmbedderEngine::Run.
2018-12-16 14:07:42 -08:00
Chris Bracken
8a0cc94b1a Compile embedder unit test Dart to kernel (flutter/engine#7231)
As of the migration to Dart 2, it has been necessary to compile Dart to
kernel prior to execution. The embedder currently requires that the
resulting kernel file be named `kernel_blob.bin` and be located at the
root of the assets directory passed to the embedder API.

This patch updates the test_fixtures build rule to perform a kernel
compile using frontend_server, outputting `kernel_blob.bin` to
`fixtures/test_target_name` directory, and updates the embedder
unittests to specify the kernel file rather than the Dart source file.

Since the kernel compiler requires a `main()` function to be defined, it
also updates `simple_main.dart` from runtime_unittests to define
`main()` rather than `simple_main()`.

This also updates all existing sub-targets to be testonly.

This relands commit 4e4fb4608da95d198b0e796478462285ab974a3c, which was
reverted in commit 566db0ecb8f293bb9f7ff1fc39076b08336e0148. Rather than
running as prebuilt_dart_action, we use dart_action to ensure the
frontend snapshot it compatible with the VM on which it's executed.
2018-12-16 12:23:18 -08:00
Chris Bracken
566db0ecb8 Revert "Compile embedder unit test Dart to kernel (#7227)" (flutter/engine#7230)
This reverts commit 4e4fb4608da95d198b0e796478462285ab974a3c.

This broke dynamic release mode builds of
//flutter/runtime:runtime_fixtures_kernel (likely all product-mode
builds).
2018-12-15 14:43:26 -08:00
Chris Bracken
4e4fb4608d Compile embedder unit test Dart to kernel (flutter/engine#7227)
Compile embedder unit test Dart to kernel

As of the migration to Dart 2, it has been necessary to compile Dart to
kernel prior to execution. The embedder currently requires that the
resulting kernel file be named `kernel_blob.bin` and be located at the
root of the assets directory passed to the embedder API.

This patch updates the test_fixtures build rule to perform a kernel
compile using frontend_server, outputting `kernel_blob.bin` to
`fixtures/test_target_name` directory, and updates the embedder
unittests to specify the kernel file rather than the Dart source file.

Since the kernel compiler requires a `main()` function to be defined, it
also updates `simple_main.dart` from runtime_unittests to define
`main()` rather than `simple_main()`.

This also updates all existing sub-targets to be testonly.
2018-12-15 13:59:58 -08:00
Chris Bracken
120c20d5c6 Eliminate main_dart_file_path, package_file_path (flutter/engine#6973)
These settings were specific to Dart 1 and are no longer used in the
engine. This eliminates them from the Settings class.
2018-12-10 09:12:10 -08:00
Chris Bracken
a962e06150 Use software renderer in embedder unittests (flutter/engine#6928)
Reduces spurious error log messages in GLContextMakeCurrent() attempting
set up the GR context:

  [ERROR:flutter/shell/gpu/gpu_surface_gl.cc(42)] Could not make the context current to setup the gr context.
2018-11-26 10:48:37 -08:00
Mehmet Fidanboylu
e8d852bac0 Skia Cleanup (flutter/engine#6786) 2018-11-07 15:29:52 -08:00
Michael Goderbauer
0def82ddb0 Unify copyright lines (flutter/engine#6757) 2018-11-07 12:24:35 -08:00
Chinmay Garde
ddd0b8887a Handle Windows headers defining ERROR to 0 in log levels. (flutter/engine#6677) 2018-10-26 16:47:14 -07:00
Chinmay Garde
967db4ff80 Fix mac builds. Only Linux and Windows require default GL proc resolvers. (flutter/engine#6641) 2018-10-23 10:46:14 -07:00
James Clarke
a378ba2223 Fix Windows embedding. Appears that #6523 or #6525 introduced a bug for embedder scenarios causing the window native library to be incorrectly initialized and thus incapable of correctly resolving GL functions. This change fixes that. (flutter/engine#6624) 2018-10-23 09:47:53 -07:00
Chinmay Garde
568c930594 Allow specifying custom toolchains and sysroots for host builds. (flutter/engine#6548)
Updates buildroot to https://github.com/flutter/buildroot/pull/180.
2018-10-15 14:18:02 -07:00
Jason Simmons
52acaa8b5e Fix the Mac embedder build (flutter/engine#6525) 2018-10-12 16:24:54 -07:00
Jason Simmons
0a6f678613 Provide a default GL function resolver in the embedder (flutter/engine#6523)
Also check whether the implementation behind the resolver is OpenGL or
OpenGL ES
2018-10-12 15:07:46 -07:00
Ben Konyi
af54a8129e Dart SDK roll for 2018-09-28 (flutter/engine#6388) 2018-09-28 18:02:04 -07:00
Chinmay Garde
74c44fa72a Wire up the Skia persistent GPU related artifacts cache. (flutter/engine#6278)
Also teaches FML to create files and directories.
2018-09-26 14:54:09 -07:00
Dan Field
89eeaf461e Engine::Run returns enum: success, failure, or isolate already running (flutter/engine#6324)
* If isolate is already running, return true

* Use shell::Engine::RunStatus as result of Engine::Run
2018-09-24 18:01:22 -04:00
Ryan Macnak
a6d25b895c Reapply "Some cleanups enabled by removing support for Dart 1" (flutter/engine#6250)
Following fixes in dart-lang/sdk@91cbb57cd5
2018-09-14 09:36:13 -07:00
Michael Goderbauer
d6ba11b0c1 Revert "Reapply "Some cleanups enabled by removing support for Dart 1" (#6216)" (flutter/engine#6232)
This reverts commit 88aac222998fac4a7c0e57e99c48feacefc92aa6.
2018-09-12 12:07:20 +02:00
Ryan Macnak
88aac22299 Reapply "Some cleanups enabled by removing support for Dart 1." (flutter/engine#6216)
- Add missing Dart 2 flags to gen_snapshot invocation.
 - Disable brittle service test.
2018-09-10 17:03:54 -07:00
Chinmay Garde
a5b08f7295 Allow embedders to specify a custom GL proc address resolver. (flutter/engine#6204)
This updates the embedder API but introduces no breaking ABI/API
changes.
2018-09-07 18:25:38 -07:00
Ryan Macnak
75e10e3845 Revert "Some cleanups enabled by removing support for Dart. (#5621)" (flutter/engine#6205)
This reverts commit e05d573589bded526e9acf44128e35151d142b7e.
2018-09-07 17:39:51 -07:00
Ryan Macnak
e05d573589 Some cleanups enabled by removing support for Dart. (flutter/engine#5621)
- Switch core snapshot to Dart 2 and remove support for loading platform.dill.
 - Remove support for loading script snapshots.
 - Remove support for loading source.
 - Remove settings and fix names to reflect the above.
 - Remove support for loading the service isolate from source.
2018-09-07 15:44:46 -07:00
Chinmay Garde
7be525a816 Fix windows embedder builds. (flutter/engine#6137) 2018-08-31 20:23:53 -07:00
Chinmay Garde
f2049c7687 Allow embedders to specify software renderer configs. (flutter/engine#6133) 2018-08-31 20:03:06 -07:00
Chinmay Garde
1fcba44904 Allow embedders to set the root surface transformation. (flutter/engine#6085) 2018-08-28 14:13:49 -07:00