1876 Commits

Author SHA1 Message Date
Chris Yang
68754a85f0 Revert "Reland "Guarding EAGLContext used by Flutter #13314" (#13755)" (flutter/engine#13757)
This reverts commit a4a346f317c867663a6d8a5d9c7909101d9b5cbd.
2019-11-08 13:44:29 -08:00
Chris Yang
a4a346f317 Reland "Guarding EAGLContext used by Flutter #13314" (flutter/engine#13755) 2019-11-08 12:26:48 -08:00
Chris Yang
af43ff4a31 Revert "Always use IOSGLContextSwitch to access EAGLContexts to prevent plugins from polluting Flutter's EAGLContext (#13314)" (flutter/engine#13753) 2019-11-08 10:59:45 -08:00
Chris Yang
4953fbdd3f Always use IOSGLContextSwitch to access EAGLContexts to prevent plugins from polluting Flutter's EAGLContext (flutter/engine#13314) 2019-11-08 10:02:23 -08:00
Chinmay Garde
a8b3ff268a Create a new picture recorder even when the embedder supplied render target is recycled. (flutter/engine#13744)
The earlier assumption was that the render target would be re-materialized per frame. The render target needs its own picture recorder to be create per frame as well. When render targets are cached in the registry, an existing target will be reused. But submitting the previous frame would have discarded the recorder already. The layer tree paint would then attempt to dererence a null canvas causing a crash at runtime.

Added tests to ensure that this does not happen both with and without a custom compositor specified by the embedder. I am going to rework this code so that the external view embedders thinks of render target access on a per frame basis but that is a larger change. This smaller patchset should unblock broken builds.

Fixes b/144093523
2019-11-07 19:53:51 -08:00
Matt Carroll
d024332cdf Removed scary experimental warnings for new embedding. (#44314) (flutter/engine#13738) 2019-11-07 22:54:10 +00:00
chunhtai
5e7e183369 Revert "Issues/39832 reland (#13642)" (flutter/engine#13720)
This reverts commit a1824112a46ba1968217be011efd19d528330127.
2019-11-06 11:41:36 -08:00
Chinmay Garde
a0fd895dfb Ensure that the device pixel ratio is taken into account with window metrics in physical pixels. (flutter/engine#13708)
This was originally patched in https://github.com/flutter/engine/pull/13193 but
the unit-tests were written under the mistaken assumption (that has been
documented already) that the Flutter window metrics used logical pixel
coordinates. That mistake has been corrected and additional tests to verify
rendering intent has been added.

Fixes https://github.com/flutter/flutter/issues/43906
Fixes https://b.corp.google.com/issues/143529469
2019-11-06 11:16:18 -08:00
Jason Simmons
70d674fd14 Fix NPE in splash screen lookup (flutter/engine#13719) 2019-11-06 10:31:41 -08:00
Matt Carroll
2ddf0e8cf4 Fix splash screen lookup. (#44131) (flutter/engine#13660) 2019-11-06 04:37:48 +00:00
Greg Spencer
1b80f40efa Fix editing selection and deletion on macOS (flutter/engine#13702)
This fixes the selection and deletion during text editing on macOS so that it can handle selections that have a base (selection start) that is after the extent (selection end) in the string.

Apparently the insertText:replacementRange on macOS can supply an NSRange object that has negative values for the length (even though the length is an unsigned NSUInteger). This change checks for that case, and fixes the range of characters replaced in the text to have the right bounds.

Also, I added an additional updateEditState after the state is set from the framework, since there is a timing problem: when the delete key is pressed, it sends an insertText message, which updates the framework state after the framework has already sent its state update to delete the selected region. This additional updateEditState puts the engine and framework back in sync again. Ideally, we would just avoid sending the insertText message, but there's really no way for the engine to know if the pressed key is part of an edit sequence or not.
2019-11-05 19:17:52 -08:00
Filip Filmar
8cb106f918 [fuchsia] Temporarily disable intl provider (flutter/engine#13696)
The intention of the property provider is to try to connect, not
bail out if connection is not possible.

This code tried to connect unconditionally, which is not what we wanted.
Removing this initialization code to enable a roll, and will fix in a
followup.
2019-11-05 18:51:37 -08:00
Matt Carroll
9c4534c7dd Fix plugin registrant reflection path. (#44161) (flutter/engine#13698) 2019-11-05 23:36:35 +00:00
Darren Austin
bb82d46bdb Added Semantic header support on Android. (flutter/engine#13262)
Added Semantic header support on Android.
2019-11-05 15:27:25 -08:00
Darren Austin
b9c225a35d Fixed the scroll direction for iOS horizontal accessibility scroll events. (flutter/engine#13651)
* Fixed the scroll direction for horizonatal accessibilty scroll events.

* Updated the comment describing the scroll direction mapping.
2019-11-05 15:25:18 -08:00
chunhtai
a1824112a4 Issues/39832 reland (flutter/engine#13642)
* Reland "Added new lifecycle enum (#11913)"
2019-11-05 14:52:16 -08:00
Jason Simmons
3c3c69c4af Fix Class.forName unchecked call warning (flutter/engine#13695) 2019-11-05 13:45:57 -08:00
Chinmay Garde
df53c9f095 Ensure that the CAMetalLayer FBO attachments can be read from. (flutter/engine#13643)
By default, the CAMetalLayer backing store is a framebuffer attachment that is
only optimized for display. However, effects such as backdrop filters require
renderbuffer readback. Making this calls will result in exceptions. Disable the
write only optimization on such backing store.

Fixes https://github.com/flutter/flutter/issues/43555
2019-11-04 17:28:51 -08:00
chunhtai
2958712751 Revert "Added new lifecycle enum (#11913)" (flutter/engine#13632)
This reverts commit 583e1335bbf9842ff4dc349021c6c71e6141fffe.
2019-11-04 13:40:20 -08:00
chunhtai
583e1335bb Added new lifecycle enum (flutter/engine#11913) 2019-11-04 12:33:41 -08:00
xster
7e3e60d902 Release shim bindings when detaching (flutter/engine#13432) 2019-11-01 17:53:15 -07:00
George Wright
b192907898 Add fuchsia.intl.PropertyProvider to our services on Fuchsia (flutter/engine#13486)
This resolves the following error on Fuchsia: Component fuchsia-pkg://fuchsia.com/flutter_aot_product_runner#meta/flutter_aot_product_runner.cmx is not allowed to connect to fuchsia.intl.PropertyProvider because this service is not present in the component's sandbox.
2019-11-01 16:13:12 -07:00
Filip Filmar
4efcbb18d8 [dart] Makes the intl services available (flutter/engine#13460)
This registers that the dart runner requires
`fuchsia.intl.PropertyProvider` service.  It is a way for the runner
to discover the system locale.
2019-11-01 16:04:49 -07:00
Dan Field
9b6d00c6fe Request a reattach when creating the text input plugin on Android (flutter/engine#13474) 2019-11-01 15:29:33 -07:00
Dan Field
5ac5df1fdd Fix mDNS for iOS13 (flutter/engine#13451) 2019-11-01 15:29:15 -07:00
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