899 Commits

Author SHA1 Message Date
Dan Field
30caf79c4e Fix popSystemNavigator (flutter/engine#6691) 2018-10-29 16:36:28 -07:00
Gary Qian
db2208a1fc Flutter tester default locales (flutter/engine#6689) 2018-10-29 14:06:04 -07:00
Amir Hardon
35836958a7 Don't populate the external view embedder in PaintContext. (flutter/engine#6686)
The platform views embedding is still WIP, and until we dynamically
merge the gpu and platform threads based on the presence of an embedded
view in the scene fetching the view embedder is not thread safe.

This PR essentially disables iOS platform views embedding, we will
re-enable once dynamic thread merging is supported.
2018-10-29 10:38:04 -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
Chinmay Garde
e52ba8b257 Ensure that Scene::toImage renders texture backed images. (flutter/engine#6636)
TL;DR: Offscreen surface is created on the render thread and device to host
transfer performed there before task completion on the UI thread.

While attempting to snapshot layer trees, the engine was attempting to use the
IO thread context. The reasoning was that this would be safe to do because any
textures uploaded to the GPU as a result of async texture upload would have
originated from this context and hence the handles would be valid in either
context. As it turns out, while the handles are valid, Skia does not support
this use-case because cross-context images transfer ownership of the image from
one context to another. So, when we made the hop from the UI thread to the IO
thread (for snapshotting), if either the UI or GPU threads released the last
reference to the texture backed image, the image would be invalid. This led to
such images being absent from the layer tree snapshot.

Simply referencing the images as they are being used on the IO thread is not
sufficient because accessing images on one context after their ownership has
already been transferred to another is not safe behavior (from Skia's
perspective, the handles are still valid in the sharegroup).

To work around these issues, it was decided that an offscreen render target
would be created on the render thread. The color attachment of this render
target could then be transferred as a cross context image to the IO thread for
the device to host tranfer.

Again, this is currently not quite possible because the only way to create
cross context images is from encoded data. Till Skia exposes the functionality
to create cross-context images from textures in one context, we do a device to
host transfer on the GPU thread. The side effect of this is that this is now
part of the frame workload (image compression, which dominate the wall time,
is still done of the IO thread).

A minor side effect of this patch is that the GPU latch needs to be waited on
before the UI thread tasks can be completed before shell initialization.
2018-10-22 17:40:24 -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
Gary Qian
36cc794c94 Gate locale.getScript() behind version check for android API < 21 (flutter/engine#6592) 2018-10-18 14:03:48 -07:00
Gary Qian
b4a3ad2e28 Pass full locale list with script and variant codes to framework (flutter/engine#6557)
* Locale Passing

* Pass full locale list and script and variant codes to framework

* Working Android locale list passing and fallback
2018-10-17 10:53:01 -07:00
Chinmay Garde
501c2755e8 Ensure that the platform view is created and destroyed when running the shell unittests. (flutter/engine#6560) 2018-10-16 14:30:19 -07:00
Dan Field
b4b702053b Advertise iOS Observatory port over mDNS/Bonjour (flutter/engine#6533)
* Publish port of observatory over mDNS
2018-10-15 17:21:01 -07:00
Shaoxing Wang
cfd00c3d88 Fix crash when removeViewImmediate invoked from platform view (flutter/engine#6266)
* Fix crash when removeViewImmediate invoked from platform view

* Clear animation before remove view from mFakeWindowRootView
2018-10-15 16:09:10 -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
Jonah Williams
b4a9605fce Add version check for dismissable (flutter/engine#6522) 2018-10-12 15:47:11 -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
谢然
3f6afa9c58 fix ResourceExtractor npe. (flutter/engine#6461) 2018-10-12 09:56:00 -07:00
James D. Lin
aaf6f652b4 Add a callback for iOS when the first Flutter frame is rendered (flutter/engine#6135)
Add a `-[FlutterViewController setFlutterViewDidRenderCallback:]`
method on iOS so client applications can be notified when the Flutter
view has rendered.  This can be used for add2app cases to determine
when to take an initial screenshot for comparisons in automated
tests.

The callback is expected to be an Objective-C block (or Swift
closure).  I chose to support only a single callback because it's
much simpler (especially since it does not require a separate method
to unregister the callback), and it's not clear that there are use
cases that would justify additional complexity.  Clients have the
flexibility to make their callback invoke other callbacks anyway.

I alternatively considered adding a `-[FlutterViewController
viewDidRenderFirstFlutterFrame]` method that clients could override
in a subclass, but using an Objective-C block seems more flexible and
less of a burden.

Fixes https://github.com/flutter/flutter/issues/20665
2018-10-11 20:21:13 -07:00
Gary Qian
45577f1f07 Pass scriptcode and variantcode to dart:ui Window. (flutter/engine#6493) 2018-10-10 17:22:59 -07:00
Jason Simmons
065769e2e5 Use an older version of SurfaceTexture.setOnFrameAvailableListener when running on pre-Lollipop devices (flutter/engine#6489)
Fixes https://github.com/flutter/flutter/issues/21730
2018-10-10 15:01:48 -07:00
Jidong Chen
92ae80259c Missing dealloc method in FlutterEventChannel (flutter/engine#6464)
* Missing dealloc method in FlutterEventChannel
2018-10-09 11:50:00 -07:00
Jonah Williams
c0edacaa1b Correct issues in visible children determination (flutter/engine#6455)
* fix off by one

* add documentation on counting for setToIndex
2018-10-08 11:05:09 -07:00
liyuqian
1d2c3ec0a4 Remove unused imports and variables (flutter/engine#6437)
This is discovered in the new Google3 checks. It should not block our
roll but it's nice to fix them.
2018-10-04 16:01:49 -07:00
Chinmay Garde
97c1c2c302 Remove touch mapper and respect the UITouch phase when calculating the pointer data change type. (flutter/engine#6430)
The touch mapper was a relic of a time when the pointer IDs had to be less
than 16. Not respecting the touch phase is getting in the way of clients that
fake their own touches. Turns out the AppDelegate also like to fake touches to
simulate status bar events. Now, except in cases where there is a specific
override in place, the UI touch phase is respected.
2018-10-04 14:33:58 -07:00
nathanrogersgoogle
c9e98490c8 Add deadline_now_delta argument to Engine::NotifyIdle's trace (flutter/engine#6419)
This allows us to figure out from looking at a trace if an
|Engine::NotifyIdle| call went beyond its deadline
2018-10-03 19:55:57 -07:00
Jonah Williams
ad889d5cec Ensure setViewIdResourceName has the correct version guard (flutter/engine#6404) 2018-10-03 17:44:32 -07:00
Zachary Bush
ae7481fbe2 [rapidjson] Fix import statements (flutter/engine#6418) 2018-10-03 17:33:45 -07:00
Chinmay Garde
6e666dadf8 Create a benchmarking target for the shell. (flutter/engine#6420)
Also adds //flutter/benchmarking which, similar to //flutter/testing, allows for the creation of a benchmarking executable. This is also the target that contains benchmarking utilities.
2018-10-03 17:22:33 -07:00
Kirill Nikolaev
aee6ec23f9 Add nullability annotations to MethodChannel/MethodCall. (flutter/engine#6393)
This works towards resolving https://github.com/flutter/flutter/issues/19888.
2018-10-02 15:02:16 -07:00
Jonah Williams
fad67c5eca do not count Hidden nodes at the beginning of the scrollable (flutter/engine#6381) 2018-10-01 11:15:22 -07:00
Ben Konyi
af54a8129e Dart SDK roll for 2018-09-28 (flutter/engine#6388) 2018-09-28 18:02:04 -07:00
Jonah Williams
12981679ba make sure we dont set live regionin api level < 18 (flutter/engine#6375) 2018-09-27 23:24:54 -07:00
Chinmay Garde
2c9de2127a Update observatory-port default behavior description. (flutter/engine#6365) 2018-09-27 17:18:11 -07:00
Kirill Nikolaev
9d6b7c41e3 Document that all MethodChannel callbacks must be called on the main thread. (flutter/engine#6245)
This further addresses https://github.com/flutter/flutter/issues/14568.
2018-09-27 15:48:29 -07:00
liyuqian
54d47ebc1d Change log level from ERROR to WARNING (flutter/engine#6361)
So tool_tests-windows won't fail.
2018-09-27 11:28:58 -07:00
Dan Field
db97bea01f SystemNavigator.pop can pop w/o UINavigationController (flutter/engine#6341)
* SystemNavigator.pop can pop w/o UINavigationController
2018-09-27 08:57:30 -07:00