3051 Commits

Author SHA1 Message Date
gaaclarke
674871d1f5 Revert fd3dac0f589befb45a0687fa8643b400fd07733a (flutter/engine#13467)
Put `Picture.toImage` back on the GPU thread.  Left the unit tests intact.
2019-10-31 16:57:52 -07:00
Amir Hardon
b9e04afb24 Fix stale platform view gr context on iOS (flutter/engine#13469)
When gr context is changed (this happens when sending the app to the background and then to the foreground) we need to update it for all the platform view overlay surfaces.

The update logic was caching the previous gr context to figure if it had to be updated, but after updating it for a given overlay we were updating the cached context. In apps with multiple platform views this will result in overlays with a stale gr context.

This fixes flutter/flutter#36437
And I believe it should fix flutter/flutter#36999 as well (though I don't have repro code to verify).
2019-10-31 16:51:11 -07:00
Jason Simmons
f0341399a4 Pass the automaticallyRegisterPlugins flag to the FlutterEngine constructor in FlutterActivityTest (flutter/engine#13468) 2019-10-31 16:06:37 -07:00
Matt Carroll
49819893ec Automatically register plugins in FlutterEngine. (#43855) (flutter/engine#13455) 2019-10-31 14:10:45 -07:00
Josh
e91e19f3df Force orientation change when current orientation not allowed on iOS (flutter/engine#13170) 2019-10-31 12:20:24 -07:00
Amir Hardon
c0be7a1bc1 Fix iOS crash when multiple platform views are in the scene (flutter/engine#13449)
Having 2 or more platform views simultaneously in the layer tree was crashing immediately on iOS with GL backend.

This regressed in #11070 which passed gl_context to a function in a loop using std::move (which meant on the second iteration the caller is no longer the owner of the field).

I added a scenarios_app test, though this test doesn't run on a physical device on CI so it would have only caught the problem when running locally (flutter/flutter#43852).
2019-10-31 10:30:15 -07:00
Dan Field
019c555be8 Fizzle onConfigurationChanged if no FlutterView (flutter/engine#13445) 2019-10-30 15:49:02 -07:00
Matt Carroll
14f2c142d2 Automatically destroy FlutterEngine when created by FlutterActivity or FlutterFragment. (flutter/engine#13423) 2019-10-30 15:01:57 -07:00
Michael Klimushyn
791c5441a5 Revert "Turn on RasterCache based on view hierarchy (#13360)" (flutter/engine#13442)
This caused EmbedderTest.VerifyB143464703 to fail after merging into
master.

```
../../flutter/shell/platform/embedder/tests/embedder_unittests.cc:3111: Failure
Value of: ImageMatchesFixture("verifyb143464703.png", renderered_scene)
  Actual: false
Expected: true
[  FAILED  ] EmbedderTest.VerifyB143464703 (2507 ms)
```

This reverts commit b1479f8e6075ef95d6b11a03e318bff72a2c0288.
2019-10-30 11:25:29 -07:00
Michael Klimushyn
b1479f8e60 Turn on RasterCache based on view hierarchy (flutter/engine#13360)
Previously the cache was disabled on whether or not PlatformViews were
globally enabled. Instead track their existence in the view hierarchy
and only disable RasterCache if a PlatformView is actually present.
2019-10-30 10:45:15 -07:00
Dan Field
46bf911c59 Set the install name at link time for darwin dylibs (flutter/engine#13428) 2019-10-29 20:30:13 -07:00
Mehmet Fidanboylu
07f337c540 Add isRunningInRobolectricTest back (flutter/engine#13424) 2019-10-29 19:46:21 -07:00
Chinmay Garde
62f76d4eb8 Make sure root surface transformations survive resetting the matrix directly in Flow. (flutter/engine#13405)
This used to only be handled correctly for non-root layer backing stores. This
was mostly a side effect of the fact that we used recording canvases instead of
rendering directly into the backing store. We now use recording canvases
consistently.

Fixes b/143464703
Fixes https://github.com/flutter/flutter/issues/43732
2019-10-29 17:44:57 -07:00
gaaclarke
7cdf36bc7f Made it so we clean up gl resources when view controllers get deleted. (flutter/engine#13396) 2019-10-29 16:09:14 -07:00
gaaclarke
3c497a831e Added back in empty lifecycle events so we don't break people that used to call super. (flutter/engine#13421) 2019-10-29 16:04:59 -07:00
Kaushik Iska
b6caece270 [dart_runner] Common libs need to exist for aot runner (flutter/engine#13419)
This is to account for failures like:

```
00067.522] 13245:13247>
[00067.522] 13245:13247> ------------------------------------------------
[00067.522] 13245:13247> RUNNING TEST: /pkgfs/packages/goodbye_dart_test/0/test/goodbye_dart_test
[00067.522] 13245:13247>
[00067.754] 05775:06330> dlsvc: could not open 'ld.so.1'
[00067.758] 01149:01207> [component_manager] WARN: Failed to launch process 'dart_aot_runner.cmx' in job 163427: Failed to load dynamic linker from fuchsia.ldsvc.Loader: NOT_FOUND
[00067.759] 05775:05777> [ERROR:src/sys/appmgr/realm.cc(155)] Cannot run executable dart_aot_runner.cmx due to error -1 (ZX_ERR_INTERNAL): fuchsia.process.Launcher failed
[00067.759] 05775:05777> [ERROR:src/sys/appmgr/runner_holder.cc(41)] Runner (fuchsia-pkg://fuchsia.com/dart_aot_runner#meta/dart_aot_runner.cmx) terminating, reason: failed to create component (UNKNOWN)
[00067.760] 13245:13247> fuchsia-pkg://fuchsia.con/goodbye_dart_aot#meta/goodbye_dart_aot.cmx: failed to create component (UNKNOWN)
[00067.761] 13245:13247> goodbye_dart_aot --now failed
[00067.772] 13245:13247> FAILURE: /pkgfs/packages/goodbye_dart_test/0/test/goodbye_dart_test exited with nonzero status: 1
[00067.886] 13245:13247>
[00067.887] 13245:13247> ------------------------------------------------
```

logs: https://logs.chromium.org/logs/fuchsia/buildbucket/cr-buildbucket.appspot.com/8898242024940777936/+/steps/launch_collect/0/steps/1/0/steps/collect/0/logs/task_stdout_stderr:_QEMU/0
2019-10-29 14:50:11 -07:00
Jason Simmons
2c61d2336b Reformat BUILD.gn files to comply with the format checker presubmit script (flutter/engine#13401) 2019-10-29 09:49:16 -07:00
Jason Simmons
75a8256cca Use DartExecutor.getBinaryMessenger in FlutterNativeView instead of deprecated send methods (flutter/engine#13403) 2019-10-29 09:48:54 -07:00
Matt Carroll
63ddf0ce72 Converted ActivityAware and ServiceAware Lifecycles to opaque objects (#43670) (flutter/engine#13402) 2019-10-28 21:41:07 -07:00
Matt Carroll
b2b2f011e7 Remove multiplexed Flutter Android Lifecycle. (#43663) (flutter/engine#13394) 2019-10-28 16:22:11 -07:00
Chinmay Garde
caca719e6c Delay metal drawable acquisition till frame submission. (flutter/engine#13367)
Uses the new `SkSurface::MakeFromCAMetalLayer` Skia API.
2019-10-28 13:24:22 -07:00
Chinmay Garde
9e89f4af6f Switch the MacOS Desktop embedder to using a thread configuration where the platform and render task runners are the same. (flutter/engine#13300)
Also creates a new test harness for the desktop embedder framework target and adds a test that launches a headless engine in this new thread configuration.

Fixes https://github.com/flutter/flutter/issues/17579
2019-10-28 12:47:05 -07:00
Matt Carroll
454b97d691 Deprecated DartExecutor as BinaryMessenger and added a getBinaryMessenger() method. (#43202) (flutter/engine#13349) 2019-10-25 20:07:13 -07:00
Kaushik Iska
d336248246 [flutter_runner] Remove the checks for libdart profiler symbols (flutter/engine#13364)
Since the runner binaries are statically linked, we do not need
to look for the libdart profiler symbols separately.
2019-10-25 16:25:15 -07:00
Chris Bracken
4835f63736 Expose platform view ID on embedder semantics node (flutter/engine#13345)
This exposes platform_view_id on the embedder API's FlutterSemanticNode.

In 40e0467f60dd2174af5b3edf8bd2752eb6251bf1 (#8055), platformViewId was
added to SemanticsNode. This field is non-zero when the SemanticsNode
represents a platform view and is typically used by embedders as a means
of identifying locations where a platform view's 'native' accessibility
tree should be injected into the platform-specific accessibility tree
constructed by the embedder.

Due to the intended use of this field, the Flutter framework is meant to
enforce that this node has a child count of zero.
2019-10-24 19:42:32 -07:00
Chris Bracken
5a0582c673 Remove TODO on embedder a11y unit tests (flutter/engine#13346)
Removes a TODO implying that the embedder accessibility unittests were
disabled due to flakiness.

The tests were originally disabled in
https://github.com/flutter/engine/pull/9482.

The issue tracking re-enabling the tests was
https://github.com/flutter/flutter/issues/35218.

This issue was resolved, and the tests re-enabled, in
https://github.com/flutter/engine/pull/9585.
2019-10-24 19:42:16 -07:00
Matt Carroll
f89e36a95b Android embedding API updates for plugin ecosystem - plugin facade, split Lifecycle, save state callbacks to plugins (#43241, #43242, #43295) (flutter/engine#13280) 2019-10-24 19:10:05 -07:00
Filip Filmar
ae71cba030 Wires the locale provided by Fuchsia. (flutter/engine#13045)
The FIDL service `fuchsia.intl.PropertyProvider` is a service that
the flutter runner can use to obtain information on system preferred
locales.

This change sends a platform message "setLocale" on the channel
"flutter/localization", based on the values provided by the above
mentioned FIDL service.

Credit: most of this was initially written by @kpozin; I ported it
to out-of-tree flutter engine.

Tested:

1. Compile and publish the unit tests package as shown in
   the script below.
2. In a Fuchsia repository (pointed to by `$FUCHSIA_DIR`), run
   `fx serve`
3. `fx shell run fuchsia-pkg://fuchsia.com/flutter_runner_tests#meta/flutter_runner_tests.cmx`

The script used to update the unit tests.

```bash

set -x

FLUTTER_ENGINE_DIR="${FLUTTER_ENGINE_DIR:-$HOME/fx/flutter/engine/src}"
readonly OUT_DIR="${FLUTTER_ENGINE_DIR}/out"

(
  cd ${FLUTTER_ENGINE_DIR}
  ./flutter/tools/gn --fuchsia --fuchsia-cpu x64 --unoptimized
  ninja -j 100 -C "${OUT_DIR}/fuchsia_debug_unopt_x64"
  cp "${OUT_DIR}/compile_commands.json" "${FLUTTER_ENGINE_DIR}"

  echo "Publishing the tests package"
  "${FLUTTER_ENGINE_DIR}/fuchsia/sdk/linux/tools/pm" publish \
    -a -r $FUCHSIA_DIR/out/release/amber-files \
    -f "${FLUTTER_ENGINE_DIR}/out/fuchsia_debug_unopt_x64/flutter_runner_tests-0.far"
)
```
2019-10-23 15:05:19 -07:00
Chinmay Garde
d62c916817 Add FlutterEngineRunsAOTCompiledDartCode to the embedder API. (flutter/engine#13319)
For embedder code that is configured for both AOT and JIT mode Dart execution
based on the Flutter engine being linked to, this runtime check may be used to
appropriately configure the `FlutterProjectArgs`. In JIT mode execution, the
kernel snapshots must be present in the Flutter assets directory specified in
the `FlutterProjectArgs`. For AOT execution, the fields `vm_snapshot_data`,
`vm_snapshot_instructions`, `isolate_snapshot_data` and
`isolate_snapshot_instructions` (along with their size fields) must be specified
in `FlutterProjectArgs`.
2019-10-23 14:49:56 -07:00
Justin McCandless
c1d8b3c16d NO_SUGGESTIONS keyboard flag in Android (flutter/engine#13099)
Add the enableSuggestions parameter to control Android's keyboard suggestions
2019-10-23 10:47:19 -07:00
Francisco Magdaleno
05dbdd8816 Send flag modified events to the framework (flutter/engine#13269) 2019-10-22 19:01:00 -07:00
Chinmay Garde
b7705127a6 Allow embedders to update preferrred locales. (flutter/engine#13238)
This was previously only possible by sending an undocumented payload over an engine managed channel.
2019-10-22 17:50:01 -07:00
Chinmay Garde
c108c0af17 Avoid accessing the Cocoa view on the GPU or IO task runners. (flutter/engine#13295)
The view was being accessed from a background thread so its OpenGL context could be accessed. This tripped thread safety assertions in Cocoa. Now the OpenGL context is stashed in the FlutterEngine instance itself.
2019-10-22 14:21:49 -07:00
George Wright
f99f00b0e3 Make flutter_tester support multithreaded testing, and run all Dart tests in both single and multithreaded configurations (flutter/engine#13273)
Make flutter_tester support multithreaded testing, and run all Dart tests in both single and multithreaded configurations

This also modifies Shell::GetUIIsolateLastError() and Shell::EngineHasLivePorts() so that they must be called from the UI task runner.
2019-10-22 14:10:57 -07:00
gaaclarke
ac32ac8391 Made restarting the Engine remember the last entrypoint that was used. (flutter/engine#13289) 2019-10-22 14:01:52 -07:00
Ryan Macnak
344c0abb0a Roll Dart to 6a65ea9cad4b014f88d2f1be1b321db493725a1c. (flutter/engine#13294)
Remove dead shared snapshot arguments to Dart_CreateIsolateGroup.

6a65ea9cad4b [vm] Remove shared snapshot and reused instructions features.
db8370e36147 [gardening] Fix frontend-server dartdevc windows test.
4601bd7bffea Modified supertype check error message to be more descriptive.
0449905e2de6 [CFE] Add a serialization-and-unserialization step to strong test
c8b903c2f94f Update CHANGELOG.md
2a12a13d9684 [Test] Skips emit_aot_size_info_flag_test on crossword.
b26127fe01a5 [cfe] Add reachability test skeleton
2019-10-22 13:14:20 -07:00
Chinmay Garde
d003548073 Disable flaky test ShellTest_ReportTimingsIsCalled. (flutter/engine#13292)
Investigation is tracked in https://github.com/flutter/flutter/issues/43192
2019-10-22 11:56:31 -07:00
Jason Simmons
51f77f7203 Do not request executable permission on Fuchsia file mappings unless it is required (flutter/engine#13290)
Fixes https://github.com/flutter/flutter/issues/43273
2019-10-22 11:24:51 -07:00
gaaclarke
ec08de4bc5 Revert "Made restarting the Engine remember the last entrypoint that was used. (#13264)" (flutter/engine#13287)
This reverts commit ba50a6dfba72b30a7a06cfb1ee5d40c2316b8a71.
2019-10-22 10:03:10 -07:00
gaaclarke
ba50a6dfba Made restarting the Engine remember the last entrypoint that was used. (flutter/engine#13264) 2019-10-22 08:10:57 -07:00
Matt Carroll
341106f69a Forwards Activity result to FlutterFragment in FlutterFragmentActivity. (flutter/engine#13214) 2019-10-21 17:05:46 -07:00
George Wright
9b641268fc Ensure we call into Engine from the UI taskrunner in Shell::EngineHasLivePorts (flutter/engine#13265) 2019-10-21 15:56:03 -07:00
Jonah Williams
bec5aae594 fix NPE in accessibility bridge (flutter/engine#13255) 2019-10-21 15:35:34 -07:00
Jason Simmons
25e7638daa Hold a reference to the Skia unref queue in UIDartState (flutter/engine#13239)
Obtaining the SkiaUnrefQueue through the IOManager is unsafe because
UIDartState has a weak pointer to the IOManager that can not be dereferenced
on the UI thread.
2019-10-21 14:15:03 -07:00
Kaushik Iska
8ed91e89cf Add templates to generate fuchsia host bundles (flutter/engine#13158)
This is part of an effort to separate generation of
host artifacts and target artifacts for fuchsia. The
`fuchsia_host_bundle` template aims to capture all the
artifacts that are specific to a given host.

The next step would be to bundle these are separate CIPD
packages for mac and linux (only x64 hosts)

internal planning doc: go/flutter-fuchsia-packaging
2019-10-21 12:51:38 -07:00
Matt Carroll
8f2cb01779 Adds Dark Mode support to new Android embedding (this was accidentally missed previously). (flutter/engine#13215) 2019-10-18 12:46:09 -07:00
Jacek Fedoryński
0b85f16f31 Add repeatCount to FlutterKeyEvent (flutter/engine#13176)
Adds repeatCount field to KeyEventChannel.FlutterKeyEvent. We set it
to the value returned by KeyEvent.getRepeatCount() and add it to the
message passed through the channel with the intention of exposing it
in RawKeyEventDataAndroid on the framework side.

flutter/flutter#42855
2019-10-18 10:39:19 -07:00
Chinmay Garde
0a7f937d04 Specify a human readable reason for an error from the embedder API. (flutter/engine#13218)
Fixes https://github.com/flutter/flutter/issues/42480
2019-10-17 17:29:37 -07:00
George Wright
60e88f7a6c Re-enable WeakPtr ThreadChecker and fix associated failures (flutter/engine#12257)
This re-enables thread safety checks for WeakPtr. WeakPtrs can't be used on a thread other than the one the WeakPtrFactory was created on.

This fixes the unit tests and adds a getUnsafe() method to WeakPtr to work around the remaining unresolved locations where we are using WeakPtr unsafely.
2019-10-17 14:10:16 -07:00
Chinmay Garde
d102e4086e Re-land "Custom compositor layers must take into account the device pixel ratio."
This reverts commit 674e5f911f1d19a0611b603968a8307415f75b35 and applies iOS fixes.
2019-10-17 14:07:51 -07:00