988 Commits

Author SHA1 Message Date
Chris Bracken
df39681b8c Eliminate unused displayBounds parameter (flutter/engine#8427)
Use of this parameter was eliminated in 2f36f15.
2019-04-03 14:28:29 -07:00
stuartmorgan
a6adcffb4c Add scroll wheel support to desktop GLFW shell (flutter/engine#8416)
Sends scroll events from GLFW to the Flutter engine, allowing scrolling
of Scrollables via a scroll wheel.
2019-04-02 18:17:23 -04:00
Zachary Anderson
6982c0e193 [fuchsia] Exclude glfw from the Fuchsia host build (flutter/engine#8407) 2019-04-02 09:49:14 -07:00
Chris Yang
414f2223de Delay platform view removal to submitFrame. (flutter/engine#8380)
Remove platform views inside OnDispose might cause issue if it happens before SubmitFrame and the active_composition_order has not been updated.
We will be left at a situation where the active_composition_order still contains the old view, but the view is actually removed from the UIView hierarchy.

We now cache the views need to be removed in OnDispose and actually remove them in SubmitFrame. At the same time, we remove stop detaching the subviews if they were disposed. 

As a side effect, this update will also fix flutter/flutter#30220
2019-04-01 17:06:32 -07:00
Dan Field
5d3ec31dd9 Make the resource context primary on iOS (flutter/engine#8387)
* Make resource context primary on iOS
2019-04-01 12:46:28 -07:00
Amir Hardon
db5e2e9492 Don't access a11y APIs with reflection starting Android P. (flutter/engine#8393) 2019-03-31 23:21:51 -07:00
Chinmay Garde
18af29469e Allow native entrypoint registration for runtime unittests. (flutter/engine#8379) 2019-03-29 17:53:49 -07:00
Jason Simmons
7bdf7064c4 Handle null values in TextInputConfiguration.actionLabel JSON (flutter/engine#8377)
Fixes https://github.com/flutter/flutter/issues/29798
2019-03-29 17:15:04 -07:00
Jason Simmons
ec6b6a1317 Check for hover motion events in AndroidTouchProcessor (flutter/engine#8376)
Fixes https://github.com/flutter/flutter/issues/30122
2019-03-29 15:42:11 -07:00
Chinmay Garde
9a54dbc65a Move libdart selection into its own target in //flutter/runtime. (flutter/engine#8373)
Cleanup repeated rules.
2019-03-29 14:29:09 -07:00
stuartmorgan
fe4491e66f Enable Linux shell build (flutter/engine#8233)
Enables building of the GLFW shell and the related unit tests.
2019-03-29 16:34:02 -04:00
Chinmay Garde
1a7c5d7bf3 GN Format all files in the engine. (flutter/engine#8369) 2019-03-29 12:44:57 -07:00
Jason Simmons
04ca9a5cb5 Create a new resource loading EGL context for each PlatformView instance on Android (flutter/engine#8330)
Using one global resource loading context will fail if two PlatformViews are
running concurrently with two different IO threads.
2019-03-28 11:33:56 -07:00
Chinmay Garde
1238fd06a1 Remove the standalone a11y test runners and merge its tests into embedder_unittests. (flutter/engine#8338)
Also cleans up the a11y unittests to use the new builder API and avoids polluting the global namespace with state for assertions.
2019-03-28 11:22:06 -07:00
Chinmay Garde
f3080acb10 Reset min log levels on each engine launch. (flutter/engine#8343) 2019-03-28 11:21:25 -07:00
stuartmorgan
ecb9da1446 Build Windows shell (flutter/engine#8331)
Enables the build of the Windows shell, based on the same GLFW code used
by the current Linux shell.
2019-03-27 23:38:44 -04:00
stuartmorgan
21ff4f0dd3 Build GLFW from source for Linux shell (flutter/engine#8327)
Instead of requiring a system-level GLFW, build it from source and
statically link it into the Linux shell.
2019-03-27 20:22:50 -04:00
Chinmay Garde
792c41fb98 Fix Windows build. (flutter/engine#8336) 2019-03-27 16:43:08 -07:00
stuartmorgan
fcc2ff8886 Remove use of epoxy from Linux shell (flutter/engine#8334)
Simplifies the build and runtime requirements for the Linux shell.
Since the engine does GL extension lookup manually anway, an extension
loader library isn't necessary.
2019-03-27 19:24:03 -04:00
Chris Bracken
c9556833a9 Add super call in FLEView reshape (flutter/engine#8335)
NSOpenGLView reshape is annotated with NS_REQUIRES_SUPER. This avoids
build failures when building with `-Wobjc-missing-super-calls`.
2019-03-27 16:22:12 -07:00
Chinmay Garde
20fe654ef3 Allow embedders to specify their own task runner interfaces. (flutter/engine#8273)
Currently, all Flutter threads are managed by the engine itself. This works for
all threads except the platform thread. On this thread, the engine cannot see
the underlying event multiplexing mechanism. Using the new task runner
interfaces, the engine can relinquish the task of setting up the event
multiplexing mechanism and instead have the embedder provide one for it during
setup.

This scheme is only wired up for the platform thread. But, the eventual goal
is to expose this message loop interoperability for all threads.
2019-03-27 16:16:59 -07:00
Amir Hardon
2f36f159f1 Allow delegation of a11y events from nodes that were not yet traversed (flutter/engine#8333)
The AccessibilityViewEmbedder was not delegating a11y events coming virtual nodes(of the embedded view) that were not previously traversed by the a11y framework.

It turns out the a11y framework might leave parts of the tree untraversed in some circumstances, changed the behavior to create an originId<-->flutterId mapping on the fly when an event is delegated from a not previously traversed node.

Fixes flutter/flutter#30010.
2019-03-27 15:49:15 -07:00
Matt Carroll
87ff155831 Android Embedding PR22: Polish - FlutterActivity Intent factories, FlutterFragment control of render modes, FlutterSurfaceView transparent until rendering is ready. (flutter/engine#8317) 2019-03-27 14:57:23 -07:00
Chinmay Garde
fc3d221b49 Reland "Allow specification of std::functions as native entrypoints from Dart code." (flutter/engine#8329)
This reverts commit 90c1cc90cf3a36a2ca2d68719c9c8e266a65aace after fixing Windows issues.
2019-03-27 12:22:48 -07:00
Chris Yang
19be572305 Add a11y support for embedded iOS platform view (flutter/engine#8156)
Follow up the framework change in flutter/flutter#29304.
Inject the accessibility element tree in the semantic node if the node is for platform views.

flutter/flutter#29302
2019-03-26 16:04:42 -07:00
Chinmay Garde
90c1cc90cf Revert "Allow specification of std::functions as native entrypoints from Dart code. (#8309)" (flutter/engine#8312)
This reverts commit 07f506f752b4f1220cf51768fe2dcf595d03a039.
2019-03-26 13:49:41 -07:00
Chinmay Garde
07f506f752 Allow specification of std::functions as native entrypoints from Dart code. (flutter/engine#8309)
This allows for the specification of std::functions (using EmbedderContext::NativeEntry) with their captures as native entrypoints. Earlier, only C functions we allowed which meant that there were no captures and assertions had to use globals which could introduce bugs when used with gtest_repeat.
2019-03-26 12:56:23 -07:00
Chinmay Garde
43a8481ba6 Enable lambda like native callbacks in tests and add support for custom entrypoints. (flutter/engine#8299) 2019-03-26 11:29:08 -07:00
Chinmay Garde
8be9d3af19 Migrate existing embedder unit tests to use the fixture. (flutter/engine#8296)
Also allows tests to specify their own embedder contexts.
2019-03-25 15:10:24 -07:00
Amir Hardon
968cefaef1 Delegate a11y events and action to/from embedded Android platform views. (flutter/engine#8250)
Delegate a11y events and action to/from embedded Android platfrom views.

This handles delegation of:
  * AccessibilityNodeProvider#performAction
  * ViewGroup#requestSendAccessibilityEvent
  * View#onHoverEvent

Additionally updates the currently input accessibility focused node state that is
tracked by the a11y bridge when an embedded view's node is focused.
2019-03-25 14:26:49 -07:00
Chinmay Garde
871d19c495 Make it easy to write embedder unit tests by creating a fixture and config builder. (flutter/engine#8276)
All embedder unit-tests have to setup the Flutter project arguments from scratch
before launching the engine. The boilerplate and having to deal with the low
level C API during each engine launch is a hinderance to writing tests.

This patch introduces an EmbedderTest fixture that sets up all the embedder side snapshots before allowing the unit test to create a FlutterConfigBuilder` that
the test can use to incrementally build and edit the Flutter project
configuration. From the given state state of a configuration, multiple engines
can be launched with their lifecylces managed by appropriate RAII wrappers.

This allows the a fully configured Flutter engine to be launched using 4 lines
of code in a fixture.

```
EmbedderConfigBuilder builder;
builder.SetSoftwareRendererConfig();
builder.SetAssetsPathFromFixture(this);
builder.SetSnapshotsFromFixture(this);
auto engine = builder.LaunchEngine();
```
2019-03-25 11:58:38 -07:00
Jason Simmons
7405924bf1 Do not drop the DartExecutor's message handler when a FlutterNativeView is detached from the FlutterView (flutter/engine#8254)
An activity can use ViewFactory.retainNativeFlutterView to reuse a
FlutterNativeView across multiple instances of the activity.  In this
scenario, the FlutterNativeView should continue to handle incoming messages
sent from Dart.
2019-03-21 18:08:58 -07:00
Amir Hardon
199310695f Mirror Android platform views a11y tree in the Flutter a11y tree. (flutter/engine#8237)
This PR mirrors virtual a11y tree of embedded platform views in the Flutter
a11y tree.

Non virtual hierarchies are not currently supported.

Only works on Android versions earlier than Android P as it relies on
reflection access to hidden system APIs which cannot be done starting
Android P.

A11y is not yet working as we also need to delegate a11y events from the
platform view to the FlutterView. This will be done in a following PR to
keep the change size a little saner.
2019-03-21 15:26:44 -07:00
Matt Carroll
c802d6ce22 FlutterJNI no longer asserts it is attached when dispatching platform messages and instead fizzles with a warning if not attached. Not sure what root cause of issue is, but this is necessary to avoid crashes. (flutter/engine#8246) 2019-03-21 13:45:13 -07:00
Jason Simmons
18437bef89 Use the GPU thread for Android surface on-screen context lifecycle operations (flutter/engine#8234)
Fixes https://github.com/flutter/flutter/issues/29679
2019-03-20 17:43:53 -07:00
Matt Carroll
752939347e Removed Activity reference from AccessibilityBridge by using a View for insets instead of the Activity (#18115) (flutter/engine#8231) 2019-03-20 14:18:34 -07:00
stuartmorgan
c3a14b5501 Initial import of GLFW Linux shell from FDE (flutter/engine#8159)
Changes include:
- File structure
- Header guards
- Include paths
- Namespaces
- Integration with the engine's GN build
- Conversion from jsoncpp to rapidjson
- Style and clang-format adjustment to match engine repository
2019-03-20 17:15:52 -04:00
Amir Hardon
f537b10fe8 Have the AccessibilityBridge attach/detach itself to the (flutter/engine#8229)
PlatformViewsDelegate.

Since onDetachedFromWindow can be called after the activity was
destroyed, the previous call to detach the accessibility bridge could
have crash as the NativeFlutterView was already null.
2019-03-20 12:26:30 -07:00
Matt Carroll
23bfa08262 Moved io.flutter.embedding.engine.android package to io.flutter.embedding.android (flutter/engine#8221) 2019-03-20 11:30:49 -07:00
Kaushik Iska
b8a2953d4c [ios] Set contentsScale before we commit CATransaction (flutter/engine#8218)
Layout occurs after [CATransaction commit]. layoutSubviews was where we set the contentsScale on the CALayer. This meant that for one frame, we would see content on the overlay view which was did not have the correct content scale.

This change makes it so that we initialize the FlutterOverlayView with the correct contentsScale.

This also updates the overlay_gr_context_ when we first create the overlay_view. This is an artifact of #8175.

This manifests as jank as seen in: flutter/flutter#29573
2019-03-19 16:36:11 -07:00
Francisco Magdaleno
e6f480f74b Send macOS keyboard data to the engine (flutter/engine#8219) 2019-03-19 15:58:11 -07:00
Amir Hardon
06a23ac247 Plumb a reference of PlatformViewsController and AccessibilityBridge to each other (flutter/engine#8208)
This is in preparation for implementing platform views a11y on Android.

And e2e working prototype is available here: https://github.com/amirh/engine/tree/a11y_hacks

flutter/flutter#19418
2019-03-19 15:48:45 -07:00
Dan Field
129a14f259 Export FlutterSemanticsUpdateNotification and improve docs (flutter/engine#8203)
* Export FlutterSemanticsUpdateNotification and improve docs
2019-03-18 19:32:49 -07:00
Chris Yang
ef308788e2 [platform_view] iOSP platformView composition optimize. (flutter/engine#8202)
Optimize the performance of the platform view composition.
When recomposition is required, we previously remove all the platform view related views (intercepting view, platform view) and re-add them for each frame. This is mentioned in flutter/flutter#23793.
This PR enhanced the performance by re-arrange the existing UIViews and only add the newly created Views.

As a result, it would also fix flutter/flutter#29427
2019-03-18 15:38:40 -07:00
Amir Hardon
c1c7b0a82d Merge only gpu and platform threads for platform views, fix deadlock. (flutter/engine#8045)
The reason we didn't merge just the gpu and platform threads from the get go was a deadlock in Shell:OnPlatformViewCreated and Shell:OnPlatformViewDestroyed.

The deadlock was caused by the platform thread starting a thread-hopping flow that ends ends up with the gpu thread releasing a latch that the platform thread is waiting on just after starting the cross-thread dance.
If the platform and gpu threads are the same, that last task that is posted to the gpu thread will never get executed as the gpu/platform thread is blocked on a latch.

This works around the deadlock by having a special case in the code for the scenario where the gpu and platform threads are the same.

Fixes: flutter/flutter#23974
2019-03-18 14:13:30 -07:00
Kaushik Iska
b98bf7c96c Update overlays_gr_context_ correctly (flutter/engine#8175)
There can be cases where SubmitFrame gets called
before overlays are a part of the frame, in these
cases, we should not update the GRContext ahead of time.

This commit makes it so we will update it only when
the frame really shows the overlay.

This addresses: https://github.com/flutter/flutter/issues/28920
2019-03-15 08:35:48 -07:00
Matt Carroll
95c350dcd2 Bugfix: Prevent crash when responding to a platform message after FlutterJNI detaches from native (#28651). (flutter/engine#8170) 2019-03-14 21:13:03 -07:00
Chinmay Garde
9ada55b844 Add frame and target time metadata to vsync events and connect platform vsync events using flows. (flutter/engine#8172)
This will allow us to easily visualize the time the platform informed the engine of a vsync event, its arguments, and when the engine began its UI thread workload using this information.
2019-03-14 16:48:01 -07:00
Matt Carroll
8aeb94ed24 Android Embedding PR 19: Add accessibility to new FlutterView. (flutter/engine#8109) 2019-03-14 14:24:49 -07:00
Chinmay Garde
8fc02f5b1d Add an allocator specific check to ensure that strings passed to the timeline are not heap allocated. (flutter/engine#8168)
Verified that the tests fail on issues like https://github.com/flutter/engine/pull/8166. Unfortunately, there is no x-platform way to perform this check but this should gate incorrect traces being added to the engine.
2019-03-14 14:15:46 -07:00