1211 Commits

Author SHA1 Message Date
Chris Yang
e5bc87a4cd Mutators Stack refactoring (flutter/engine#9663)
Rename methods in the MutatorsStack to Pascal case to match standard cpp style
Refactor the operator== for Mutator class
2019-07-03 11:18:14 -07:00
Kaushik Iska
3346b46ae7 ExternalViewEmbedder can CancelFrame after pre-roll (flutter/engine#9660)
* ExternalViewEmbedder can CancelFrame after pre-roll

- Resets the state so next pre-roll can be successful.
- Commit any pending `CATransaction` so we don't create
  nested transactions.

* Update flow/embedded_views.h
2019-07-03 08:38:19 -07:00
Kaushik Iska
4f307483d8 External view embedder can tell if embedded views have mutated (flutter/engine#9653)
* refactoring to move the mutator stack handling to preroll

* more review fixes

* Add support for external view embedded to know if it has changed

* remove the need to reset

* address comments

* Rename to HasPendingViewOperations
2019-07-03 07:28:53 -07:00
Chris Yang
cec3b15298 Move the mutators stack handling to preroll (flutter/engine#9651)
* refactoring to move the mutator stack handling to preroll

* more review fixes
2019-07-02 16:35:47 -07:00
Chris Yang
92ae45a714 make EmbeddedViewParams a unique ptr (flutter/engine#9640) 2019-07-02 13:27:12 -07:00
Chris Yang
102825d288 iOS PlatformView clip path (flutter/engine#9478) 2019-07-02 10:56:59 -07:00
Matt Carroll
ff8b678e99 Android Embedding Refactor PR31: Integrate platform views with the new embedding and the plugin shim. (flutter/engine#9206) 2019-07-01 17:34:37 -07:00
Chris Bracken
e2358a3ab6 Roll Dart to 67ab3be10d35d994641da167cc806f20a7ffa679 (flutter/engine#9638)
This is a reland of #9364 with fixes for Fuchsia.

000cf0560c clean up type_literal_test
0f20911022 Improve type_literal_test
a108bef7fb [vm, bytecode] Interpreter support for newer recognized natives.
2a15d38759 Revert "[llvm] Add initial scaffolding"
13b470ac46 Parse error expectations in tests.
b71d2d9996 [llvm] Add initial scaffolding
5f2bcd9d6c [vm/bytecode] Reuse flow graph building for recognized methods

This includes a breaking change: https://dart-review.googlesource.com/c/sdk/+/105241
```
  Dart_CreateIsolate -> Dart_CreateIsolateGroup
  Dart_IsolateCreateCallback -> Dart_IsolateGroupCreateCallback
  Dart_IsolateCleanupCallback -> Dart_IsolateGroupShutdownCallback
  Dart_CreateIsolateFromKernel -> Dart_CreateIsolateGroupFromKernel
  Dart_CurrentIsolateData -> Dart_CurrentIsolateGroupData
  Dart_IsolateData -> Dart_IsolateGroupData
  Dart_GetNativeIsolateData -> Dart_GetNativeIsolateGroupData
  Dart_InitializeParams.create -> Dart_InitializeParams.create_group
  Dart_InitializeParams.cleanup -> Dart_InitializeParams.shutdown_group
  Dart_InitializeParams.shutdown -> Dart_InitializeParams.shutdown_isolate
```
2019-07-01 15:47:49 -07:00
Matt Carroll
1596cc6c63 Fixes a plugin overwrite bug in the plugin shim system. (flutter/engine#9589) 2019-07-01 15:26:22 -07:00
Chris Bracken
f78c2ef4e3 Revert "Roll Dart to 67ab3be10d35d994641da167cc806f20a7ffa679 (#9634)" (flutter/engine#9637)
This broke the Fuchsia build.

This reverts commit aa7bc7923cb2a7811d49c3de8ce5fbe5bed96779.
2019-07-01 14:28:35 -07:00
Chris Bracken
aa7bc7923c Roll Dart to 67ab3be10d35d994641da167cc806f20a7ffa679 (flutter/engine#9634)
000cf0560c clean up type_literal_test
0f20911022 Improve type_literal_test
a108bef7fb [vm, bytecode] Interpreter support for newer recognized natives.
2a15d38759 Revert "[llvm] Add initial scaffolding"
13b470ac46 Parse error expectations in tests.
b71d2d9996 [llvm] Add initial scaffolding
5f2bcd9d6c [vm/bytecode] Reuse flow graph building for recognized methods

This includes a breaking change: https://dart-review.googlesource.com/c/sdk/+/105241
```
  Dart_CreateIsolate -> Dart_CreateIsolateGroup
  Dart_IsolateCreateCallback -> Dart_IsolateGroupCreateCallback
  Dart_IsolateCleanupCallback -> Dart_IsolateGroupShutdownCallback
  Dart_CreateIsolateFromKernel -> Dart_CreateIsolateGroupFromKernel
  Dart_CurrentIsolateData -> Dart_CurrentIsolateGroupData
  Dart_IsolateData -> Dart_IsolateGroupData
  Dart_GetNativeIsolateData -> Dart_GetNativeIsolateGroupData
  Dart_InitializeParams.create -> Dart_InitializeParams.create_group
  Dart_InitializeParams.cleanup -> Dart_InitializeParams.shutdown_group
  Dart_InitializeParams.shutdown -> Dart_InitializeParams.shutdown_isolate
```
2019-07-01 12:55:57 -07:00
Tamir Duberstein
d648992aa4 [all] add fuchsia.{net.NameLookup,posix.socket.Provider} (flutter/engine#9546)
These services will replace fuchsia.net.SocketProvider.

Note that dart_{aot,jit}_product_runner.cmx were invalid before this
change. I'm not sure how that was allowed to happen.
2019-06-30 13:07:41 -07:00
Jason Simmons
a55cd21da3 Fix a race in the embedder accessibility unit test (flutter/engine#9585) 2019-06-30 12:50:44 -07:00
Chinmay Garde
0d8f0955d5 Wire up custom event loop interop for the GLFW embedder. (flutter/engine#9089) 2019-06-29 19:35:22 -07:00
Chris Bracken
682f2e53e1 [trace clients] Remove fuchsia.tracelink.Registry (flutter/engine#9593)
... replaced by fuchsia.tracing.provider.Registry.

PT-127

Change-Id: I8e1243e28292a2442c1ceb3b685a79979bd0bd42

This is a followup to 76599141095069c12160b0c079d1dddf9809552c.
Ported from the Topaz tree.
2019-06-29 00:58:15 -07:00
Chris Bracken
ab721c3db7 [crash] switch to async crash analysis
with the synchronous call, this actually blocks the Flutter component
from serving its out/directory and prevents the Inspect synchronous
discovery

DX-1568 #done #comment

TESTED=`fx shell run fuchsia-pkg://fuchsia.com/crasher_dart#meta/crasher_dart.cmx` (report id 0b59643af026bc37)
TESTED=`fx shell sessionctl add_mod fuchsia-pkg://fuchsia.com/crasher_flutter#meta/crasher_flutter.cmx` then clicked on "Th

Change-Id: I8b0abd1034dba66cd7bb1d6768322cab36ed453b

Ported from Topaz tree.
2019-06-28 17:40:00 -07:00
Chris Bracken
c58d26f718 [dart/flutter_runner] Copy package.resolved_url for TRACE_DURATION
Ensure that the string data backing package.resolved_url is not modified
or moved by making a copy to pass as the argument value for
TRACE_DURATION.

PT-169 #comment

Change-Id: I1ef6ab9b1ecf350e82134d1d616a841611ac19c6

Ported from Topaz tree.
2019-06-28 17:40:00 -07:00
Chris Bracken
9dc7ebcdf4 [meta] add fuchsia.{net.NameLookup,posix.socket.Provider}
These protocols will replace fuchsia.net.SocketProvider.

Change-Id: I1425aa8b32c82e68f6176f5ffd8d8a9149b52de6

Ported from Topaz tree.
2019-06-28 17:40:00 -07:00
Chris Bracken
b3c911c9fc [flutter] Re-enable unhandled error reporting
This re-enables unhandled Dart error handling in Flutter applications,
which was removed in a76b958.

The error handling as originally landed was unsafe. Specifically, in the
case where the unhandled error handler was triggered during shutdown,
there was a race condition which could cause a crash in the following
scenario:
1. Runner::OnApplicationTerminate() is triggered, which posts a task to
   the application's platform thread will free the Application instance
   and terminate the platform thread.
2. Before that task is serviced, the unhandled error handler is called
   (by hooks.dart -> window.cc -> ui_dart_state.cc) on the UI thread.
3. The kill task is serviced and the Application dtor and Thread::Quit()
   are called, terminating the platform thread.
4. The unhandled error handler attempts to post a task to the platform
   thread, whose thread was killed in step 3. This triggers a crash.

Fixing this requires a mechanism for the message loop to know that the
associated thread has been terminated out from under it.

This patch adds mitigation for this scenario, but remains
non-threadsafe/racy. We pass the unhandled error handler a weak pointer
to the Application and check it before posting a task to the platform
thread. This has two issues:
1. WeakPtr isn't threadsafe, and assumes that all operations occur on a
   single thread. We're checking its value (which is mutated on the
   platform thread) on the UI thread without synchronization.
2. Even with a guarantee that the WeakPtr state were synchronized,
   there's a window between when we check the weak pointer and when we
   post to the platform thread in which application shutdown and thread
   destruction may occur.

This unsafe mitigation is being landed in order to unblock a high
priority bug (FL-256) on a short schedule, and a proper refactoring will
be required to make this properly threadsafe.

Change-Id: If60d1d3ca5799d82597f8a3acc4ddd3871058972

Ported from Topaz tree.
2019-06-28 17:40:00 -07:00
Chris Bracken
d4ee1f4c3b [flutter_runner] Rename outgoing 'public' to 'svc'.
This is the topaz counterpart to
https://fuchsia-review.googlesource.com/c/fuchsia/+/277254.

This is a backwards-incompatible ABI change that will be landed together
with that CL. All clients have been migrated to be compatible with the
new ABI.

Change-Id: I07bb460ce3c6971eb671874db1f90e8c4906e656

Ported from Topaz tree.
2019-06-28 17:40:00 -07:00
Chris Bracken
7659914109 [trace clients] Remove fuchsia.tracelink.Registry
... replaced by fuchsia.tracing.provider.Registry.

PT-127

Change-Id: I8e1243e28292a2442c1ceb3b685a79979bd0bd42

Ported from Topaz tree.
2019-06-28 17:40:00 -07:00
Chris Bracken
e369245671 [flutter_runner] use external image create info
DX-939 #progress
MA-394 #progress

This informs the vulkan driver that we're creating an image
that will be backed by external memory. The driver driver can
decide to use different memory requirements based on the if
memory for the image can be exported or not.

No change in behavior. Existing tests (modular_tests,
scenic_tests, etc.) are sufficient and regressions will be
prevented by running these tests on aemu.

Test: fx shell run fuchsia-pkg://fuchsia.com/basemgr#meta/basemgr.cmx --base_shell=fuchsia-pkg://fuchsia.com/spinning_cube#
Change-Id: I489318c2e31f752f76c80a81245e203861d44d94

Ported from Topaz tree.
2019-06-28 17:40:00 -07:00
Chris Bracken
03d65cc0c5 [trace clients] Add fuchsia.tracing.provider.Registry to cmx files
... being renamed from fuchsia.tracelink.Register.
fuchsia.tracelink.Registry will be removed after change lands in fuchsia.

PT-127

Change-Id: Ie876228cf9d1e6fb052877e65b47918fdd0b9696

Ported from Topaz tree.
2019-06-28 17:40:00 -07:00
Chris Bracken
51327088f6 [trace clients] Replace trace-provider with trace-provider-with-fdio
PT-63

Change-Id: I9acd5aeba5f82e6d58ec324f0f64bf109a413410

Ported from Topaz tree.
2019-06-28 17:40:00 -07:00
Amir Hardon
77a2f1c89b Revert "Avoid a full screen overlay within virtual displays (#9343)" (flutter/engine#9581)
This reverts commit 2b66f64511df7de1404802aab5ccbdbb8587244e.
2019-06-28 13:43:23 -07:00
gaaclarke
579cc2d83f Fixed memory leak by way of accidental retain on implicit self (flutter/engine#9329)
Fixed memory leak by way of accidental retain on implicit self.
2019-06-28 10:22:51 -07:00
gaaclarke
3dbca7037f Switched preprocessor logic for exporting symbols for testing. (NDEBUG (flutter/engine#9562)
wasn't working for Luci builds).
2019-06-27 18:03:59 -07:00
gaaclarke
67ef386e9f Has a binary messenger (flutter/engine#9419)
Made the engine and the view controllers have BinaryMessengers, not be
BinaryMessengers.  This allows us to break retain cycles and makes the
leaking channels we have not less dire.
2019-06-27 17:25:32 -07:00
Chinmay Garde
8182a56965 Re-enable embedder_unittests. (flutter/engine#9482)
This was disabled in https://github.com/flutter/engine/pull/6798 waiting for
a Dart SDK patch to land e6d3a45b6a
which has long since been addressed.
2019-06-27 16:49:22 -07:00
Qxyat
43b63e842d fix FlutterOverlayView doesn't remove from superview in some cases (flutter/engine#9532) 2019-06-27 09:07:52 -07:00
Chris Bracken
ec9d1c5e50 Roll Fuchsia SDK to latest (flutter/engine#9509)
This rolls to CIPD package versions:
macOS SDK: pWygawI3vBzP9dYloEvKka8r1p0NpLLZzZQ-yMYI1UIC
Linux SDK: L_ORUWXyDEC29pSiSyKIwGqcFMQFsV91E3h_wPbUIUkC

Applies two breaking changes from the SDK:
* `zx_clock_get_new()` has been eliminated and replaced with
  `zx_clock_get()`. See:
  https://fuchsia-review.googlesource.com/c/fuchsia/+/293688
* Scenic `Metrics` no longer supports operator==; instead we use
  `fidl::Equals()`.
2019-06-26 17:16:16 -07:00
Kaushik Iska
f6482d46e2 [android] External textures must be rescaled to fill the canvas (flutter/engine#9501)
* [android] External textures must be rescaled to fill the canvas

- After composition, we have a tight box that we need to fill.

- Video decoders typically operate using output buffers that are a whole
  number of blocks (vertically and horizontally). This fixes
  https://github.com/flutter/flutter/issues/34641 where the decoded
  dimensions are rounded up.

- The cropping information for the current frame arrives in the form of
  `SurfaceTexture.getTransformMatrix`. When we apply this transform we
  need to account for the fact that we have already composited. This
  means that in cases where the scaleX, scaleY are less than 1, we need
  to rescale the image. We do this while preserving the aspect ratio.
2019-06-26 13:51:14 -07:00
Dan Field
9b08763a75 Purge caches on low memory on iOS (flutter/engine#9491) 2019-06-25 20:47:55 -07:00
Chris Yang
f93174d33e fix build breakage on PlatformViews.mm (flutter/engine#9495) 2019-06-25 18:26:31 -07:00
Chris Yang
1c66c0866e fix a bug where the platform view's transform is not reset before set frame (flutter/engine#9490) 2019-06-25 17:43:21 -07:00
Chris Yang
bb909453ea Reland "IOS Platform view transform/clipping (#9075)" and fix the breakage. (flutter/engine#9483)
* Revert "Revert "IOS Platform view transform/clipping (#9075)" (#9480)"

This reverts commit 52ceaee505a26b6bad893e38b33c522d1e0ba571.

* fix fuschia buid
2019-06-25 15:29:47 -07:00
Jason Simmons
e4a2320fdd Simplify loading of app bundles on Android (flutter/engine#9360)
* Remove deprecated runBundle APIs
* Remove code related to dynamic patching (including support for multiple
  bundle paths)
* Change FlutterRunArugments.bundlePath to be the Android AssetManager path
  where the app's assets are located
2019-06-25 14:17:50 -07:00
Chris Bracken
52ceaee505 Revert "IOS Platform view transform/clipping (#9075)" (flutter/engine#9480)
This reverts commit 5625d01b324f5a0d94aaa916d9e08fd038e363b3.

Seeing the following breakage on host build:
```
../../flutter/flow/scene_update_context.cc:205:36: error: non-const lvalue reference to type 'flutter::MutatorsStack' cannot bind to a value of unrelated type 'const flutter::Stopwatch'
                                   frame.context().raster_time(),
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../flutter/flow/scene_update_context.cc:207:36: error: no viable conversion from 'flutter::TextureRegistry' to 'const flutter::Stopwatch'
                                   frame.context().texture_registry(),
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../flutter/flow/instrumentation.h:55:32: note: candidate constructor not viable: no known conversion from 'flutter::TextureRegistry' to 'const flutter::Stopwatch &' for 1st argument
  FML_DISALLOW_COPY_AND_ASSIGN(Stopwatch);
                               ^
../../flutter/fml/macros.h:28:3: note: expanded from macro 'FML_DISALLOW_COPY_AND_ASSIGN'
  TypeName(const TypeName&) = delete;          \
  ^
../../flutter/flow/scene_update_context.cc:208:36: error: non-const lvalue reference to type 'flutter::TextureRegistry' cannot bind to a temporary of type 'flutter::RasterCache *'
                                   &frame.context().raster_cache(),
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../flutter/flow/scene_update_context.cc:209:36: error: cannot initialize a member subobject of type 'const flutter::RasterCache *' with an rvalue of type 'bool'
                                   false};
                                   ^~~~~
```
2019-06-25 10:48:37 -07:00
Amir Hardon
e49d31bbec fix NPE when a touch event is sent to an unknown Android platform view (flutter/engine#9476) 2019-06-25 09:45:20 -07:00
Chris Yang
5625d01b32 IOS Platform view transform/clipping (flutter/engine#9075) 2019-06-25 09:33:50 -07:00
Matt Carroll
59bd2aecc0 Removed unused imports in new embedding. (flutter/engine#9463) 2019-06-25 01:59:33 -07:00
Matt Carroll
71e9854a33 Fixed logLevel filter bug so that filter now works as expected. (flutter/engine#9460) 2019-06-24 23:03:42 -07:00
Amir Hardon
110c63afaf Don't hang to a platform view's input connection after it's disposed (flutter/engine#9423)
Addresses the crash reported in https://github.com/flutter/flutter/issues/19718#issuecomment-504174596
2019-06-24 13:13:00 -07:00
Chris Bracken
009ba77bda Eliminate unused import in FlutterView (flutter/engine#9439)
Eliminates an unused import in FlutterView.java. Fixes import ordering.
2019-06-24 11:17:18 -07:00
Matt Carroll
084284d533 Resolves embedding log chattyness by gating verbose, debug, and info logs by level (#34876). (flutter/engine#9425) 2019-06-21 16:40:32 -07:00
Amir Hardon
2203181ff2 delegate checkInputConnectionProxy to the relevant platform view (flutter/engine#9426)
The previous logic allowed proxying for any view that belonged to one of the platform views' virtual displays which may lead to us allowing proxying for a view that the platform view isn't allowing proxying for, previous logic also didn't account for unattached views.

This change instead delegates the decision to the platform view.

We use the fact that each virtual display has its unique context to associate any view with its relevant virtual display.

A nice side effect of calling the platform view's checkInputConnectionProxy for webviews is that the plugin now has a way to get a handle to the ThreadedInputConnectionProxyView, which may be useful for getting keyboard working on webview's prior to Android N.
2019-06-21 14:30:58 -07:00
gaaclarke
5ff4512832 Added unit tests for the ios code. (flutter/engine#9388)
* Added unit tests for the ios code.

* Moved the tests to live next to the source.

* Added mocking library.

* Fixed formatting and removed third_party from the format check.

* fixed formatting 2

* Removed ocmock from third_party.

* Added ocmock to third_party, compile from source.

* removed ocmock from license checking

* updated licenses_flutter

* updated tool_signature
2019-06-20 17:37:03 -07:00
Matt Carroll
78bd3aa73b Android Embedding Refactor PR35: Ensure all JNI methods are in FlutterJNI (#34751). (flutter/engine#9391) 2019-06-20 17:13:58 -07:00
Simon Lightfoot
2b66f64511 Avoid a full screen overlay within virtual displays (flutter/engine#9343)
Add views that are added directly to a platform view's window as siblings to the platform view's container view, rather than as children of a full screen container.

This prevents a false-negative for a visibility check from a specific ads SDK (Teads), which [reported the following warning](https://github.com/flutter/flutter/issues/12114#issuecomment-500906158):
```
W/teads#Visibility(17978): The Teads AdView is visible at 0%, hidded by 1 View(s):
W/teads#Visibility(17978):   -  View of class io.flutter.plugin.platform.SingleViewPresentation$FakeWindowViewGroup, with id: -1, with contentDescription: null, with a size of: [width: 1050, height: 875] is hidding 100% of the ad
```
2019-06-20 16:46:26 -07:00
Chris Yang
725e33773d Workaround fix the platform view dismiss crash related to gl (flutter/engine#9377) 2019-06-20 11:52:52 -07:00