3120 Commits

Author SHA1 Message Date
Dragoș Tiselice
ef98b148e5 Switched engine to use buffer collection. (flutter/engine#23488)
The old way of allocating images meant that one would have to make
sure that Scenic and Flutter were using exactly the same pixel
formats. This patch removes the old image allocation and replaces
it with a sysmem API that uses buffer collections instead. This
permits a smooth negotiation of formats between the two systems.
2021-01-26 12:17:13 -05:00
Lau Ching Jun
b9fbeca5b3 Allow naming shared libraries in deferred component via AndroidManifest (flutter/engine#23925) 2021-01-25 16:34:27 -08:00
chunhtai
9eac248c05 rename flutter_export to flutter_darwin_export to prevent naming conflict (flutter/engine#23933) 2021-01-25 16:25:07 -08:00
Alexander Brusher
0cc337ef5b Adds a mechanism for announce events to be forwarded to a11y. (flutter/engine#23499) 2021-01-25 13:24:05 -08:00
Chase Latta
74c7cac41a use a single clang toolchain (flutter/engine#23842) 2021-01-25 13:23:04 -08:00
Kaushik Iska
0176b01d38 [macos] Support smooth resizing for Metal (flutter/engine#23924)
Coordinate command buffer submission with Core Animation
scheduling to ensure smooth resizing.

Fixes: https://github.com/flutter/flutter/issues/74056
2021-01-25 12:50:21 -08:00
Chris Bracken
85d0c9d969 Rename TextInputManager to TextInputManagerWin32 (flutter/engine#23905)
The current text input manager is win32-specific due to its use of
IMM32. For UWP, we'll need a TSF implementation. Once that happens we'll
want to extract out a TextInputManager interface and add a separate UWP
implementation of this class.
2021-01-24 16:22:00 -08:00
Chris Bracken
693063e13d Add support for IME-based text input on Windows (flutter/engine#23853)
This updates the Win32 desktop embedder to support input method (abbreviated IM
or IME) composing regions.

In contrast to languages such as English, where keyboard input is
managed keystroke-by-keystroke, languages such as Japanese require a
multi-step input process wherein the user begins a composing sequence,
during which point their keystrokes are captured by a system input
method and converted into a text sequence. During composing, the user is
able to edit the composing range and manage the conversion from keyboard
input to text before eventually committing the text to the underlying
text input field.

To illustrate this, in Japanese, this sequence might look something like
the following:

1. User types 'k'. The character 'k' is added to the composing region.
   Typically, the text 'k' will be inserted inline into the underlying
   text field but the composing range will be highlighted in some manner,
   frequently with a highlight or underline.
2. User types 'a'. The composing range is replaced with the phonetic
   kana character 'か' (ka). The composing range continues to be
   highlighted.
3. User types 'k'. The character 'k' is appended to the composing
   range such that the highlighted text is now 'かk'
4. User types 'u'. The trailing 'k' is replaced with the phonetic kana
   character 'く' (ku) such that the composing range now reads 'かく'
   The composing range continues to be highlighted.
5. The user presses the space bar to convert the kana characters to
   kanji. The composing range is replaced with '書く' (kaku: to write).
6. The user presses the space bar again to show other conversions. The
   user's configured input method (for example, ibus) pops up a
   completions menu populated with alternatives such as 各 (kaku:
   every), 描く (kaku: to draw), 核 (kaku: pit of a fruit, nucleus), 角
   (kaku: angle), etc.
7. The user uses the arrow keys to navigate the completions menu and
   select the alternative to input. As they do, the inline composing
   region in the text field is updated. It continues to be highlighted
   or underlined.
8. The user hits enter to commit the composing region. The text is
   committed to the underlying text field and the visual highlighting is
   removed.
9. If the user presses another key, a new composing sequence begins.

If a selection is present when composing begins, it is preserved until
the first keypress of input is received, at which point the selection is
deleted. If a composing sequence is aborted before the first keypress,
the selection is preserved. Creating a new selection (with the mouse,
for example) aborts composing and the composing region is automatically
committed. A composing range and selection, both with an extent, are
not permitted to co-exist.

During composing, keyboard navigation via the arrow keys, or home and
end (or equivalent shortcuts) is restricted to the composing range, as
are deletions via backspace and the delete key. This patch adds two new
private convenience methods, `editing_range` and `text_range`. The
former returns the range for which editing is currently active -- the
composing range, if composing, otherwise the full range of the text. The
latter, returns a range from position 0 (inclusive) to `text_.length()`
exclusive.

Windows IME support revolves around two main UI windows: the composition window
and the candidate window. The composition window is a system window overlaid
within the current window bounds which renders the composing string. Flutter
already renders this string itself, so we request that this window be hidden.
The candidate window is a system-rendered dropdown that displays all possible
conversions for the text in the composing region.  Since the contents of this
window are specific to the particular IME in use, and because the user may have
installed one or more third-party IMEs, Flutter does not attempt to render this
as a widget itself, but rather delegates to the system-rendered window.

The lifecycle of IME composing begins follows the following event order:
1. WM_IME_SETCONTEXT: on window creation this event is received. We strip the
   ISC_SHOWUICOMPOSITIONWINDOW bit from the event lparam before passing it to
   DefWindowProc() in order to hide the composition window, which Flutter
   already renders itself.
2. WM_IME_STARTCOMPOSITION: triggered whenever the user begins inputting new
   text. We use this event to set Flutter's TextInputModel into composing mode.
3. WM_IME_COMPOSITION: triggered on each keypress as the user adds, replaces,
   or deletes text in the composing region, navigates with their cursor within
   the composing region, or selects a new conversion candidate from the
   candidates list.
4. WM_IME_ENDCOMPOSITION: triggered when the user has finished editing the text
   in the composing region and decides to commit or abort the composition.

Additionally, the following IME-related events are emitted but not yet handled:
* WM_INPUTLANGCHANGE: triggered whenever the user selects a new language using
  the system language selection menu. Since there some language-specific
  behaviours to IMEs, we may want to make use of this in the future.
* WM_IME_NOTIFY: triggered to notify of various status events such as opening
  or closing the candidate window, setting the conversion mode, etc. None of
  these are relevant to Flutter at the moment.
* WM_IME_REQUEST: triggered to notify of various commands/requests such as
  triggering reconversion of text, which should begin composition mode, insert
  the selected text into the composing region, and allow the user to select new
  alternative candidates for the text in question before re-committing their
  new selection. This patch doesn't support this feature, but it's an important
  feature that we should support in future.
2021-01-24 12:56:08 -08:00
Gary Qian
9b0c05391a Read loading unit mapping from AndroidManifest instead of strings (flutter/engine#23868) 2021-01-23 23:04:02 -08:00
Greg Spencer
1d7c3ef055 Implement delayed key event synthesis for Windows (flutter/engine#23524)
This changes the Windows text handling so that keyboard events are sent to the framework first for handling, and then passed to the text input plugin, so that the framework has a chance to handle keys before they get given to the text field.

This is complicated by the async nature of the interaction with the framework, since Windows wants a synchronous response. So, in this change, I always tell Windows that the event was handled, and if the framework (eventually) responds that it wasn't, then I synthesize a new event and send it with SendEvent.

I also added support for detecting "extended" keys, since that was missing, and converted the OnKey handlers in the API to return a bool to indicate whether or not they have handled the event.
2021-01-22 18:14:39 -08:00
Chris Bracken
c5d35fb934 Notify Win32FlutterWindow of cursor updates (flutter/engine#23795)
During multi-step text input composing, such as with Chinese, Japanese,
and Korean text input, the framework sends embedders cursor rect updates
in the form of two messages:

* TextInput.setMarkedTextRect: notifies the embedder the size and
  position of the composing text rect (or cursor when not composing) in
  local coordinates.
* TextInput.setEditableSizeAndTransform: notifies the embedder of the
  size of the EditableText and 4x4 transform matrix from local to
  PipelineOwner.rootNode coordinates.

On receipt of either message, we cache a local copy on the
TextInputPlugin and notify the Win32FlutterWindow of the updated cursor
rect. In a followup patch, we update Win32FlutterWindow to implement the
Win32 input manager (IMM) calls required to position the IME candidates
window while editing.
2021-01-22 16:31:09 -08:00
xster
e618085f1c Share Android surface GrDirectContext (flutter/engine#23798) 2021-01-22 12:44:02 -08:00
gaaclarke
ce537a2b51 reland of https://github.com/flutter/engine/pull/23634 (flutter/engine#23865) 2021-01-22 11:49:37 -08:00
Zachary Anderson
d1713a83ff Revert "implemented GetMainContext() for opengl (#23634)" (flutter/engine#23859)
This reverts commit ef108aeaed9a86a99c77dcc1c4373f940b532c01.
2021-01-22 09:54:24 -08:00
Lau Ching Jun
dfab1f2f1a Search multiple paths when loading deferred component .so files. (flutter/engine#23849)
This is a partial revert of 1181890b8e94c8cc72928df526f49dcc6ce7cdb2

On some devices we still need to the original search paths approach
because dlopen with just the base file name doesn't work. We're
combining both approaches now, adding the base filename as the first
entry in the searchPaths.
2021-01-22 09:41:22 -08:00
chunhtai
053c0e3eb4 Implements accessibility bridge in common library (flutter/engine#23491) 2021-01-22 09:29:02 -08:00
Dan Field
e778949043 Reland path vol tracker (flutter/engine#23840)
This time making sure to deref the native object on GC.
2021-01-21 16:03:43 -08:00
Lau Ching Jun
1181890b8e Pass the filename directly to JNI for loading deferred component. (flutter/engine#23824)
When .so files are in the lib/ path in the APK, it can be dlopen-ed
directly using just the filename. We don't need to search for the file.
The interface has thus been changed to accept a single path instead of a
search directory.

Also instead of hardcoding the .so basename and assets directory, read
them from FlutterApplicationInfo instead.
2021-01-21 16:01:13 -08:00
pepsin
3e24724755 Fix background crash when FlutterView going appear while app goes background (flutter/engine#23175) 2021-01-21 15:34:02 -08:00
Greg Spencer
95196058d2 Make android more lenient when it comes to out-of-order key event responses (flutter/engine#23604)
Relaxes enforcement of key events being handled in order, to match similar code in the Linux and Windows implementations.
2021-01-21 15:31:21 -08:00
Sarbagya Dhaubanjar
52e5aebff7 iOS deeplink sends "path + query" instead of just path (flutter/engine#23562) 2021-01-21 15:09:01 -08:00
Jason Simmons
2c20425be9 Fix typo in embedder unit tests (flutter/engine#23783) 2021-01-21 14:24:38 -08:00
Wu Zhong
646475c27e [iOS] Fixes DisplayLinkManager leaks (flutter/engine#22194) 2021-01-21 11:19:51 -08:00
gaaclarke
ef108aeaed implemented GetMainContext() for opengl (flutter/engine#23634) 2021-01-21 09:43:06 -08:00
Dan Field
cb57183325 revert path volatility tracker (flutter/engine#23822) 2021-01-21 08:34:02 -08:00
Jang-Ho Hwang
b2f2ffae85 Fix typo in textureFrameAvailable on macOS (flutter/engine#23823) 2021-01-21 08:31:00 -08:00
Daco Harkes
58104c65ed add ffi_allocation_patch.dart to libraries.yaml (flutter/engine#23808) 2021-01-20 16:44:02 -08:00
kevinsakuma
65f3316a47 Removes deprecated WLAN API dependency. (flutter/engine#23726) 2021-01-20 09:24:02 -08:00
Gary Qian
310d2c210e Fix JNI void vs object method call (flutter/engine#23785) 2021-01-19 21:54:01 -08:00
gaaclarke
41f7568c34 block thread merging with shared engines (flutter/engine#23733) 2021-01-19 15:38:56 -08:00
Dan Field
a0f81ca18b skip flaky test (flutter/engine#23775) 2021-01-19 15:02:36 -08:00
xster
8b90c7869e FlutterEngineGroup for Android (flutter/engine#23675) 2021-01-19 12:29:02 -08:00
Kaushik Iska
0a6a9f29d2 [windows] Enable smooth resizing on windows (flutter/engine#23701) 2021-01-19 11:17:41 -08:00
Niklas Schulze
be6c25ebf4 Add windows plugin texture support (flutter/engine#19405) 2021-01-19 11:14:01 -08:00
Jody Sankey
11caec0a47 [fuchsia] Add missing static binding check. (flutter/engine#23731) 2021-01-15 22:19:02 -08:00
Alexander Brusher
264eda2585 Populates fuchsia a11y toggled state. (flutter/engine#23704)
This change ensures that flutter accessibility updates include toggled
state as appropriate.
2021-01-15 10:32:19 -08:00
Michael Goderbauer
ea1b8adee8 State Restoration for iOS (flutter/engine#23495) 2021-01-14 15:54:04 -08:00
Kaushik Iska
e7be1a1cf4 Add support for rendering using Metal on macOS (flutter/engine#23599) 2021-01-14 14:47:21 -08:00
gaaclarke
496768187d Added missing export for the flutter engine group. (flutter/engine#23689) 2021-01-14 13:19:03 -08:00
George Wright
d748fd80bf Support Mice in iPadOS 13.4+ (flutter/engine#23636) 2021-01-14 11:15:29 -08:00
gaaclarke
5026c62732 lightweight flutter engines: sharing skia contexts for the io thread (flutter/engine#23508) 2021-01-13 13:04:16 -08:00
Robert Ancell
124ce62dd2 Use the scroll multiplier that the Chromium source uses.
Fixes https://github.com/flutter/flutter/issues/71385
2021-01-14 09:06:36 +13:00
Robert Ancell
7436af8647 Only handle smooth scroll events.
On X11 scroll events are being directly sent to the FlView X window. This is
causing them to bypass the normal scroll handling and means this widget received
both smooth and non-smooth scroll events.

I haven't been able to find a solution to the root cause of the problem, so only
smooth scroll event are being processed. This could cause issues on older
versions of the X server that don't send smooth scroll events, but fixes the
problem for the common modern case.

This issue doesn't occur in Wayland.
2021-01-14 09:06:36 +13:00
gaaclarke
8af69442c0 share font collections between spawn engines (flutter/engine#23603) 2021-01-13 11:38:48 -08:00
Robert Ancell
0cadee4e98 Add accessibility suport to Linux shell. (flutter/engine#19634)
Add accessibility support to the Linux shell
2021-01-13 13:49:48 +13:00
gaaclarke
dbc486213c Plumbing refactor to allow the usage of Dart_CreateIsolateInGroup (flutter/engine#23549)
Did the plumbing refactor that allows us to call Dart_CreateIsolateInGroup when applicable.
2021-01-12 16:43:12 -08:00
Sarbagya Dhaubanjar
fbd0f1df95 Android deeplink sends "path + query" instead of just path (flutter/engine#23561)
* added .cpid & .gclient to gitignore

* updated tests

* minor change

* fixed formating

* compact concatenation

* minor change

* Revert "added .cpid & .gclient to gitignore"

* cleanup
2021-01-12 16:02:08 -08:00
Niklas Schulze
22b1eea1b9 Windows textures: Add placeholder flutter_texture_registrar.h (flutter/engine#23623) 2021-01-12 13:19:02 -08:00
Chase Latta
e636c1b44d [dart-runner] Avoid calling Destroy on nullptr (flutter/engine#23608) 2021-01-12 13:14:02 -08:00
Robert Ancell
af2850ee0d Only remove weak pointers that are set.
If the pointer has already been removed this generates a runtime warning.
2021-01-12 15:35:39 +13:00