769 Commits

Author SHA1 Message Date
Michael Goderbauer
ed65ad873b Fix license headers (flutter/engine#6868)
These sneaked in between https://github.com/flutter/engine/pull/6757 and https://github.com/flutter/engine/pull/6759.
2018-11-15 14:12:57 -08:00
Ben Konyi
d4cedc97b4 Added delegate forwarding for didReceiveLocalNotification and willPresentNotification (flutter/engine#6858) 2018-11-14 11:39:47 -08:00
Dan Field
3ce4d16b63 Reset a11y bridge state on hot restart (flutter/engine#6857) 2018-11-14 11:13:39 -08:00
Dan Field
be56cd051e Set and unset accessibility flags even when re-entrant (flutter/engine#6853)
* Make sure to not unset a11y flags on reentrant calls to API
2018-11-13 23:54:45 -08:00
Michael Goderbauer
43b1be3219 Remove unused import (flutter/engine#6854) 2018-11-13 23:31:56 -08:00
Dan Field
102f6ea1c9 Avoid a never-disappearing splash screen if the engine came from somewhere else on iOS (flutter/engine#6834)
* Ignore multiple attemps to set splash screen, print warning
2018-11-13 16:04:09 -08:00
Michael Goderbauer
082336e7c2 Fix code smells reported by chrome's clang plugin (flutter/engine#6833) 2018-11-12 19:59:29 -08:00
Dan Field
877b3996d8 Avoid announcing text field when it lacks a11y focus (flutter/engine#6830)
* Avoid announcing text field when it lacks a11y focus
2018-11-12 16:08:59 -08:00
Amir Hardon
3438348516 Release the surface texture entry when the platform view is disposed. (flutter/engine#6829)
We were leaking the texture after the view was disposed.
2018-11-12 14:23:25 -08:00
Dan Field
a03e311cb0 fix log (flutter/engine#6817) 2018-11-09 16:46:49 -08:00
Amir Hardon
e818420245 Synchronize Flutter's rendering with CA. (flutter/engine#6807)
Right now we do it whenever the platform views preview flag is on.
This is less efficient, filed
https://github.com/flutter/flutter/issues/24133 to only do this when
there's a platform view in the tree.
2018-11-09 12:10:09 -08:00
Amir Hardon
18f0d35d05 Move the embedded view preview flag check to a common function. (flutter/engine#6813) 2018-11-09 11:24:14 -08:00
Amir Hardon
818cccfd47 Fix wrong flutter/platform_views protocol implementation on iOS. (flutter/engine#6803)
The `id` parameter of onDispose is passed as the method argument and not as
part of a map.
2018-11-09 10:21:44 -08:00
Amir Hardon
bfc1db2612 Support platform view overlays with GL rendering (flutter/engine#6769)
Moved the frame buffer specific logic from IOSGLContext to IOSGLRenderTarget.

use recording canvases for overlays

Support platform view overlays with gl rendering.

This also changes the overlay canvases (for both software and gl
rendering) be recording canvases, and only rasterize them after
finishing the paint traversal.
2018-11-08 19:52:43 -08:00
Amir Hardon
df64376478 Make the FlutterPlatformViewFactory create FlutterPlatformViews. (flutter/engine#6782)
Handing a UIView refererence directly to the engine makes it challenging
for plugin authors to retain a controller for that UIView (e.g the
controller that talks over the platform channel) for as long as the
embedded view is needed.

We instead make the factory return a FlutterPlatformView which is a
wrapper around the UIView that the engine retains as long as the
platform view instance is needed. This allows plugin authors to keep
their control logic in the FlutterPlatformView and know that the engine
is responsible for retaining the reference.
2018-11-08 11:21:55 -08:00
Dan Field
3446f04895 Fix mDNS publishing for iOS simulator (flutter/engine#6789)
* Don't block the platfrorm thread on simulator mDNS publishing
2018-11-08 11:18:59 -08:00
Amir Hardon
cbfe0c6713 Discard embedded UIViews on hot restart. (flutter/engine#6772) 2018-11-08 09:32:01 -08:00
Amir Hardon
d6e19afcb5 Add an internal_nodes_canvas to PaintContext. (flutter/engine#6728)
When we visit a PlatformViewLayer during the paint traversal it replaces
the PaintContext's canvas with a new one that is painted ontop of the
embedded view.
We need to make sure that operations applied by parent layers are also
applied to the new canvas.

To achieve this we collect all the canvases in a SkNWayCanvas and use
this canvas by non leaf nodes. Leaf nodes still paint only to the "current"
canvas.

This PR moves the overlay canvas creation from the paint phase to the
preroll phase, collects them into a SkNWayCanvas and set it in
PaintContext.

To keep this PR focused, I only used the internal_nodes_canvas in the
tranform_layer.
Will followup with a PR that changes all internal layers to use the
internal_nodes_canvas.
2018-11-08 09:31:40 -08:00
Dan Field
22f67d6ba3 avoid overreleasing FlutterView (flutter/engine#6791) 2018-11-07 21:19:14 -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
Todd Volkert
18134d0114 Fix String comparison as if Java were Dart. (flutter/engine#6781)
This also removes unused imports and sorts imports correctly
2018-11-07 09:59:51 -08:00
Dan Field
1a01274d0b fix setInitialRoute (flutter/engine#6774)
* fix setInitialRoute
2018-11-06 17:15:11 -08:00
Amir Hardon
98601958d9 fix type in embedded views preview flag name (flutter/engine#6767) 2018-11-06 10:35:01 -08:00
Amir Hardon
9ff80d12a2 Add an Info.plist flag to enable the embedded iOS views preview. (flutter/engine#6756)
When the flag is true, we currently use a single thread configuration,
and disabled the raster cache for opacity layers.

The flag's name is 'io.flutter_embedded_views_preview'.
2018-11-05 20:08:25 -08:00
Stanislav Baranov
dfbd99b3d9 Propagate positions of secondary pointers in UP events on Android (flutter/engine#6716) 2018-11-02 10:51:35 -07:00
Amir Hardon
bebedc379d Add an overlay surface on top of embedded UIViews. (flutter/engine#6726)
The overlay surfaces are going to be the same IOSSurface implementation
with the platform views controller set to null (so these are surfaces
that don't support embedding platform views to them).

  * Adds a FlutterOverlayView which is a UIView that's showing an
    overlay surface.
  * Creates an overlay surface for each embedded UIView (done in
    FlutterPlatformViewsController).
  * Changes CompositeEmbeddedView to return a new canvas.
  * Makes the PlatformViewLayer replace the PaintContext's canvas with
    the canvas for the overlay view.
  * Changed canvas in PaintContext to be a pointer so it can be changed.

TBD in following PRs:
  * Copy the current canvas state when replacing a canvas in PaintContext.
  * Make FlutterOverlayView work with a GL backend (currently it only
    works with software rendering)
2018-11-01 17:45:16 -07:00
Amir Hardon
3539cd3b1a Decode UIView's creation parameters and pass them to the view factory. (flutter/engine#6715) 2018-10-31 16:15:42 -07:00
Amir Hardon
25a211dfc6 Apply changes to the embedded UIView tree when presenting a frame (flutter/engine#6712)
Also tracks the order of embedded views from frame to frame, and only
removes and reattaches subviews if there is a structural change to the
UIView hierarchy.
2018-10-31 14:56:59 -07:00
Amir Hardon
ee912666e0 Move FlutterPlatformViewsController into FlutterEngine. (flutter/engine#6709)
This PR breaks PlatformViewsController's construction dependency on FlutterView,
which allows making FlutterEngine its owner instead of
FlutterViewController.

Also renamed the FlutterScreenshotDelegate to FlutterViewEngineDelegate
which is FlutterView's delegate to the engine, and expanded it to
provide a view embedder.
2018-10-31 13:02:44 -07:00
Amir Hardon
6a1ac0b6f5 Delay embedded UIViews touch events until the framework says so. (flutter/engine#6665)
This allows the framework to decide whether and when a touch event
sequence arrives to the embedded view. Which gives the framework the
ability to manage hit testing and gesture disambiguation for embedded
UIViews.

We achieve this by wrapping each embedded UIView with another UIView that has
a custom UIGestureRecognizer that delays touch events from being
delivered, and another UIGestureRecognizer that makes sure to let
Flutter know of events that are hit tested to the embedded view.
2018-10-30 20:16:56 -07:00
Dan Field
93d56cb341 Ensure Simulator publishes mDNS records (flutter/engine#6696)
* Ensure Simulator publishes mDNS records on loopback interface.
2018-10-30 18:04:18 -07:00
Dan Field
30caf79c4e Fix popSystemNavigator (flutter/engine#6691) 2018-10-29 16:36:28 -07:00
Mehmet Fidanboylu
ecd09173be Fix inconsistent include syntax (flutter/engine#6680) 2018-10-28 11:40:26 -07: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
Dan Field
285dab47c3 Update FlutterPlugin.h docs, suppress warning for older API (flutter/engine#6672)
* Update FlutterPlugin.h docs, suppress warning for older API
2018-10-26 14:54:33 -07:00
Amir Hardon
3c150f1c20 Attach and position embedded UIVIews (flutter/engine#6614) 2018-10-26 14:45:17 -07:00
Amir Hardon
3e93cdffaa Plumb the iOS PlatformViewsController into flow. (flutter/engine#6603)
For flow to manipulate the embedded UIViews during the paint traversal
it needs some hook in PaintContext.
This PR introduces a ViewEmbeder interface that is implemented by the
iOS PlatformViewsController and plumbs it into PaintContext.

The ViewEmbedder interface is mainly a place holder at this point, as
this PR is focused on just the plumbing.
2018-10-26 14:26:59 -07:00
Dan Field
849687c1f0 iOS Embedding Refactor (flutter/engine#6447)
* Create FlutterEngine to manage a Shell to support maintaining execution state across instances of FlutterViewControllers
* Refactor PlatformViewIOS to support adding or removing a FlutterViewController dynamically
* Refactor FlutterDartHeadlessCodeRunner to implement FlutterEngine
* Refactor FlutterViewController to accept a FlutterEngine at initialization or to create one for backwards compatibility; any Shell related responsibilities are now passed through to the Engine instance
* Remove FlutterNavigationController (unused)
* Update all public Objective C doc comments to be consistent and formatable
* Add public documentation to all public headers
2018-10-26 13:00:12 -07:00
Stanislav Baranov
098f31c86f Propagate pointer size from Android MotionEvent (flutter/engine#6662) 2018-10-26 09:39:10 -07:00
Jonah Williams
d1479e8892 TextField is only a live region when it has input focus (flutter/engine#6649) 2018-10-25 08:37:49 -07:00
Amir Hardon
0373b5e512 Add an iOS PlatformViewsController for creating/disposing UIViews. (flutter/engine#6569)
Adds a FlutterPlatformViewFactory protocol - a simple factory protocol to be implemented by plugins
  that exposes a UIView for embedding in Flutter apps.
* Adds a FlutterPlatformView protocol, which is used to associate a
  dispose callback with a `UIView` created by a FlutterPlatformViewFactory.
* Exposes a registerViewFactory method in FlutterPluginRegistrar.
* Implements the `flutter/platform_views` system channel on iOS, allowing
  Dart code to ask for creation/destruction of UIViews.
2018-10-24 15:07:05 -07:00
Dan Field
c29c7af19a fix setter for viewOpaque (flutter/engine#6653) 2018-10-24 12:31:44 -07:00
Chinmay Garde
68887916e2 Realize kernel asset mappings on a worker thread if one is available. (flutter/engine#6648) 2018-10-24 11:33:46 -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
Dan Field
bf8709d7dc Allow FlutterViewController to specify whether its FlutterView is opaque (flutter/engine#6570)
* Allow FlutterViewController to specify whether its FlutterView is opaque
2018-10-22 19:53:04 -07:00
Matthew Smith
437e15e3f5 13771 - iOS dictation bug (flutter/engine#6607)
According to the iOS docs, implementing
`- (id)insertDictationResultPlaceholder`

```Implementation of this method is optional but can be done when you want to provide a specific rectangle for the placeholder animation while the dictation results are being processed. ```

If you do not implement this method, UIKit will insert a default placeholder of 10 whitespace characters. By overriding this, no placeholder text will be inserted. If you implement the `insertDictationResultPlaceholder`, you must implement
`- (void)removeDictationResultPlaceholder:(id)placeholder willInsertResult:(BOOL)willInsertResult`
2018-10-22 10:28:39 -07:00
Gary Qian
863ab7c18b Properly gate android API < 21 and remove extraneous data array. (flutter/engine#6619) 2018-10-19 15:01:43 -07:00
Chinmay Garde
1ce76760ae Don't attempt to build any platform target on Fuchsia. (flutter/engine#6617) 2018-10-19 14:20:31 -07:00