1914 Commits

Author SHA1 Message Date
Chris Bracken
8a0cc94b1a Compile embedder unit test Dart to kernel (flutter/engine#7231)
As of the migration to Dart 2, it has been necessary to compile Dart to
kernel prior to execution. The embedder currently requires that the
resulting kernel file be named `kernel_blob.bin` and be located at the
root of the assets directory passed to the embedder API.

This patch updates the test_fixtures build rule to perform a kernel
compile using frontend_server, outputting `kernel_blob.bin` to
`fixtures/test_target_name` directory, and updates the embedder
unittests to specify the kernel file rather than the Dart source file.

Since the kernel compiler requires a `main()` function to be defined, it
also updates `simple_main.dart` from runtime_unittests to define
`main()` rather than `simple_main()`.

This also updates all existing sub-targets to be testonly.

This relands commit 4e4fb4608da95d198b0e796478462285ab974a3c, which was
reverted in commit 566db0ecb8f293bb9f7ff1fc39076b08336e0148. Rather than
running as prebuilt_dart_action, we use dart_action to ensure the
frontend snapshot it compatible with the VM on which it's executed.
2018-12-16 12:23:18 -08:00
Chris Bracken
566db0ecb8 Revert "Compile embedder unit test Dart to kernel (#7227)" (flutter/engine#7230)
This reverts commit 4e4fb4608da95d198b0e796478462285ab974a3c.

This broke dynamic release mode builds of
//flutter/runtime:runtime_fixtures_kernel (likely all product-mode
builds).
2018-12-15 14:43:26 -08:00
Chris Bracken
4e4fb4608d Compile embedder unit test Dart to kernel (flutter/engine#7227)
Compile embedder unit test Dart to kernel

As of the migration to Dart 2, it has been necessary to compile Dart to
kernel prior to execution. The embedder currently requires that the
resulting kernel file be named `kernel_blob.bin` and be located at the
root of the assets directory passed to the embedder API.

This patch updates the test_fixtures build rule to perform a kernel
compile using frontend_server, outputting `kernel_blob.bin` to
`fixtures/test_target_name` directory, and updates the embedder
unittests to specify the kernel file rather than the Dart source file.

Since the kernel compiler requires a `main()` function to be defined, it
also updates `simple_main.dart` from runtime_unittests to define
`main()` rather than `simple_main()`.

This also updates all existing sub-targets to be testonly.
2018-12-15 13:59:58 -08:00
Ian Hickson
59f0587095 Undeprecated BigInteger support, but document what it actually does. (flutter/engine#6903) 2018-12-15 08:32:20 -08:00
Anthony Bullard
28d536a39a Support real fonts in 'flutter test' (flutter/engine#6913)
* Support real fonts in 'flutter test'

Change the order of font_managers to query in font_collection
so that dynamic_font_manager fonts will be resolved.

Tested with test case in `flutter/flutter` repo:

`packages/flutter/test/rendering/localized_fonts_test.dart`

Ensured:
- A font loaded with FontLoader will be used
- The default 'Ahem' font is still loaded by default

The test above still cannot be fixed because FontLoader and the
underlying mechanisms don't cover Locale-specific font loading
and therefore a CJK font-family won't be able to be loaded as needed
for that test.

Fixes #17700

* Format fixup
2018-12-14 10:05:41 -08:00
jslavitz
0abb1665f5 Adds force cursor support (flutter/engine#6945)
* engine force cursor support
2018-12-13 18:45:38 -08:00
Chris Bracken
23db336526 [Fuchsia] Depend on libtrace when that is what's really meant (flutter/engine#7214)
libtrace-provider has libtrace listed as a dependency when really it
does not have any such dependency. This lets trace clients use
libtrace-provider as a dependency when what they really mean is libtrace.

This errant dependency in trace-provider is being fixed, which
means we need to fix these clients.
2018-12-13 13:13:38 -08:00
Stanislav Baranov
255b2e2f89 Downloading and installation of dynamic updates on Android (flutter/engine#7207) 2018-12-13 10:17:37 -08:00
Justin McCandless
4e82db460b Update marked text before selection so textInRange is never called with (flutter/engine#6989)
invalid input
2018-12-12 15:32:36 -08:00
liyuqian
efc116e72c Support querying display refresh rate in engine (flutter/engine#7002)
The current implementation only deals with Android devices and we'll add iOS devices support soon.
2018-12-12 10:28:44 -08:00
Brian Salomon
8d1c545b53 Remove unnecessary includes of Ganesh headers (flutter/engine#7189) 2018-12-12 10:58:14 -05:00
Rafael Ring
5755e8b956 Fix keyboard not showing for targetSdk 28 (flutter/engine#6985)
After bumping the targetSdk of Flutter apps to 28, the keyboard doesn't open anymore when inputting text on an Android Pie devices. The problem is caused by a change on the way the focus in handled: when the call `mImm.showSoftInput(view, 0);` is made, the currently focused view is the `DecorView` from the `Activity` hosting Flutter but the passed view reference (`view` argument) is the `FlutterView`. As the `InputMethodManager` checks if both views are the same before showing the keyboard, it never appears because the `FlutterView` never has focus.
As Flutter doesn't have any input views as far as the Android side is concerned, the focus should always stay on the `FlutterView` itself and thus, this PR changes the `TextInputPlugin` to focus on the `FlutterView` as soon as it's created, fixing the keyboard issue.

Co-authored-by: Igor Borges <igorborges12@gmail.com>
2018-12-10 21:01:12 -08:00
Chris Bracken
1954a183a9 Eliminate obsolete FlutterDartProject initializers (flutter/engine#6967)
Technically both of these are part of the public API exposed in
Flutter.framework. Neither is used within Flutter itself, and both have
been broken since the removal of Dart 1 support, so eliminating rather
than marking unavailable.
2018-12-10 17:07:00 -08:00
Jason Simmons
4edb0f1f99 Handle null bundlePaths in FlutterRunArguments (flutter/engine#7161) 2018-12-10 14:38:44 -08:00
Chris Bracken
f604da6409 Rename dart-non-checked-mode: disable-dart-asserts (flutter/engine#6977)
In Dart 2, runtime checked mode has been eliminated. Many of these type
checks have been moved to static compile-time checks, the remainder are
enforced at runtime, and are no longer optional.
2018-12-10 12:36:09 -08:00
Stanislav Baranov
194bf111b6 Generalize runFromBundle to support multiple bundlePaths (flutter/engine#7151) 2018-12-10 12:19:22 -08:00
Chris Bracken
120c20d5c6 Eliminate main_dart_file_path, package_file_path (flutter/engine#6973)
These settings were specific to Dart 1 and are no longer used in the
engine. This eliminates them from the Settings class.
2018-12-10 09:12:10 -08:00
Gary Qian
e0b4ecead4 Prepend [NSLocale currentLocale] for first locale on iOS to ensure countryCode exists. Allow language-only locales. (flutter/engine#6995) 2018-11-28 12:59:57 -08:00
Michael Goderbauer
41fdd03757 Fix EXIF orentation problem (flutter/engine#6974) 2018-11-27 14:12:13 -08:00
Chris Bracken
c2c439fd0a Use application_kernel_asset in flutter_tester (flutter/engine#6972)
Since the migration to Dart 2, the first positional command-line
argument to flutter_tester has been a Dart kernel .dill file. Use
Settings::application_kernel_asset here for consistency/clarity.
2018-11-27 13:51:54 -08:00
Chris Bracken
9555fe0167 Improve error message when kernel not set (flutter/engine#6924)
Pushes the check up front so that we don't always land on the
application_kernel_list_asset error message, which may be misleading to
readers.

Also switches the empty check to only emit in debug builds, since this
is almost certainly not a runtime error but a programmer error.
2018-11-26 11:29:56 -08:00
Chris Bracken
a962e06150 Use software renderer in embedder unittests (flutter/engine#6928)
Reduces spurious error log messages in GLContextMakeCurrent() attempting
set up the GR context:

  [ERROR:flutter/shell/gpu/gpu_surface_gl.cc(42)] Could not make the context current to setup the gr context.
2018-11-26 10:48:37 -08:00
Dan Field
de29fc152a load default splash screen when not init with engine (flutter/engine#6925) 2018-11-21 15:06:08 -08:00
Chris Bracken
30ca2a3401 Add basic validation on loading from kernel list (flutter/engine#6921)
Adds a check/error message for the case where running from kernel list,
but application_kernel_list_asset is left unset (or empty).

Adds a check/error message for the case where we fail to load the
application_kernel_list_asset specified in the settings.
2018-11-21 10:31:32 -08:00
Jason Simmons
725295dc47 Keep a copy of each engine's description that can be accessed outside the engine's UI thread (flutter/engine#6885)
The service protocol's ListViews method needs to return description data for
each engine in the process.  Previously ListViews would queue a task to each
UI thread to gather this data.  However, the UI thread might be blocked from
executing tasks (e.g. if the Dart isolate is paused), resulting in a deadlock.

This change provides a copy of the engine's description data to the
ServiceProtocol's global list of engines, allowing ListViews to run without
accessing any UI threads.

Fixes https://github.com/flutter/flutter/issues/24400
2018-11-16 14:47:40 -08:00
Dan Field
21a8e9f365 Don't load a splash screen by default (flutter/engine#6883) 2018-11-16 12:43:18 -08:00
Jason Simmons
76d8335949 Reland "Clean up stale cache entries in Skia's GrContext" (flutter/engine#6867)
Check for software rendering modes that do not have a GrContext
2018-11-15 14:24:36 -08:00
Michael Goderbauer
ed65ad873b Fix license headers (flutter/engine#6868)
These sneaked in between https://github.com/flutter/engine/pull/6757 and https://github.com/flutter/engine/pull/6759.
2018-11-15 14:12:57 -08:00
Dan Field
0c9b475c2a Revert "Clean up stale cache entries in Skia's GrContext (#6859)" (flutter/engine#6866)
This reverts commit 929c7d8d8b0fbb72866bf3e4925187f76be0c955.
2018-11-15 11:41:53 -08:00
Michael Klimushyn
366503ca2d Disable the persistent cache (flutter/engine#6835)
Fixes flutter/flutter#24058
Reopens flutter/flutter#14028
2018-11-15 09:26:08 -08:00
Jason Simmons
929c7d8d8b Clean up stale cache entries in Skia's GrContext (flutter/engine#6859)
Fixes https://github.com/flutter/flutter/issues/24160
2018-11-14 14:21:17 -08:00
Ben Konyi
d4cedc97b4 Added delegate forwarding for didReceiveLocalNotification and willPresentNotification (flutter/engine#6858) 2018-11-14 11:39:47 -08:00
Dan Field
3ce4d16b63 Reset a11y bridge state on hot restart (flutter/engine#6857) 2018-11-14 11:13:39 -08:00
Dan Field
be56cd051e Set and unset accessibility flags even when re-entrant (flutter/engine#6853)
* Make sure to not unset a11y flags on reentrant calls to API
2018-11-13 23:54:45 -08:00
Michael Goderbauer
43b1be3219 Remove unused import (flutter/engine#6854) 2018-11-13 23:31:56 -08:00
Dan Field
102f6ea1c9 Avoid a never-disappearing splash screen if the engine came from somewhere else on iOS (flutter/engine#6834)
* Ignore multiple attemps to set splash screen, print warning
2018-11-13 16:04:09 -08:00
Michael Goderbauer
082336e7c2 Fix code smells reported by chrome's clang plugin (flutter/engine#6833) 2018-11-12 19:59:29 -08:00
Dan Field
877b3996d8 Avoid announcing text field when it lacks a11y focus (flutter/engine#6830)
* Avoid announcing text field when it lacks a11y focus
2018-11-12 16:08:59 -08:00
Amir Hardon
3438348516 Release the surface texture entry when the platform view is disposed. (flutter/engine#6829)
We were leaking the texture after the view was disposed.
2018-11-12 14:23:25 -08:00
Jason Simmons
16a1ab8413 Fix MakeRenderContextCurrent to handle software rendering (flutter/engine#6827) 2018-11-12 11:20:49 -08:00
Jason Simmons
c1c5977c07 Ensure that the EGL rendering context is bound to the GPU thread in Rasterizer::MakeRasterSnapshot (flutter/engine#6816)
Fixes https://github.com/flutter/flutter/issues/24083
2018-11-09 17:05:05 -08:00
Dan Field
a03e311cb0 fix log (flutter/engine#6817) 2018-11-09 16:46:49 -08:00
Amir Hardon
e818420245 Synchronize Flutter's rendering with CA. (flutter/engine#6807)
Right now we do it whenever the platform views preview flag is on.
This is less efficient, filed
https://github.com/flutter/flutter/issues/24133 to only do this when
there's a platform view in the tree.
2018-11-09 12:10:09 -08:00
Amir Hardon
18f0d35d05 Move the embedded view preview flag check to a common function. (flutter/engine#6813) 2018-11-09 11:24:14 -08:00
Amir Hardon
818cccfd47 Fix wrong flutter/platform_views protocol implementation on iOS. (flutter/engine#6803)
The `id` parameter of onDispose is passed as the method argument and not as
part of a map.
2018-11-09 10:21:44 -08:00
Amir Hardon
bfc1db2612 Support platform view overlays with GL rendering (flutter/engine#6769)
Moved the frame buffer specific logic from IOSGLContext to IOSGLRenderTarget.

use recording canvases for overlays

Support platform view overlays with gl rendering.

This also changes the overlay canvases (for both software and gl
rendering) be recording canvases, and only rasterize them after
finishing the paint traversal.
2018-11-08 19:52:43 -08:00
Amir Hardon
df64376478 Make the FlutterPlatformViewFactory create FlutterPlatformViews. (flutter/engine#6782)
Handing a UIView refererence directly to the engine makes it challenging
for plugin authors to retain a controller for that UIView (e.g the
controller that talks over the platform channel) for as long as the
embedded view is needed.

We instead make the factory return a FlutterPlatformView which is a
wrapper around the UIView that the engine retains as long as the
platform view instance is needed. This allows plugin authors to keep
their control logic in the FlutterPlatformView and know that the engine
is responsible for retaining the reference.
2018-11-08 11:21:55 -08:00
Dan Field
3446f04895 Fix mDNS publishing for iOS simulator (flutter/engine#6789)
* Don't block the platfrorm thread on simulator mDNS publishing
2018-11-08 11:18:59 -08:00
Amir Hardon
cbfe0c6713 Discard embedded UIViews on hot restart. (flutter/engine#6772) 2018-11-08 09:32:01 -08:00
Amir Hardon
d6e19afcb5 Add an internal_nodes_canvas to PaintContext. (flutter/engine#6728)
When we visit a PlatformViewLayer during the paint traversal it replaces
the PaintContext's canvas with a new one that is painted ontop of the
embedded view.
We need to make sure that operations applied by parent layers are also
applied to the new canvas.

To achieve this we collect all the canvases in a SkNWayCanvas and use
this canvas by non leaf nodes. Leaf nodes still paint only to the "current"
canvas.

This PR moves the overlay canvas creation from the paint phase to the
preroll phase, collects them into a SkNWayCanvas and set it in
PaintContext.

To keep this PR focused, I only used the internal_nodes_canvas in the
tranform_layer.
Will followup with a PR that changes all internal layers to use the
internal_nodes_canvas.
2018-11-08 09:31:40 -08:00