1108 Commits

Author SHA1 Message Date
Chinmay Garde
93fda103c5 Fix weak pointer use violations in shell and platform view. (flutter/engine#8046) 2019-03-05 15:21:06 -08:00
stuartmorgan
5745c57f0c Add engine support for scrollwheel events (flutter/engine#7494)
Adds support for pointer signals, in a way that will support both discrete events (e.g., scroll wheels, flutter/flutter#22762) and continuous gestures (e.g., trackpad scroll, flutter/flutter#21953).

Also exposes these new event options to the embedder. Does not include code to send the
new events from the platform shells.
2019-03-05 14:12:07 -08:00
Chris Yang
4d1b6afe1b remove extra statement (flutter/engine#8041)
Remove an extra statement introduced in 992e22c9d1
2019-03-05 11:12:00 -08:00
Chris Bracken
e23839700a Add missing values to semantics action enums (flutter/engine#8033)
This brings the Dart and C++ semantics flag enums back in sync.

In #5902, the ability to move the cursor forward and backward one word
were added to dart:ui, and to the Android embedder, but not to the
SemanticsAction enum on the C++ side.
2019-03-05 07:58:26 -08:00
Chris Bracken
e560943579 Add missing kHasImplicitScrolling enum value (flutter/engine#8030)
This brings the Dart and C++ semantics flag enums back in sync.

In #5941, implicit scrolling support was added to SemanticsFlag in
dart:ui, and to the Android embedder, but not to the SemanticsFlags enum
on the C++ side.

This also clarifies/corrects the documentation for this value in dart:ui
and in the embedder API.
2019-03-04 22:00:54 -08:00
Matt Carroll
f24fe312b8 Android Embedding PR 14: Almost done with FlutterFragment. (flutter/engine#8000) 2019-03-04 18:02:24 -08:00
Matt Carroll
8f11547f61 Android Embedding PR15: Add Viewport Metrics to FlutterView (flutter/engine#8029) 2019-03-04 17:12:52 -08:00
Chris Yang
992e22c9d1 [platform_views] Fix duplicated touch event pass down to flutter view from platform view. (flutter/engine#8026)
Fix for flutter/flutter#27700 and flutter/flutter#24207

There are 2 fixes included in this PR.

The intercepting views sometime pass up the touches events to flutter view, even after the forward gesture recognizer pass the event to the flutter view. We only want the event to be passed to the flutter view once. So we let the intercepting view 'consumes' the event in this PR to fix the problem.

When a touch sequence has multiple touch points participated(e.g. Pinch gesture), the touchesBegan and touchesEnded can be triggered multiple times if the touches do not happen simultaneously. One example would be: when performing a pinch gesture with 2 fingers, I put down one finger, keep the finger on the screen, then put down another finger, perform pinch, lift up both finger at the same time. In this sequence, touchesBegan is called twice with each touch in one of the calls and touchesEnded is called once and has 2 touches in the callback. To handle this issue, we added a count to count the touches in one touch sequence. We only set the state to fail when the count reaches 0(That is all the touches has began in the current sequence is ended).
2019-03-04 15:55:32 -08:00
Dan Field
9383838e9f Start of linting Android embedding (flutter/engine#8023)
* Add a tool for running Android SDK lint on Android embedding
2019-03-04 13:55:53 -08:00
Dan Field
2c06341258 Add overloads for lookup that lets you specify a bundle (flutter/engine#8007)
* Add overloads for lookup that lets you specify a bundle

* check bundle with defaultBundleIdentifier before main bundle
2019-03-02 10:01:51 -08:00
Gary Qian
d689b45ab1 Revert "Buffer lifecycle in WindowData (#7999)" (flutter/engine#8010)
This reverts commit 03bec0d1b68ff57b6bf31d7cb8586837443b05fd.
2019-03-01 15:14:20 -08:00
Greg Spencer
55f7ab72d8 Guard against using Android API not defined in API level 16 & 17 (flutter/engine#8006)
This adds a guard around the call to MotionEvent.isFromSource, which is not implemented in API 16 and 17.

Fixes flutter/flutter#28640
2019-03-01 14:53:22 -08:00
Gary Qian
03bec0d1b6 Buffer lifecycle in WindowData (flutter/engine#7999) 2019-03-01 10:43:09 -08:00
Chris Bracken
362096c282 Fix incorrect transformation matrix (flutter/engine#8001)
Previously the transformation matrix returned on semantics nodes was
fetched by matrix col,row (incorrectly). This uses the SkMatrix
constants instead and adds a test.
2019-02-28 19:19:06 -08:00
Matt Carroll
0f8d5d618b Android Embedding PR 12: Add lifecycle methods to FlutterActivity. (flutter/engine#7974) 2019-02-28 16:51:17 -08:00
Matt Carroll
15584ba38d Android Embedding PR 13: Integrated text input, keyevent input, and some other channel comms in FlutterView. (flutter/engine#7979) 2019-02-28 15:02:56 -08:00
Matt Carroll
a0f16c7b4a Android Embedding PR 9: Introduce an AndroidTouchProcessor to convert MotionEvents to Flutter touch data. (flutter/engine#7947) 2019-02-28 14:44:28 -08:00
Chris Bracken
7c4f8d8116 Fix two typos in embedder.h (flutter/engine#7993)
occured -> occurred
preceeded -> preceded
2019-02-27 21:10:08 -08:00
Matt Carroll
73e65066f2 Android Embedding PR 11: Add FlutterEngine to FlutterFragment. (flutter/engine#7972) 2019-02-27 21:09:28 -08:00
Chris Bracken
0d1a8035df Provide batching for semantics updates (flutter/engine#7988)
Some embedders prefer to minimise the number of semantics node/custom
action updates sent back to the host platform -- for example due to
expensive serialisation mechanisms, etc.

This patch provides a 'batch end' signal that provides embedders with an
indication of when a self-consistent set of semantics node or custom action
updates have been sent.

We overload the node/action ID with information that conveys a batch end
by using an ID (-1) that is never allotted to semantics nodes by the
framework.
2019-02-27 12:12:45 -08:00
Jason Simmons
906d49c751 Check for a null pressure range for motion events (flutter/engine#7986)
Fixes https://github.com/flutter/flutter/issues/28490
2019-02-27 11:27:19 -08:00
stuartmorgan
79011c3844 [macos] Add hover support to FLEViewController (flutter/engine#7975)
Adds an option to enable mouse tracking, which will send
add/hover/remove events to the Flutter engine.
2019-02-27 10:06:57 -08:00
Matt Carroll
31890e2d9f Android Embedding PR 10: Add system channels to FlutterEngine. (flutter/engine#7960) 2019-02-26 19:05:18 -08:00
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