1067 Commits

Author SHA1 Message Date
Stanislav Baranov
aa2b287cbf
Reland #7777 with proper LICENSE (#7888) 2019-02-21 13:45:24 -08:00
Chris Bracken
6e6020d299
Eliminate .member = foo struct initialization (#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
abe9826a9d
Add accessibility semantics support to embedder (#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
684c9394c0
Respect the custom GL proc table when creating the resource context on the IO thread. (#7893)
Fixes https://github.com/flutter/flutter/issues/28229
2019-02-20 17:23:14 -08:00
Matt Carroll
e11d0e96fb
Android embedding refactor pr5 add flutterengine impl (#7878) 2019-02-20 17:06:33 -08:00
Matt Carroll
2f4a38dbd3
Android embedding refactor pr3 add remaining systemchannels (#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
6d7eb52185
Revert "Android embedding refactor pr3 add remaining systemchannels (#7874)" (#7886)
This reverts commit f4fba6d7110338caf3878cf42e26e17744108d00.
2019-02-20 11:18:12 -08:00
Dan Field
572fea361c
Revert "Shut down and restart the Dart VM as needed. (#7832)" (#7877)
This reverts commit 0d6ff1669c4a765774b91e37353b4392408d112a.
2019-02-19 16:14:18 -08:00
Matt Carroll
f4fba6d711
Android embedding refactor pr3 add remaining systemchannels (#7874) 2019-02-19 15:51:13 -08:00
stuartmorgan
ed73fc39cd
Expose more pointer phases in embedder.h (#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
5141680287
Revert "Support for binary decompression of dynamic patches. (#7777)" (#7853)
This reverts commit d48de7a3ec97ebf7ffe543aa74993efa51064789.
2019-02-15 17:07:06 -08:00
Chris Bracken
163a2fd5e1
Revert "Android embedding refactor pr3 add remaining systemchannels (#7738)" (#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 256db4bc23b7931509233df0dc04e44e16608229.
2019-02-15 15:03:19 -08:00
Chinmay Garde
0d6ff1669c
Shut down and restart the Dart VM as needed. (#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
256db4bc23
Android embedding refactor pr3 add remaining systemchannels (#7738) 2019-02-15 13:45:24 -08:00
Todd Volkert
02d7ca31d8
Don't call static method from instance variable (#7841) 2019-02-15 16:18:02 -05:00
Amir Hardon
10cee612bb
Delete GL textures when they are released from the texture registry. (#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
69e4606077 Fix NullPointerException in SurfaceTextureRegistryEntry (#7837) 2019-02-15 13:01:41 -08:00
najeira
9a965bc3d9 Fix NullPointerException in ResourceCleaner (#7838) 2019-02-15 12:56:37 -08:00
Ben Konyi
1ba3295506
Add support for calling into other plugins from a background context on iOS (#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
0ca1d1f318
Remove the Dart JIT snapshot data from AOT builds of the embedder library (#7806)
Also extend the embedder unit tests to cover AOT execution
2019-02-15 09:43:23 -08:00
Gary Qian
a8aa1ee060
Track flow id (#7826)
(Authored by @nathanrogersgoogle )
2019-02-14 12:30:29 -08:00
nathanrogersgoogle
e2394ad77e
Add flow events connecting pointer events to frames (#7807) 2019-02-13 22:27:12 -08:00
Stanislav Baranov
d48de7a3ec
Support for binary decompression of dynamic patches. (#7777) 2019-02-11 16:56:33 -08:00
Chinmay Garde
87b40ba974
Allow embedders to specify pointer device IDs. (#7790) 2019-02-11 16:49:45 -08:00
Matt Carroll
4663d357a3
Recommended implementation of combining characters implementation. (#7758) 2019-02-11 15:27:55 -08:00
Jason Simmons
694300d325
Provide a default pressure range if a MotionEvent does not have a device (#7737)
Fixes https://github.com/flutter/flutter/issues/27641
2019-02-11 09:29:07 -08:00
KyleWong
90569e8416
Provide public api to allow FlutterEngine related context to be destoryed (#7610)
Provide public api to allow FlutterEngine related context  to be destoryed.
2019-02-09 17:13:04 +08:00
nathanrogersgoogle
12d0b95c24
Don't call OnAnimatorNotifyIdle if a frame is scheduled (#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
3bfd26505c Add flutter config to macOS targets (#7756)
In 9345274 (#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
4d3a112279
Document GPUSurfaceGLDelegate methods and move it to its own file. (#7755) 2019-02-08 14:21:47 -08:00
stuartmorgan
3183d151df
Rename macOS framework to FlutterMacOS.framework (#7740)
Avoids potential confusion due to the iOS framework already being called
Flutter.framework.
2019-02-08 12:00:17 -08:00
Stanislav Baranov
aa275820bc
Support for loading dynamic patches in AOT mode. (#7744)
* Dynamic patching support for AOT mode.

* Cleanup.
2019-02-08 10:47:01 -08:00
Chinmay Garde
4f3eb42dfd
Update documentation for command line args in FlutterProjectArgs. (#7733) 2019-02-07 14:14:44 -08:00
Matt Carroll
211adeac3a
Introduced a number of Java system channels in io/flutter/embedding/engine/systemchannels/ (#7500) 2019-02-06 17:07:30 -08:00
Chris Bracken
ce07399180
Add FlutterProjectArgs::root_isolate_create_callback (#7651)
Allows embedders to specify a callback to be invoked in isolate scope
once root isolate has been created and marked runnable.

As an example of where this is useful, embedder unit test fixtures may
want to include Dart functions backed by a native implementation. On
isolate creation, this patch allows the unit test author to call
Dart_SetNativeResolver in root isolate scope.
2019-02-06 14:16:47 -08:00
liyuqian
2f87713d40
Revert "Disable the persistent cache (#6835)" (#7689)
This reverts commit 093b2fea8ac09fb1e9e0d712dbdecc0a09f2c1ad.

For https://github.com/flutter/flutter/issues/24058, We now only get a
"Program linking failed" error message on Windows Android simulators
without crahsing. Skia seems to have handled the linking failure in
https://skia-review.googlesource.com/c/skia/+/180372 by rebuilding the
program.
2019-02-05 11:17:21 -08:00
Matt Carroll
cc27cafb84
Implemented Dark Mode for Android (#25525) (#7488) 2019-02-04 19:30:15 -08:00
Kaushik Iska
93aa035dd4
Don't warn for Async texture uploads on Fuchsia (#7691) 2019-02-04 17:04:08 -08:00
stuartmorgan
93452747fc
Initial import of FDE macOS framework (#7642)
Merges the current flutter-desktop-embedding macOS framework into the
engine. Notable changes:
- All channel/codec related code is eliminated in favor of using the
  existing iOS implementations.
- All .m files renamed to .mm for consistency with the iOS code.
  - Some minor code changes to fix new warnings in Objective-C++ mode.
- License headers, basic format (e.g., clang-format changes) updated to
  use repo style.
- Xcode project is not included; instead adds GN build rules to create
  an integrated framework that combines what was the FDE library with
  what is present in FlutterEmbedder.framework.

Other changes are left as follow-ups, including:
- Moving shared code out of ios/ into common/.
- Potentially improving sharing between iOS and macOS BUILD.gn.
- Class renaming; the FLE prefix will be eliminated, but that API
  surface isn't stable yet, so that can be changed later.
2019-01-31 14:14:43 -08:00
Chris Bracken
7fa77ef03a
Fix two typos in embedder docs (#7649) 2019-01-30 18:11:08 -08:00
Kaushik Iska
b94e759b25
Expose the Flutter engine, Dart and Skia versions to Dart. (#7634)
- Moved versions from shell to common
- versions singleton contains all the required versions.
2019-01-30 16:22:45 -08:00
Chinmay Garde
64e17076c1
Document make_resource_current on FlutterOpenGLRendererConfig and warn if the callback is not set. (#7648) 2019-01-30 16:13:00 -08:00
Jason Simmons
050dcaad60
Embed ICU data inside libflutter.so on Android (#7588)
Prior to this the Android embedder code would extract the icudtl.dat asset out
of the APK and write it to local disk during the first startup of the app.

This change will make that work unnecessary and eliminate the risk of ICU
failures due to errors in the extraction process.
2019-01-30 11:56:17 -08:00
stuartmorgan
474d8837a9
Rename FlutterResult in embedder.h (#7567)
FlutterResult is also the name of a class in the Objective-C API
surface, which is problematic when building a framework that contains
both (such as a macOS implementation of the Flutter framework).
2019-01-29 14:01:31 -08:00
Chinmay Garde
79dc315dc4
Allow the engine to redirect traces to systrace via settings. (#7617) 2019-01-28 17:39:31 -08:00
Chinmay Garde
0dedb56d2f
[embedder] Avoid looking for the kernel binary in AOT builds. (#7577) 2019-01-24 14:22:39 -08:00
Dan Field
31c7917179
Fix #26966 (#7566) 2019-01-24 12:36:23 -08:00
Qxyat
450c3e4d43 Don't accept gestures by ForwardingGestureRecognizer (#7558)
ForwardingGestureRecognizer was previously accepting the gesture when the touch sequence ended, this was causing some other gesture recognizers to not accept the gestures (e.g tapping on the my location button in a Google Map didn't work).
2019-01-23 09:28:55 -08:00
jslavitz
c57e66fdae
fixes android pressure range (#7516) 2019-01-22 15:09:02 -08:00
Dan Field
2123d3a569
Keep engine alive if VC is not deallocated (#7544) 2019-01-22 15:03:25 -08:00