1085 Commits

Author SHA1 Message Date
Jason Simmons
930fcb8c2a Suppress deprecation warning for usage of Configuration.locale (flutter/engine#7973) 2019-02-26 17:03:10 -08:00
Ben Konyi
0669ddc849 Link dart:* sources into engine for debugger source support (flutter/engine#7908)
Link dart:* sources into engine for debugger source support

Currently, dart:* libraries appear to have no source in
debuggers like Observatory. With this change, these sources will be
available in debug mode applications. Sources for dart:* libraries are
lazily loaded on a script-by-script basis.

Refer to https://dart-review.googlesource.com/c/sdk/+/93375 for the Dart
SDK change.
2019-02-26 13:28:04 -08:00
Gary Qian
e89ce5c33f Add api 21 check to LocalizationChannel.java (flutter/engine#7967) 2019-02-26 11:33:07 -08:00
Matt Carroll
6245708521 Android Embedding PR 8: Add FlutterEngine attachment/detachment to FlutterView (flutter/engine#7946) 2019-02-26 01:54:17 -08:00
Matt Carroll
e58bcfa1aa Android PR 7: Introduce structure of FlutterActivity and FlutterFragment (flutter/engine#7912) 2019-02-26 01:48:09 -08:00
Matt Carroll
022526592f Fixed an Android keyboard entry bug that was introduced by the embedding refactor. (#28438) (flutter/engine#7954) 2019-02-25 19:15:49 -08:00
Jason Simmons
153bf88d71 Do not clear FlutterJNI state when a FlutterView is detached (flutter/engine#7929)
If an app is using retainFlutterNativeView or a plugin wants to keep the
FlutterNativeView active, then the FlutterNativeView should not drop its
handle to the corresponding native platform view.

Fixes https://github.com/flutter/flutter/issues/26931
2019-02-25 15:31:50 -08:00
Chris Bracken
92397389c1 Correct FlutterSemanticsNode member name style (flutter/engine#7942)
Correct struct members whose names were camelCase rather than
snake_case. This is a breaking API change, but does not break ABI.
2019-02-24 22:33:55 -08:00
Ivan
6834ac884e fix sendLocales on old android versions (flutter/engine#7937)
[Configuration.getLocales()][1] was added in API level 24. 
For earlier versions, we instead return only the current locale.

Fixes https://github.com/flutter/flutter/issues/28321

[1]: https://developer.android.com/reference/android/content/res/Configuration#getLocales()
2019-02-24 22:29:16 -08:00
Matt Carroll
a3a6398ed2 Android Embedding PR 6: Introduce FlutterView structure with FlutterSurfaceView and FlutterTextureView. (flutter/engine#7896) 2019-02-24 20:41:18 -08:00
Mehmet Fidanboylu
191884bbc1 New setting to decide whether we want the engine to load ICU mapping. (flutter/engine#7928) 2019-02-22 14:49:15 -08:00
Stanislav Baranov
7a52e3968f Dynamic patching support for native code libraries. (flutter/engine#7927) 2019-02-22 14:18:47 -08:00
Stanislav Baranov
96184e9d73 Make the layout of dynamic patch bundle similar to APK. (flutter/engine#7925)
This will help further changes when we pull other artifacts into the bundle.
2019-02-22 12:56:35 -08:00
liyuqian
79c1a3fcdf Move canvas clear after preroll (flutter/engine#7923)
This will reduce 1 render target switch when preroll paints some raster
cache.
2019-02-22 12:48:04 -08:00
ashawn
3ef46f5b11 fix Memory leak when using PlatformView [IOS] #24714 (flutter/engine#7919) 2019-02-22 09:00:15 -08:00
Chinmay Garde
d0f9af0324 Allow embedders to specify a vsync waiter. (flutter/engine#7914)
Fixes https://github.com/flutter/flutter/issues/28240
2019-02-21 23:02:32 -08:00
Chinmay Garde
8d12a45c6a Allow embedders to add events to the timeline. (flutter/engine#7917)
Fixes https://github.com/flutter/flutter/issues/28283
2019-02-21 22:42:49 -08:00
Jason Simmons
4290d0349c Embedder API for setting the persistent cache path (flutter/engine#7915)
Fixes https://github.com/flutter/flutter/issues/28278
2019-02-21 17:30:17 -08:00
Stanislav Baranov
95c09f168a Reland #7777 with proper LICENSE (flutter/engine#7888) 2019-02-21 13:45:24 -08:00
Chris Bracken
a987736df4 Eliminate .member = foo struct initialization (flutter/engine#7899)
This breaks MSVC:
```
[3049/3506] CXX obj/flutter/shell/gpu/gpu_surface_gl.gpu_surface_gl_delegate.obj
FAILED: obj/flutter/shell/gpu/gpu_surface_gl.gpu_surface_gl_delegate.obj
ninja -t msvc -e environment.x64 -- E:\b\c\goma_cache\client/gomacc.exe "E:\b\depot_tools\win_toolchain\vs_files\3bc0ec615cf20ee342f3bc29bc991b5ad66d8d2c\VC\Tools\MSVC\14.14.26428\bin\HostX64\x64/cl.exe" /nologo /showIncludes /FC @obj/flutter/shell/gpu/gpu_surface_gl.gpu_surface_gl_delegate.obj.rsp /c ../../flutter/shell/gpu/gpu_surface_gl_delegate.cc /Foobj/flutter/shell/gpu/gpu_surface_gl.gpu_surface_gl_delegate.obj /Fdobj/flutter/shell/gpu/gpu_surface_gl_cc.pdb
e:\b\rr\tmpahx5uo\w\src\flutter\shell\gpu\gpu_surface_gl_delegate.cc(70): error C2059: syntax error: '.'
e:\b\rr\tmpahx5uo\w\src\flutter\shell\gpu\gpu_surface_gl_delegate.cc(71): error C2143: syntax error: missing ';' before '}'
e:\b\rr\tmpahx5uo\w\src\flutter\shell\gpu\gpu_surface_gl_delegate.cc(76): error C2061: syntax error: identifier 'ProcResolverContext'
e:\b\rr\tmpahx5uo\w\src\flutter\shell\gpu\gpu_surface_gl_delegate.cc(78): error C3536: 'proc_resolver_context': cannot be used before it is initialized
e:\b\rr\tmpahx5uo\w\src\flutter\shell\gpu\gpu_surface_gl_delegate.cc(78): error C2227: left of '->resolver' must point to class/struct/union/generic type
e:\b\rr\tmpahx5uo\w\src\flutter\shell\gpu\gpu_surface_gl_delegate.cc(78): note: type is 'int'
e:\b\rr\tmpahx5uo\w\src\flutter\shell\gpu\gpu_surface_gl_delegate.cc(82): error C2059: syntax error: 'if'
e:\b\rr\tmpahx5uo\w\src\flutter\shell\gpu\gpu_surface_gl_delegate.cc(82): error C2143: syntax error: missing ';' before '{'
e:\b\rr\tmpahx5uo\w\src\flutter\shell\gpu\gpu_surface_gl_delegate.cc(82): error C2447: '{': missing function header (old-style formal list?)
e:\b\rr\tmpahx5uo\w\src\flutter\shell\gpu\gpu_surface_gl_delegate.cc(87): error C2059: syntax error: 'if'
e:\b\rr\tmpahx5uo\w\src\flutter\shell\gpu\gpu_surface_gl_delegate.cc(87): error C2143: syntax error: missing ';' before '{'
e:\b\rr\tmpahx5uo\w\src\flutter\shell\gpu\gpu_surface_gl_delegate.cc(87): error C2447: '{': missing function header (old-style formal list?)
e:\b\rr\tmpahx5uo\w\src\flutter\shell\gpu\gpu_surface_gl_delegate.cc(91): error C2059: syntax error: '('
e:\b\rr\tmpahx5uo\w\src\flutter\shell\gpu\gpu_surface_gl_delegate.cc(91): error C2059: syntax error: ')'
e:\b\rr\tmpahx5uo\w\src\flutter\shell\gpu\gpu_surface_gl_delegate.cc(92): error C2059: syntax error: 'return'
e:\b\rr\tmpahx5uo\w\src\flutter\shell\gpu\gpu_surface_gl_delegate.cc(95): error C2653: 'GPUSurfaceGLDelegate': is not a class or namespace name
e:\b\rr\tmpahx5uo\w\src\flutter\shell\gpu\gpu_surface_gl_delegate.cc(95): error C2270: 'GetGLInterface': modifiers not allowed on nonmember functions
e:\b\rr\tmpahx5uo\w\src\flutter\shell\gpu\gpu_surface_gl_delegate.cc(96): error C3861: 'GetGLProcResolver': identifier not found
e:\b\rr\tmpahx5uo\w\src\flutter\shell\gpu\gpu_surface_gl_delegate.cc(96): error C3861: 'CreateGLInterface': identifier not found
e:\b\rr\tmpahx5uo\w\src\flutter\shell\gpu\gpu_surface_gl_delegate.cc(100): error C2653: 'GPUSurfaceGLDelegate': is not a class or namespace name
e:\b\rr\tmpahx5uo\w\src\flutter\shell\gpu\gpu_surface_gl_delegate.cc(101): error C3861: 'CreateGLInterface': identifier not found
e:\b\rr\tmpahx5uo\w\src\flutter\shell\gpu\gpu_surface_gl_delegate.cc(104): error C2059: syntax error: '}'
e:\b\rr\tmpahx5uo\w\src\flutter\shell\gpu\gpu_surface_gl_delegate.cc(104): error C2143: syntax error: missing ';' before '}'
```
2019-02-20 23:37:26 -08:00
Chris Bracken
b9ceb3090d Add accessibility semantics support to embedder (flutter/engine#7891)
Flutter's accessibility APIs consist of three main calls from the
embedder to the Dart application:

  1. FlutterEngineUpdateSemanticsEnabled: enables/disables semantics support.

  2. FlutterEngineUpdateAccessibilityFeatures: sets embedder-specific
     accessibility features.

  3. FlutterEngineDispatchSemanticsAction: dispatches an action (tap,
     long-press, scroll, etc.) to a semantics node.

and two main callbacks triggered by Dart code:

  1. FlutterUpdateSemanticsNodeCallback: notifies the embedder of
     updates to the properties of a given semantics node.

  2. FlutterUpdateSemanticsCustomActionCallback: notifies the embedder
     of updates to custom semantics actions registered in Dart code.

In the Flutter framework, when accessibility is first enabled, the
embedder will receive a stream of update callbacks notifying the
embedder of the full semantics tree. On further changes in the Dart
application, only updates will be sent.
2019-02-20 18:59:29 -08:00
Chinmay Garde
c37c0d78b0 Respect the custom GL proc table when creating the resource context on the IO thread. (flutter/engine#7893)
Fixes https://github.com/flutter/flutter/issues/28229
2019-02-20 17:23:14 -08:00
Matt Carroll
e3ea15b38a Android embedding refactor pr5 add flutterengine impl (flutter/engine#7878) 2019-02-20 17:06:33 -08:00
Matt Carroll
7187e271f2 Android embedding refactor pr3 add remaining systemchannels (flutter/engine#7892)
Merging back in after reversion. Fixed some messaging issues in FlutterNativeView and corrected some message parsing.
2019-02-20 17:05:31 -08:00
Dan Field
a9c8a6c06a Revert "Android embedding refactor pr3 add remaining systemchannels (#7874)" (flutter/engine#7886)
This reverts commit 08a8b11065ca3417490ed789bf5a642988d5e8d4.
2019-02-20 11:18:12 -08:00
Dan Field
4206f443f7 Revert "Shut down and restart the Dart VM as needed. (#7832)" (flutter/engine#7877)
This reverts commit 75a66f31dc2a02ccb54f10fb4477233086f4906b.
2019-02-19 16:14:18 -08:00
Matt Carroll
08a8b11065 Android embedding refactor pr3 add remaining systemchannels (flutter/engine#7874) 2019-02-19 15:51:13 -08:00
stuartmorgan
7524aa2d8c Expose more pointer phases in embedder.h (flutter/engine#7813)
Adds 'add', 'remove', and 'hover' to the set of pointer phases that are
available to embedders. This is necessary for them to send hover events
to the engine.
2019-02-19 07:06:57 -08:00
Stanislav Baranov
86dac86486 Revert "Support for binary decompression of dynamic patches. (#7777)" (flutter/engine#7853)
This reverts commit c50fe4fb9a7691b223b17132200e676e7d4cbb60.
2019-02-15 17:07:06 -08:00
Chris Bracken
273c0cf7c7 Revert "Android embedding refactor pr3 add remaining systemchannels (#7738)" (flutter/engine#7849)
From build log:
```
../../flutter/shell/platform/android/io/flutter/view/FlutterView.java:95: error: cannot find symbol
    private final LocalizationChannel localizationChannel;
                  ^
  symbol:   class LocalizationChannel
  location: class FlutterView
../../flutter/shell/platform/android/io/flutter/view/FlutterView.java:172: error: cannot find symbol
        localizationChannel = new LocalizationChannel(dartExecutor);
                                  ^
  symbol:   class LocalizationChannel
  location: class FlutterView
2 errors
```

This reverts commit 914dc5a0b6d168159c3949c67b28f6f7e5bf7ba6.
2019-02-15 15:03:19 -08:00
Chinmay Garde
75a66f31dc Shut down and restart the Dart VM as needed. (flutter/engine#7832)
The shell was already designed to cleanly shut down the VM but it couldnt
earlier as |Dart_Initialize| could never be called after a |Dart_Cleanup|. This
meant that shutting down an engine instance could not shut down the VM to save
memory because newly created engines in the process after that point couldn't
restart the VM. There can only be one VM running in a process at a time.

This patch separate the previous DartVM object into one that references a
running instance of the DartVM and a set of immutable dependencies that
components can reference even as the VM is shutting down.

Unit tests have been added to assert that non-overlapping engine launches use
difference VM instances.
2019-02-15 14:16:17 -08:00
Matt Carroll
914dc5a0b6 Android embedding refactor pr3 add remaining systemchannels (flutter/engine#7738) 2019-02-15 13:45:24 -08:00
Todd Volkert
146cc39aa2 Don't call static method from instance variable (flutter/engine#7841) 2019-02-15 16:18:02 -05:00
Amir Hardon
333458c95e Delete GL textures when they are released from the texture registry. (flutter/engine#7836)
On Android we were never deleting the textures allocated for
the texture registry, which resulted in a memory leak, see:
https://github.com/flutter/flutter/issues/24145
2019-02-15 13:11:49 -08:00
najeira
cd5ceb29be Fix NullPointerException in SurfaceTextureRegistryEntry (flutter/engine#7837) 2019-02-15 13:01:41 -08:00
najeira
a3e6ae8948 Fix NullPointerException in ResourceCleaner (flutter/engine#7838) 2019-02-15 12:56:37 -08:00
Ben Konyi
640bed91e3 Add support for calling into other plugins from a background context on iOS (flutter/engine#7843)
Added `FlutterPluginRegistrantCallback` typedef and optional `setPluginRegistrantCallback` static method in `FlutterPlugin`. `setPluginRegistrantCallback` is used to set a callback defined in AppDelegate.m which registers some subset of plugins with a `FlutterPluginRegistry` (for example, a headless FlutterEngine). This allows for plugins which utilize background execution functionality to enable the use of other plugins on the background isolate. This puts iOS on par with Android for background execution.

Along with updated examples and Medium posts, this fixes [flutter/flutter#21925](https://github.com/flutter/flutter/issues/21925).
2019-02-15 11:18:56 -08:00
Jason Simmons
a0f4916009 Remove the Dart JIT snapshot data from AOT builds of the embedder library (flutter/engine#7806)
Also extend the embedder unit tests to cover AOT execution
2019-02-15 09:43:23 -08:00
Gary Qian
f85d8b60f5 Track flow id (flutter/engine#7826)
(Authored by @nathanrogersgoogle )
2019-02-14 12:30:29 -08:00
nathanrogersgoogle
7517ae90c3 Add flow events connecting pointer events to frames (flutter/engine#7807) 2019-02-13 22:27:12 -08:00
Stanislav Baranov
c50fe4fb9a Support for binary decompression of dynamic patches. (flutter/engine#7777) 2019-02-11 16:56:33 -08:00
Chinmay Garde
8d53a804f3 Allow embedders to specify pointer device IDs. (flutter/engine#7790) 2019-02-11 16:49:45 -08:00
Matt Carroll
4c7a50516c Recommended implementation of combining characters implementation. (flutter/engine#7758) 2019-02-11 15:27:55 -08:00
Jason Simmons
3a709976b2 Provide a default pressure range if a MotionEvent does not have a device (flutter/engine#7737)
Fixes https://github.com/flutter/flutter/issues/27641
2019-02-11 09:29:07 -08:00
KyleWong
e6b2d000dd Provide public api to allow FlutterEngine related context to be destoryed (flutter/engine#7610)
Provide public api to allow FlutterEngine related context  to be destoryed.
2019-02-09 17:13:04 +08:00
nathanrogersgoogle
69a16cbb01 Don't call OnAnimatorNotifyIdle if a frame is scheduled (flutter/engine#7746)
If a frame is scheduled by the time the delayed animator notify idle
task runs, then we should not call |NotifyIdle|.

Also, add a trace event in the task, to make it more clear in traces
when a notify idle call is coming from here (as opposed to
|Animator::AwaitVSync|).
2019-02-08 15:14:06 -08:00
Chris Bracken
8ff6f25fc1 Add flutter config to macOS targets (flutter/engine#7756)
In c3ad553 (#7642), //shell/platform/darwin:framework_shared was added
without the root flutter config, causing a build breakage in Fuchsia,
where flutter sits under //third_party/flutter as opposed to at the
root. The flutter root config is required to set -I../../third_party as
an include path.
2019-02-08 14:30:16 -08:00
Chinmay Garde
cb31ce37fa Document GPUSurfaceGLDelegate methods and move it to its own file. (flutter/engine#7755) 2019-02-08 14:21:47 -08:00
stuartmorgan
4c7fa286f3 Rename macOS framework to FlutterMacOS.framework (flutter/engine#7740)
Avoids potential confusion due to the iOS framework already being called
Flutter.framework.
2019-02-08 12:00:17 -08:00
Stanislav Baranov
34bfbdf99f Support for loading dynamic patches in AOT mode. (flutter/engine#7744)
* Dynamic patching support for AOT mode.

* Cleanup.
2019-02-08 10:47:01 -08:00