3200 Commits

Author SHA1 Message Date
Chris Bracken
a712590dfc Only call destruction_callback if non-null (flutter/engine#24845)
In MakeSkSurfaceFromBackingStore and other places in embedder.cc, we
call a texture or framebuffer destruction callback without first
verifying it's non-null. This adds a check before such calls.

Currently fl_renderer_gl_create_backing_store() in the Linux GTK
embedder and ExternalTextureGL::PopulateTexture() in the Windows
embedder either explicitly or implicitly set a null destruction
callback.

This prevents a crash reported when running under OpenGL ES 2.0 reported
in https://github.com/flutter/flutter/issues/76881.

While this prevents the crash, it does not fix the underlying issue.
2021-03-08 17:31:22 -08:00
Chris Bracken
13cf185e1c Correct setup-related typos (flutter/engine#24846)
Corrects uses of setup as a verb to 'set up', leaves noun/noun-phrase
forms of setup as 'setup'. Also settles on 'teardown' as opposed to
tear-down for consistency across the codebase.

A few other minor comment/wording corrections.
2021-03-08 17:31:10 -08:00
David Worsham
5f2b7a72ab fuchsia: Correct PlatformView scale/transform (flutter/engine#24645) 2021-03-08 15:18:16 -08:00
Emmanuel Garcia
503af63aef Prevent race condition while switching surfaces (flutter/engine#24838) 2021-03-05 21:50:13 -08:00
Emmanuel Garcia
e5ca96cc41 Revert "Replace Flutter surface only after all platform views are destroyed (#24363)" (flutter/engine#24800)
This reverts commit 5d850382d4205a9e2f5d42383d63ecb8cae2247b.
2021-03-05 10:45:20 -08:00
J-P Nurmi
069154f7ee [linux] Fix text selection via Shift+Home/End (flutter/engine#24623)
Adds TextInputModel::SelectToBeginning/End() and applies when shift key is pressed.
2021-03-05 08:51:33 -08:00
chunhtai
92d11213ff Adds set text action for voice access (flutter/engine#24734) 2021-03-04 17:44:01 -08:00
Matej Knopp
aa32d53a38 Use hidden window to process flutter messages (flutter/engine#24232)
https://github.com/flutter/flutter/issues/75500
2021-03-04 14:35:15 -08:00
Kaushik Iska
abc42cde56 Guard metal rendering behind SHELL_ENABLE_METAL (flutter/engine#24727) 2021-03-04 09:04:01 -08:00
chunhtai
935384301f Enables semantics when voice control is turned on (flutter/engine#24640) 2021-03-03 17:24:02 -08:00
Chris Bracken
e77d5ec898 Move CIPD package creation tools under tools/cipd (flutter/engine#24766)
This moves tooling related to the creation of the Android embedding
bundle CIPD package under tools/cipd. Having a single location for CIPD
package creation tooling avoids spreading these around the tree and aids
in discovery.

This does not change the path within the CIPD package repo, nor does it
change the path to which we download it via gclient as specified in the
DEPS file.

This will be followed by a patch to add a new Windows CIPD package
necessary for UWP builds.
2021-03-03 15:21:28 -08:00
James Clarke
9beda3c62b Fix UWP build for UpdateCursorRect rename (flutter/engine#24697) 2021-03-02 19:34:53 -08:00
Emmanuel Garcia
e0a4751112 Fix memory leak and bug in the RunsOnCreationTaskRunner check (flutter/engine#24690) 2021-03-02 12:39:02 -08:00
Chris Bracken
ee19dbeb1b Win32: Support Korean input (flutter/engine#24713)
This change fixes a bug in Korean input whereby WM_IME_COMPOSITION
messages of type GCS_RESULTSTR were assumed to end composing mode.

This change breaks out an additional handler for "commit composing text"
events. In Japanese/Chinese IMEs, these events typically occur on
selection of a candidate from the candidates list and are mostly
synonymous with an "end composing" event.

In Korean text input, there is no candidates list, but rather a
character is built up as keypresses are handled, and committed as soon
as the character is unambiguously complete; in other words, when either
space/return is pressed or a keypress is received that cannot be
interpreted as a modification of the character being composed and
therefore must be the first keystroke of a new character. In these
cases, we want to commit the previous character without ending the
composition.

To illustrate with an example:
1. User focuses on a text field and sets input mode to Hangul.
2. User presses 'ㄱ'. Composing region contains 'ㄱ'.
3. User presses 'ㅏ'. Composing region is updated to '가'.
4. User presses 'ㄴ'. Composing region is updated to '간'.
5. User presses 'ㅏ'. Result string '가' is committed. Composing region is
   updated to '나'.
6. User presses 'ㄷ'. Composing string is updated to '낟'.
7. User presses 'ㅏ'. Result string '나' is committed. Composing region is
   updated to '다'.
8. User presses space or enter. Result string '다' is committed.
   Composing is ended.

On a non-Korean QWERTY keyboard the following key mappings serve to
perform the above input:
* r -> ㄱ
* k -> ㅏ
* s -> ㄴ
* e -> ㄷ

To support the above, we break out a separate "commit composing" method
and commit on WM_IME_COMPOSITION events of type GCS_RESULTSTR and end
composing on WM_IME_ENDCOMPOSITION events. Further, we eliminate the
workaround in the GCS_RESULTSTR handler for continued composition on
Chinese/Japanese IMEs now that we're no longer ending composition on
that event type.
2021-03-02 10:14:27 -08:00
Chris Bracken
263d0d1734 Add RAII wrapper for Win32 IMM context (flutter/engine#24699)
Wraps Win32 IME context management in an RAII container that automates
management via ImmGetContext() and ImmReleaseContext().
2021-03-02 10:01:40 -08:00
Matej Knopp
9a425c81af Switch to correct OpenGL context before deleting framebuffers. (flutter/engine#24679)
https://github.com/flutter/flutter/issues/76920
2021-03-02 04:57:44 -08:00
Chris Bracken
ead87f659d Consistent naming for Win32 emebedder (flutter/engine#24686)
Under shell/platform/windows, we have a mix of two naming schemes:
   * foo_bar_win32.h
   * win32_foo_bar.h

This renames files and identifiers to consistently use a Win32
suffix-based approach.
2021-02-28 01:13:02 -08:00
Matej Knopp
0473cd010b Do not use eglQuerySurface to query surface dimensions (flutter/engine#24682) 2021-02-27 15:11:03 -08:00
Chris Bracken
24239316a6 Convert cursor rect to device coordinates on Win32 (flutter/engine#24672)
The handlers for the TextInput.setMarkedTextRect and
TextInput.setEditableSizeAndTransform in the win32 embedding deal in
Flutter root view co-ordinates. These need to be converted to window
co-ordinates before being passed to the TextInputManager, which deals in
Win32 window co-ordinates.

This fixes a bug wherein the IME candidates window for CJK input was
incorrectly positioned at display scales other than 100% in the OS
settings.

Fixes: https://github.com/flutter/flutter/issues/76902
2021-02-27 14:57:53 -08:00
Tong Mu
5d8d91980b [Windows] Hide Win32 API of the keyboard system behind ifdef (flutter/engine#24677) 2021-02-27 14:05:32 -08:00
Tong Mu
bab6d2ce45 Hardware Keyboard: Windows (flutter/engine#23465)
Windows changes for the Hardware Keyboard project.
2021-02-26 16:11:48 -08:00
Zachary Anderson
0d039190a8 Update shell_fuchsia_unittests.cc (flutter/engine#24660)
Speculative fix for failing roll at https://github.com/flutter/engine/pull/24657
2021-02-26 11:03:56 -08:00
gaaclarke
1601ba9329 Fixed problem where AndroidShellHolder was trashing the ThreadHost in its deconstructor (flutter/engine#24644) 2021-02-26 08:55:06 -08:00
Nathan Rogers
2dff242e90 Fix input flow event logic (flutter/engine#24526) 2021-02-25 11:51:02 -08:00
Kaushik Iska
b8d4abfab5 [macos] Reland default metal and also check if the system supports metal before defaulting to it (flutter/engine#24601) 2021-02-25 05:49:23 -06:00
Chris Bracken
c3a0385fb5 Use common desktop TextInputModel on macOS (flutter/engine#24533)
This replaces the custom Obj-C TextInputModel implementation used on
macOS with the common C++ implementation used on Linux and Windows. Note
that as a side-effect, this change enables *some* direct IME input for
CJK input but full input will land in follow-up patches that land:

1. Add handling for TextInput.setMarkedTextRect message
2. Add handling for TextInput.setEditableSizeAndTransform message
3. Implement firstRectForCharacterRange:actualRange: using the above.
4. Add NSTextInputContext handling.
2021-02-25 00:04:54 -08:00
Lau Ching Jun
3ef9020448 Add method to obtain native string resource in localization plugin. (flutter/engine#24575) 2021-02-24 23:03:31 -08:00
gaaclarke
8d44387269 Started initializing the gpu disable syncswitch based on the app state. (flutter/engine#24503) 2021-02-24 22:24:29 -08:00
Kaushik Iska
ca6e477c10 Revert "[macos] Make metal the default rendering backend on macOS >= … (flutter/engine#24600)
This reverts commit ca5bf569977085b5730486b24a9219524fc23426.
2021-02-24 09:58:10 -08:00
LongCatIsLooong
271538aefa Passthrough movement keys when theres no selection (flutter/engine#24581) 2021-02-23 20:41:01 -08:00
Nitrogen
8c79b99623 Delete multi set intent parameter (flutter/engine#24543) 2021-02-23 15:31:01 -08:00
Kaushik Iska
d6d316c153 [macos] Make metal the default rendering backend on macOS >= 10.14 (flutter/engine#23967)
Fixes: https://github.com/flutter/flutter/issues/74058
2021-02-22 15:17:45 -08:00
Kaushik Iska
6669586560 External Texture support for macOS Metal (flutter/engine#24523) 2021-02-19 14:36:02 -08:00
Matej Knopp
a1298d0c45 Fix retain cycles in MacOS embedder (flutter/engine#24263) 2021-02-19 10:46:34 -08:00
James Clarke
d7e2d53564 Improve resize (flutter/engine#24428) 2021-02-18 14:51:03 -08:00
John Bauman
822182154d Set debug client info for sysmem allocator (flutter/engine#24384) 2021-02-18 14:46:02 -08:00
Kaushik Iska
f8955fca87 [embedder] [metal] Embedder API can support externally composited Metal textures (flutter/engine#24327) 2021-02-18 11:35:19 -08:00
LongCatIsLooong
98147bb6dc Revert "[Android Text Input] Remove Samsung restart input workaround for newer Samsung keyboards (#24288)" (flutter/engine#24486) 2021-02-18 11:26:01 -08:00
LongCatIsLooong
7694881296 [Android text input] fix android autofill on focused text field (flutter/engine#24463) 2021-02-17 23:01:02 -08:00
eggfly
7149be7fce Fix ImageReader may leak images when onDraw() not called (flutter/engine#24272) 2021-02-17 22:56:06 -08:00
Kaushik Iska
628624c014 Revert "Reland "Remove pipeline in favor of layer tree holder (#18901)" (#24387)" (flutter/engine#24456)
This reverts commit 89d58651ecab974f80345f065203178024eb9b84.
2021-02-17 10:44:39 -08:00
Kaushik Iska
89d58651ec Reland "Remove pipeline in favor of layer tree holder (#18901)" (flutter/engine#24387) 2021-02-16 13:27:09 -08:00
Matej Knopp
68bb09e4ec Unblock FlutterResizeSynchronizer on engine shutdown (flutter/engine#24264) 2021-02-16 12:56:01 -08:00
LongCatIsLooong
09da701b22 [Android Text Input] Remove Samsung restart input workaround for newer Samsung keyboards (flutter/engine#24288) 2021-02-16 09:11:01 -08:00
Chris Bracken
03946537c2 Adjust header guards for updated paths (flutter/engine#24424)
In a46f817 these files were moved from shell/platform/common/cpp to
shell/platform/common.
2021-02-15 13:27:11 -08:00
Chris Bracken
b638110ac3 Add missing header guard, namespace (flutter/engine#24423)
TextRange was missing a namespace declaration and header guards.
2021-02-15 13:26:43 -08:00
James Clarke
e9543eaf17 Windows: linker compatibility with AppContainer for winuwp target (flutter/engine#24318)
* Update Windows linker settings to be compatible with AppContainer when target==winuwp
2021-02-12 19:10:09 -08:00
David Reveman
4e916d1ff6 Fix vulkan surface leaks. (flutter/engine#24372)
This fixes 3 memory leaks:

1. Destroys local vulkan buffer collections.
2. Releases image2 resource in Scenic.
3. Deregister buffer collections from Scenic session.

Co-authored-by: David Reveman <reveman@google.com>
2021-02-12 17:15:29 -05:00
Emmanuel Garcia
5d850382d4 Replace Flutter surface only after all platform views are destroyed (flutter/engine#24363) 2021-02-12 10:02:33 -08:00
David Reveman
3d688d6424 Remove unnecessary buffer collection image constraints. (flutter/engine#24347) 2021-02-11 15:56:02 -08:00