3051 Commits

Author SHA1 Message Date
liyuqian
fe0db192d9 Report timings faster (100ms) in profile/debug (flutter/engine#9287)
This should satisfy the low-latency need of DevTools.

Test added:
* ReportTimingsIsCalledSoonerInNonReleaseMode
* ReportTimingsIsCalledLaterInReleaseMode
2019-06-11 16:51:20 -07:00
stuartmorgan
87070e4145 Add refresh callback to GLFW shell (flutter/engine#9280)
In some cases, the window needs to be redrawn without a resize. This
adds a callback for that case to trigger a repaint.

Since there's no embedding API for repainting, trigger it with a window
metrics event using the current window size.

Fixes https://github.com/flutter/flutter/issues/30731
2019-06-11 16:16:14 -07:00
Matt Carroll
6aed5635cd Expose a hasRenderedFirstFrame() method in FlutterView (#34275). (flutter/engine#9285) 2019-06-11 15:47:04 -07:00
Matt Carroll
aaee816c89 Fix TextInputPlugin NPE caused by PlatformViewsController ref in new embedding (#34283). (flutter/engine#9283) 2019-06-11 15:21:55 -07:00
stuartmorgan
0c39e8283e Fix crash on minimize with GLFW shell (flutter/engine#9278)
Fixes a divide-by-zero in pixel density computation.
2019-06-11 11:50:19 -07:00
Jason Simmons
888d951d19 Load AOT compiled Dart assets only from ELF libraries (flutter/engine#9260)
Previously AOT compiled Dart code would be packaged as a group of assets
within the APK.  This has been replaced by a single ELF library containing
the same data.
2019-06-11 10:10:45 -07:00
Chinmay Garde
b01f09fea6 Whitelist the —enable_mirrors flag to fix regression in existing embedder. (flutter/engine#9266) 2019-06-11 10:09:16 -07:00
Dan Field
903bb51f0e Unbreak internal rolls (flutter/engine#9270)
Adds back constructor for Rasterizer temporarily
2019-06-11 08:52:41 -07:00
Matt Carroll
b29ba6d09d Removed VIRTUAL_KEYBOARD check in TextInputPlugin because it's blocking Espresso work and its purpose is unknown. (flutter/engine#9238) 2019-06-10 13:30:39 -07:00
liyuqian
43f4c1d3c7 Make flow layers' attributes immutable (flutter/engine#9176)
For https://github.com/flutter/flutter/issues/33807

We still need to make layers' children immutable for full immutability.
That will require us to change the SceneBuilder API to build the layer
bottom up instead of top down (post-order traversal instead of pre-order
traversal).
2019-06-10 13:09:37 -07:00
Amir Hardon
8fcd81b36a Reland "Keyboard support for embedded Android views. (#9203) (flutter/engine#9257)
#9203 broke the keyboard_resize integration test(see more details in flutter/flutter#34085 (comment)).

This re-lands @9203 and fixes the issue the integration test uncovered by always allowing to hide the keyboard.

The difference from the original change is 07d2598
2019-06-10 12:56:35 -07:00
Wu Zhong
cdfbefc864 Correct typo (flutter/engine#9244) 2019-06-09 09:06:43 -07:00
Jonah Williams
162f3b9e38 Revert "Keyboard support for embedded Android views. (#9203)" (flutter/engine#9239) 2019-06-07 18:21:57 -07:00
Dan Field
c64bdc2629 Document AccessibilityBridge.java (flutter/engine#9237) 2019-06-07 16:00:38 -07:00
Ben Konyi
00de8257d5 Remove unnecessary whitelisted flags for --dart-flags (flutter/engine#9233) 2019-06-07 14:43:43 -07:00
Amir Hardon
5f0df6eba8 Keyboard support for embedded Android views. (flutter/engine#9203)
Generally what this PR is doing is setting up a delegation mechanism
for Android's onCreateInputConnection.

It works by letting the framework know when an embedded view gets loses
focus(within the virtual display), the framework maintains a focus node
for each Android view that is kept in sync with the focus state of the
embedded view.

The TextInputPlugin is extended to allow for 2 type of text clients a
"framework client"(what we had before) and a "platform view client".
When the AndroidView's focus node in the framework is focused the
framework sets a "platform view text client" for the TextInputPlugin,
which will result in the TextInputPlugin delegating
createInputConnection to the platform view.

When a platform view is resized, we are detaching it from a virtual
display and attaching it to a new one, as a side affect a platform view
might lose an active input connection, to workaround that we "lock" the
connection when resizing(by caching it and forcing the cached copy until
the resize is done).

Additional things worth calling out in this PR:

To properly answer which views are allowed for input connection
proxying we compare a candidate view's root view to the set of root
views of all virtual displays.
We also preserve a view's focus state across resizes.
Note that this PR only wires text for the io.flutter.view.FlutterView
For the new Android embedding some additional plumbing is necessary.

Corresponding framework PR: flutter/flutter#33901

flutter/flutter#19718
2019-06-06 21:58:04 -07:00
Jason Simmons
2e011a7df5 Update Engine::ReportTimings to use the new FML_TRACE macros (flutter/engine#9215) 2019-06-06 10:58:59 -07:00
liyuqian
fb0ea0ef4c Add onReportTimings and FrameRasterizedCallback API (flutter/engine#8983)
Using it, a Flutter app can monitor missing frames in the release mode, and a custom Flutter runner (e.g., Fuchsia) can add a custom FrameRasterizedCallback.

Related issues:
https://github.com/flutter/flutter/issues/26154
https://github.com/flutter/flutter/issues/31444
https://github.com/flutter/flutter/issues/32447

Need review as soon as possible so we can merge this before the end of May to catch the milestone.

Tests added:
* NoNeedToReportTimingsByDefault
* NeedsReportTimingsIsSetWithCallback
* ReportTimingsIsCalled
* FrameRasterizedCallbackIsCalled
* FrameTimingSetsAndGetsProperly
* onReportTimings preserves callback zone
* FrameTiming.toString has the correct format

This will need a manual engine roll as the TestWindow defined in the framework needs to implement onReportTimings.
2019-06-06 10:42:48 -07:00
Amir Hardon
a7c1f0c283 Revert "Switch PlatformViewsController from Activity ref to Application ref. (#9193)" (flutter/engine#9211)
This reverts commit ff4e1cc751f66f87de0b9277a8aa1ffacc68809c.
2019-06-06 09:29:10 -07:00
Dan Field
1ccb372e5f Align fuchsia and non-fuchsia tracing (flutter/engine#9199) 2019-06-05 15:14:27 -07:00
Matt Carroll
ff4e1cc751 Switch PlatformViewsController from Activity ref to Application ref. (flutter/engine#9193) 2019-06-05 14:24:16 -07:00
Greg Spencer
722d833715 Add the key event source, vendorId, and productId from Android (flutter/engine#9186)
This adds the key event source from Android so that the framework can differentiate between keyboard events and game controller events. Also added vendor and product ids so that Flutter code can decide to do special processing based on the kind of device, if desired.
2019-06-04 16:46:23 -07:00
Ben Konyi
ec114a767e Allow for whitelisted flags to be passed to the Dart VM (flutter/engine#9148)
* Allow for whitelisted flags to be passed to the Dart VM

Fixed part of https://github.com/flutter/flutter/issues/32176
2019-06-04 14:51:29 -07:00
Amir Hardon
b90961e0a3 Fix platform views channel regression (flutter/engine#9185)
This regression was introduced in #7847.

The PlatformViewsChannel method call handler was always setting the result to `notImplemented` even after handling a result, this resulted in a "Reply already submitted" exception being thrown.
Note that the method channel code is swallowing this exception and logging an error, so we didn't crash instead we were logging an error(this is why the integration test didn't fail).

Filed https://github.com/flutter/flutter/issues/33863 to make sure tests fail when such exceptions are thrown.

This PR also cleans up an unused `NoSuchPlatformViewException` that was introduced in #7847.

https://github.com/flutter/flutter/issues/33866
2019-06-04 12:38:38 -07:00
Emmanuel Garcia
4fcb1520ed Revert change by mistake: extract resources (flutter/engine#9180) 2019-06-03 23:44:46 -07:00
Emmanuel Garcia
63f6cd7409 Use shared library when libapp.so is found (flutter/engine#9172) 2019-06-03 16:23:28 -07:00
Chris Yang
33d335d61e Do nothing if the params didn't change when compositing iOS platform views. (flutter/engine#8999) 2019-06-03 13:08:29 -07:00
Matt Carroll
4e26d76bd7 Extracted PlatformViewsChannel from PlatformViewsController. (flutter/engine#7847) 2019-06-03 11:04:33 -07:00
stuartmorgan
ea35ff30c0 Copy the macOS podspec during builds (flutter/engine#9158)
The podspec must be copied to the build output root, otherwise
--local-engine won't work in projects containing plugins.

Mirrors the iOS podspec copy rule.
2019-05-31 17:22:09 -07:00
Kevin Lindkvist
0a6a20fa55 Remove references to Fuchsia's ContextWriter (flutter/engine#9157) 2019-05-31 16:12:07 -07:00
Dan Field
7513edc9c2 Preserve safe area (flutter/engine#8848)
Preserve safe area on Window regardless of insets.
2019-05-31 09:24:38 -07:00
Jason Simmons
3e6486cb34 Always run the resource extractor in FlutterMain (flutter/engine#9149)
FlutterMain.findAppBundlePath is using the presence of the flutter_assets
directory as a signal that the app is initialized.  For consistency,
FlutterMain will run the resource extractor at startup and create
flutter_assets even if no resources need to be extracted.
2019-05-30 16:50:31 -07:00
Jason Simmons
833ee537b7 Suppress an unchecked cast warning in ShimPluginRegistry (flutter/engine#9145) 2019-05-30 13:10:03 -07:00
stuartmorgan
03ec25fb58 Fix type mismatches in C++ standard codec (flutter/engine#9112)
There were some implicit casts in the standard codec implementation that
didn't show up on Linux, but do on Windows.
2019-05-30 10:17:08 -07:00
Chris Yang
1020a201ca Dynamically add certain iOS AppDelegate methods. (flutter/engine#8843) 2019-05-30 09:06:49 -07:00
Matt Carroll
85c5d57ca8 New Plugin API PR5: Integrates plugin lifecycle control with FlutterFragment. (flutter/engine#9083) 2019-05-29 20:46:07 -07:00
Matt Carroll
f21942ddcc Implemented Log proxy that only logs in BuildConfig.DEBUG (#25391). (flutter/engine#9122) 2019-05-29 20:19:29 -07:00
Dan Field
542be40698 Reduce pipeline depth when GPU and Platform are same thread (flutter/engine#9132) 2019-05-29 19:45:02 -07:00
Kaushik Iska
780b9e0918 Change the virtual display size restriction to warning (flutter/engine#9110)
* Change the virtual display size restriction to warning

- Fixes: https://github.com/flutter/flutter/issues/33290

- This is so we don't block usecases where users show the platform
  view partially.

- https://github.com/flutter/flutter/issues/31990 should address this
  issue more broadly.

* Fix error message
2019-05-30 08:07:41 +05:30
Matt Carroll
99e54871e8 Add plugin shim to facilitate old plugins in new embedding (#33478). (flutter/engine#9120) 2019-05-29 18:39:15 -07:00
Matt Carroll
ad4706f1bc Added support for transparent FlutterActivitys (#32740). (flutter/engine#9115) 2019-05-29 18:34:53 -07:00
Chinmay Garde
cb00aac583 Allow specifying both Dart and non-Dart fixtures in engine unit-tests. (flutter/engine#9113)
* Allow specifying both Dart and non-Dart fixtures in engine unittests.

This fixes numerous issues in the way in which fixtures were managed
in the engine unit-tests.

* Instead of only being able to specify Dart fixtures, unit-tests may specify
  non-Dart fixtures as well. These are simply copied over to the fixtures
  directory known to the unit-test at runtime.
* An issue where numerous Dart files could be given to the kernel snapshotter
  has been addressed. It was anticipated that such a (legal) invocation to the
  kernel snapshotter would produce a snapshot with the contents of all the Dart
  files added to the root library. This is incorrect and the behavior in this
  case is undefined.
* Dart files referenced by the main Dart file are correctly tracked via a
  depfile.
* The snapshotter arguments have been cleaned up to get rid of unused
  arguments (`—strong`) and  the use of the VM product mode argument has been
  corrected to no longer depend on the Flutter product mode.
2019-05-28 19:11:47 -07:00
Kate Lovett
e94a3d9d2e Removing unused imports (flutter/engine#9108) 2019-05-28 15:16:33 -07:00
Mehmet Fidanboylu
d0b8eba0af Fix internal break since listing contents can return null (flutter/engine#9078) 2019-05-26 20:07:13 -07:00
stuartmorgan
f0c950fb04 Rename macOS FLEPlugin* to FlutterPlugin* (flutter/engine#9074)
As another step toward aligning the macOS plugin API with the iOS plugin
API, and with its final form, rename the plugin-related classes from
FLEPlugin* to FlutterPlugin*. This makes the names of the clasess the
same between iOS and macOS. Eventually they should actually merge, with
annotations/ifdefs for platform differences, but for now since the macOS
version uses the same method names and is simply a subset of the iOS
APIs (with one to-be-stabilized method that is macOS-specific) doing the
merge later won't be a breaking change.

Doing this now allows for building out plugin tooling and plugin
implementations on macOS without creating a growing body of code that
will experience a breaking change later.

See:
https://github.com/flutter/flutter/issues/31735
https://github.com/flutter/flutter/issues/32718
2019-05-25 20:45:00 -04:00
Chris Bracken
8150bff997 Apply minor cleanups to Android embedding (flutter/engine#9088)
Eliminate an unused import, add missing @Override annotations, and
eliminate an unused logger.
2019-05-25 15:45:14 -07:00
Chris Bracken
7cdc09e0b2 Removed outdated deprecation comments (flutter/engine#9087)
In breaking change flutter/engine#4487, a typo was fixed in our Android
APIs correcting RequestPermissionResult to RequestPermissionsResult
(note the 's' on Permissions) for consistency with the Android SDK.

Various tombstone comments were left to help guide developers in the
right direction. These comments were slated for removal in March of
2018; at over a year later, we can probably safely remove them.
2019-05-25 15:02:52 -07:00
Chris Bracken
f7fe97bf24 Delete BSDiff sources (flutter/engine#9086)
BSDiff is no longer used as of flutter/engine#8663. This removes the
unused Java import and sources.
2019-05-25 13:49:28 -07:00
Chris Bracken
21fd6fb32a Correct typos, adopt US spellings (flutter/engine#9081)
Corects a bnuch of typeos throughout teh engien codebsae. Also makes
a couple minor Commonwealth -> US spelling adjustments for consistency
with the rest of Flutter's codebase.

Made use of `misspell` tool:
https://github.com/client9/misspell
2019-05-25 13:14:46 -07:00
Matt Carroll
82b9848101 New Plugin API PR4: Adds Lifecycle support to the new plugin system. (flutter/engine#9049) 2019-05-24 19:28:49 -07:00