1952 Commits

Author SHA1 Message Date
Robert Ancell
044f2542d4
Use the term 'handler' for registering callbacks. (#18269)
This is the term used in the Dart code and which callback is more commonly used
in GLib matching the Dart code will make developers life easier.
2020-05-12 09:01:10 +12:00
Robert Ancell
ccfec72798
Fix grammar in FlBinaryCodec/FlStringCodec descriptions (#18268) 2020-05-12 09:00:36 +12:00
Marcus Tomlinson
d96f962ca2
Add new FlutterEngineAOTData argument to FlutterProjectArgs (#18146)
Added a new `FlutterEngineAOTData` argument to `FlutterProjectArgs`. Embedders can instantiate and destroy this object via the new `FlutterEngineCreateAOTData` and `FlutterEngineCollectAOTData` methods provided.

If an embedder provides more than one source of AOT data to `FlutterEngineInitialize` or `FlutterEngineRun` (e.g. snapshots as well as `FlutterEngineAOTData`), the engine will error out.

Resolves: https://github.com/flutter/flutter/issues/50778
2020-05-10 10:24:56 -07:00
Jason Simmons
d1725d7f1e
Restore the call to initConfig in FlutterLoader (#18257)
This was accidentally removed in https://github.com/flutter/engine/pull/18182
2020-05-09 11:49:11 -07:00
Gary Qian
e9f1efa280
Add fullscreen padding workarounds to v2 android embedding (#18193) 2020-05-09 04:31:27 -07:00
xster
40167b68ed
Make robolectric tests run against SDK 29 by default (#17996) 2020-05-07 23:29:02 -07:00
Robert Ancell
9ea2db5bac
Add FlMessageCodec, FlBinaryCodec, FlStringCodec (#18186)
Classs for binary message encoding/decoding that matches the ones in the Flutter services library.
2020-05-08 16:13:54 +12:00
Robert Ancell
403931ff22
Add FlValue (#18185)
FlValue is a lightweight object used to contain the value types that Flutter
uses on platform channels.
2020-05-08 13:48:41 +12:00
stuartmorgan
716dbf00c8
Refactor GLFW embedding to support headless mode (#18205)
This does some long-overdue refactoring of the spaghetti code that grew in the GLFW embedding to begin providing a clearer separation between the engine and the window. It is now possible to register plugins, and run the runloop, on a headless engine, which makes headless mode much more usable. This is useful in some automated testing environments.

There is more refactoring that should be done in the future, but this is a good incremental point to stop as the PR is already large, and it provides useful new functionality as-is.
2020-05-07 17:10:11 -07:00
Kurun
15f72b8c0d
Support EventChannel C++ plugin API for Linux/Windows (#17015)
Fixes https://github.com/flutter/flutter/issues/49398
2020-05-07 15:54:59 -07:00
Robert Ancell
e5a7ca577d
Handle leak of message handle when no engine present (#18157)
* Handle leak of message handle when no engine present
* Move callback in wrong location
2020-05-08 09:05:20 +12:00
xster
d3bde19c15
add docs to platformviewios (and some drive-by changes) (#17593) 2020-05-07 14:01:09 -07:00
Jason Simmons
88b9d42400
Remove the global engine entry timestamp (#18182)
The engine was using a global to store a timestamp representing the
launch of the engine.  This timestamp is initialized with a JNI call
on Android and during shell setup on other platforms.  Later the
timestamp is added to a FlutterEngineMainEnter timeline event used to
measure engine startup time in benchmarks.

This PR removes the global and the JNI call and moves the timestamp
into the settings object.
2020-05-07 11:29:28 -07:00
Kaushik Iska
ede658e2d1
[profiling] CPU Profiling support for iOS (#18087)
See flutter.dev/go/engine-cpu-profiling for details
2020-05-07 08:11:07 -07:00
Wu Zhong
39595c822f
Fix memory leak of FlutterCustomAccessibilityAction (#17954) 2020-05-06 14:08:58 -07:00
Ali Mahdiyar
9cdb5a9b6a
Custom unicode handling for Android backspace via JNI to ICU (#17960) 2020-05-06 14:01:02 -07:00
Robert Ancell
805a8874cb
Add first Linux shell tests (#18159) 2020-05-06 15:33:11 +12:00
Chris Yang
cf13c7f7c1
[iOS platform view] fix active_composition_order_ never cleared (#18153) 2020-05-05 17:59:39 -07:00
Jason Simmons
663bfe8d61
Remove the ResourceCleaner from the Android embedding (#18072) 2020-05-04 16:34:02 -07:00
Robert Ancell
95ecd9a405
Move G_END_DECLS that was in the wrong place (#18116) 2020-05-05 09:11:57 +12:00
Robert Ancell
180a497ee5
Support platform messages in Linux shell (#17995) 2020-05-04 17:03:04 +12:00
gabeschine
72fe227a50
Update Fuchsia ComponentContext constructor call to renamed, but equvalent, method (#18067)
This change is part of an LSC in Fuchsia, and is a functionality no-op.

Fixes fxbug.dev/50759

Co-authored-by: Gabriel Schine <thatguy@google.com>
2020-05-01 15:04:58 -07:00
Gary Qian
7a05fcbdbe
Revert "Remove Samsung workarounds (#17612)" (#18081)
This reverts commit a5e0b2f2f2376cdd87f9c690ae1ab6074321ecc3.
2020-05-01 13:14:27 -07:00
Chinmay Garde
e9f20601f1
Don't depend on an implicit transaction when presenting drawables on the raster thread. (#18076)
The way transactions were added changed in
68fd833488.
This broke rendering using both Metal and OpenGL when no implicit transaction
was present on the transaction stack. The failure models differ based on Metal
vs. OpenGL and iOS/device versions. On older versions of iOS, rendering would
consume memory till exhaustion. On newer iOS versions, rendering would be stuck
(till a timeout). This patch brings transaction management back in line with as
it was earlier and also makes the Metal backend resilient to transactions being
present on the transaction stack at all. Since this is still quite brittle,
transaction management must be moved to IOSSurface as a followup.

Fixes https://github.com/flutter/flutter/issues/55784.
2020-05-01 13:05:23 -07:00
Alexander Aprelev
1c8ee9856b
Introduce runtime check that it is root isolate that makes UI native calls. (#18050)
* Revert "Do not register UI-related native functions in secondary isolates (#6401)"

This reverts commit 69ae5694de54d2a163743dcec727fcea1c7bc8e1 as it doesn't work when root and secondary isolates run in the same isolate group.

* Confirm it is root isolate that makes UI native calls.

* Fix format, UIDartState reference from Fuchsia source

* No UI isolate check for fuchsia calls

* Fix typo. Remove redundant runtime calls
2020-05-01 09:05:41 -07:00
Felipe Archondo
24df4a2768
[fuchsia] set vsync_offset based on config file (#18006)
In order to better support different products on Fuchsia, we should
change performance-sensitive attributes based on config files passed in.
This change does so for `vsync_offset`.
2020-05-01 08:45:53 -07:00
stuartmorgan
6634497724
Add an API for resyncing output streams (#18070)
When creating a console on Windows, stdout/stderr aren't wired up to it.
They need to be re-opened afeter the console is created, and that needs
to be done separately in the engine due to the use of static runtime
linking. This provides a helper method that the runner can call when
creating a console so that output will work as expected.

Part of https://github.com/flutter/flutter/issues/53169
2020-05-01 08:38:42 -07:00
George Wright
4c4e24bd77
Bundle the validation layers and enable them if --enable-vulkan-validation-layers is specified to gn (#17854) 2020-04-30 16:06:59 -07:00
Kaushik Iska
6530b57d0d
[fuchsia] Log unregistered platform channels only once (#18064)
This is to reduce log spam.

Fixes: https://github.com/flutter/flutter/issues/55966
2020-04-30 15:25:48 -07:00
Filip Filmar
fe70fc74a0
[fuchsia] Use dart::ComponentContext() (#17876)
This functionality is added in issue #41523.  Allows runners to request
the singleton instance of `sys::ComponentContext`, while it remains also
accessible to component-specific code that does not have direct access
to top-level objects.

Fixes #41523
2020-04-30 13:27:57 -07:00
Wings006
84093e844c
make "flutter run --trace-systrace" work. (#18052) 2020-04-30 09:30:24 -07:00
stuartmorgan
32a4cc5ed4
Fix method handler control flow in Windows and Linux text input plugins (#17964)
The existing logic incorrectly factored out a check that there were arguments too early, applying it to any message not already handled (including unhandled methods, such as methods added after the initial implementation) and thus failing if any unhandled message had no arguments.

Fixes https://github.com/flutter/flutter/issues/55653
2020-04-29 19:43:12 -07:00
Chinmay Garde
2e738ee40e
[Metal] On context loss with a paused texture source, preserve external pixel buffer. (#18022)
Fixes https://github.com/flutter/flutter/issues/55783
Requires follow-up https://github.com/flutter/flutter/issues/55926
2020-04-29 13:27:00 -07:00
Robert Ancell
ae96c36c55
Replace usage of NULL with nullptr to match coding style (#18023) 2020-04-29 13:26:27 -07:00
Robert Ancell
34f516b016
Use g_warning instead of stderr (#17994) 2020-04-29 15:13:29 +12:00
George Wright
df4596d87b
Set the max Vulkan API version when creating the GrContext (#18007) 2020-04-28 14:15:56 -07:00
Robert Ancell
fda26fc70f
Run Flutter platform tasks in GLib main loop (#17910)
Fixes https://github.com/flutter/flutter/issues/54856
2020-04-29 09:13:58 +12:00
xster
45e6cfd1ff
remove top padding when system UI in fullscreen mode (#17985) 2020-04-28 12:21:37 -07:00
gaaclarke
5f437fb4f6
Started ignoring remote keyboard notifications. (#17981) 2020-04-27 17:30:50 -07:00
Emmanuel Garcia
eed05dd00d
Add initial unit tests for the android embedding (#17921) 2020-04-26 20:45:28 -07:00
xster
2589d07ee9
Fix accessibility focus loss when first focusing on text field (#17803) 2020-04-24 15:44:54 -07:00
Robert Ancell
9ece5ba789
Fix units used in Linux shell timestamps. (#17912)
GTK uses timestamps in milliseconds, Flutter wants them in microseconds.
2020-04-24 13:30:34 +12:00
Gary Qian
0273fab759
Hand off presentation properly in VirtualDisplayController.resize() (#17897) 2020-04-23 15:32:20 -07:00
Robert Ancell
12012f135c
Refactor FlutterEngine usage in Linux shell (#17363) 2020-04-24 10:30:41 +12:00
LongCatIsLooong
1df760024d
add missing case for TextInput.requestAutofill (#17857) 2020-04-23 10:52:47 -07:00
Mehmet Fidanboylu
feb94f6c97
Protect LanguageRange behind Android O. (#17882) 2020-04-23 05:59:52 -07:00
Emmanuel Garcia
b1c51cfe78
Extend external view embedder on Android (#17839) 2020-04-21 19:14:38 -07:00
Gary Qian
8dc91229b4
PlatformResolvedLocale localization message channel (#17755) 2020-04-21 15:34:44 -07:00
stuartmorgan
ed58844e8a
Use UTF-16 for C++ text input model (#17831)
The C++ text input model used by Windows and Linux currently uses UTF-32. The intention was to facilitate handling of arrow keys, backspace/delete, etc., however since part of what is synchronized with the engine is cursor+selection offsets, and those offsets are defined in terms of UTF-16 code units, this causes very bad interactions with the framework-side model.

This converts to using UTF-16, rather than UTF-32, so that the offsets align with the framework. It also adds surrogate pair handling to the operations that adjust indexes, to avoid breaking surrogate pairs. (Arbitrary grapheme cluster handling is out of scope for this PR; while definitely desirable in the long term, surrogate pair handling is much more critical since improper handling yields invalid UTF-16, which breaks the text field).

This partially fixes https://github.com/flutter/flutter/issues/55014. A framework-side fix is also necessary (since currently both the engine and the framework attempt to handle arrow keys, which is another out-of-scope-for-this-PR issue), but even without the framework fix this dramatically improves the cursor behavior on Windows when there are surrogate pairs somewhere in the string since at least the two sides agree on what indexes mean.

Includes minor plumbing changes to the text input plumbing on Windows so that we're not pointlessly converting from UTF-16 to UTF-32 and then back to UTF-16.
2020-04-21 11:01:01 -07:00
Gary Qian
52a815df0a
Accessibility null check to catch out of bounds hitTest (#17833) 2020-04-21 06:16:42 -07:00