3383 Commits

Author SHA1 Message Date
Tong Mu
fdc78e4146 [Win32, keyboard] Fix dead key events that don't have the dead key mask (flutter/engine#30004)
This PR fixes flutter/flutter#92654, a rare case where dead key events are not properly handled.
2021-12-01 00:49:44 -08:00
Tong Mu
2626d453ff [macOS] MacOS Keyboard properly handles multi-char characters (flutter/engine#30005)
* Attempt

* Write my own decode

* Doc

* Format

* Fix comment and log

* Update FlutterEmbedderKeyResponder.mm
2021-12-01 00:49:19 -08:00
Emmanuel Garcia
f0d3d31b08 Use WindowInfoTracker.Companion.getOrCreate instead of the short version (flutter/engine#30012) 2021-11-30 17:24:01 -08:00
Filip Filmar
e769683b1d [fuchsia] Fix unset key and present key meaning (flutter/engine#29995) 2021-11-30 15:59:02 -08:00
gaaclarke
5b1174940a Removed the email warning about notifications entitlement (flutter/engine#29996) 2021-11-30 14:51:08 -08:00
Filip Filmar
e2dbdf16bd [fuchsia] Fixes the HID usage handling (flutter/engine#29815)
The old code stripped the USB hid usage page value from the Fuchsia
key.  It shouldn't be doing that.  This change fixes the issue,
and adds tests that rely on the key constants to verify that the
change indeed does what it is supposed to do.

In the process of fixing this, filed a few known issues and marked them
as TODO. These issues should be handled in separate PRs.

Fixes: https://github.com/flutter/flutter/issues/93890
2021-11-29 15:41:17 -08:00
Chris Bracken
22c822564d Win32: add test of native a11y tree nodes (flutter/engine#29993)
Adds AddSemanticsNodeUpdateWithChildren, which tests that the native
tree of IAccessible COM objects is an accurate representation of the
platform-agnostic accessibility tree.

Issue: https://github.com/flutter/flutter/issues/77838
2021-11-29 15:34:05 -08:00
Callum Moffat
8877397345 Remove iPadOS mouse pointer if no longer connected (flutter/engine#28319) 2021-11-29 14:47:01 -08:00
Chris Bracken
f8dfe2fab4 Win32 a11y bridge and platform node delegates (flutter/engine#29829)
* Win32 a11y bridge and platform node delegates

This is the third in a series of patches adding accessibility support
for the Windows embedder. This patch wires in the Accessibility bridge,
and lands the core structure of the Windows FlutterPlatformNodeDelegate
and AccessibilityBridgeDelegate classes, including:

* Instantiating the AccessibilityBridge when the semantics tree is
  enabled.
* Creating FlutterPlatformNodeDelegate wrappers for semantics tree
  nodes.
* Handling custom action updates.
* Building and updating the accessibility tree on semantics updates.
* Returning the native IAccessible objects when queried.

Breaking this out so that the follow-up patches can be reviewed and
landed in smaller, independent chunks.

Issue: https://github.com/flutter/flutter/issues/77838
Issue: https://github.com/flutter/flutter/issues/93928
2021-11-29 13:23:42 -08:00
Chris Bracken
5b6219cb49 [Win32] Use mock macro for UpdateSemanticsEnabled (flutter/engine#29976)
Previously, we'd mocked out UpdateSemanticsEnabled using a simple
lambda. Due to the embedder API's C ABI, we were unable to make use of
lambda captures. This patch instead uses MOCK_ENGINE_PROC so we can make
the test variable a local and rely on lambda capture.

Issue: https://github.com/flutter/flutter/issues/77838
2021-11-29 10:39:54 -08:00
eggfly
b87bbe9bc9 Fix typo and clean some includes (flutter/engine#29940) 2021-11-29 09:34:38 -08:00
Robert Ancell
0e891a3c1d Update functions to be consistent with other code. (flutter/engine#29176)
Helper functions first, then callbacks/implementations, then public functions.
Add function comments.
Use consistent function naming.
Remove unnecessary protoypes.
Make a function static that wasn't.
2021-11-29 15:40:08 +13:00
Gary Qian
9e1a29d21c Revert "Listen for Vsync callback on the UI thread directly" (flutter/engine#29923) 2021-11-24 12:33:02 -08:00
Emmanuel Garcia
93e6dbe5ab Bump androidx.window:window-java (flutter/engine#29897) 2021-11-24 11:41:40 -08:00
Fei Zhang
c45a9152a8 Listen for Vsync callback on the UI thread directly (flutter/engine#29889) 2021-11-24 04:23:01 -08:00
Alexander Biggs
54cd63841e [fuchsia] Add arg for old_gen_heap_size. (flutter/engine#29875) 2021-11-22 22:13:01 -08:00
ColdPaleLight
742a3dc7d8 Remove the dart entry point args from the Settings struct (flutter/engine#29831) 2021-11-22 18:43:02 -08:00
Alexander Biggs
b6f5e8e868 [fuchsia] Point TODOs off closed bug. (flutter/engine#29634) 2021-11-22 17:33:03 -08:00
Wu Zhong
d50c0bcca8 [iOS] Destroy the engine prior to application termination. (flutter/engine#29295) 2021-11-22 17:28:03 -08:00
Tong Mu
0a7630373d [Embedder Keyboard] Fix synthesized events causing crash (flutter/engine#29854) 2021-11-22 15:38:02 -08:00
WenJingRui
b4058bb068 [iOS] Fix:Keyboard inset is not correct when presenting and native ViewController on FlutterViewController (flutter/engine#29862) 2021-11-22 15:27:56 -08:00
Alexander Biggs
e90740bcc8 [fuchsia] Don't use sys.Environment in V2. (flutter/engine#29867) 2021-11-22 11:03:04 -08:00
Chris Bracken
29fd771d30 Extract AccessibilityBridge::kRootNodeId (flutter/engine#29856)
The ID of the root semantics node in Flutter's semantics tree is always
0. Since we'll be adding support for Windows, extract this constant to a
common location.
2021-11-22 10:08:31 -08:00
Jason Simmons
2e6866592d Release the JNI reference to the FlutterJNI class in GetDisplayRefreshRate (flutter/engine#29868)
See https://github.com/flutter/flutter/issues/93975
2021-11-20 13:00:11 -08:00
Andrei Diaconu
5003f1a91f Reland: Display Features support (flutter/engine#29585) 2021-11-19 18:04:31 -08:00
gaaclarke
7ab226eaf4 iOS Background Platform Channels (flutter/engine#29665) 2021-11-19 14:14:45 -08:00
gaaclarke
431731da40 Mentioned that replies can be invoked on any thread now that that is supported. (flutter/engine#29816) 2021-11-19 13:43:31 -08:00
David Worsham
40d0af4eb2 fuchsia: Fix Flatland opacity (flutter/engine#29844) 2021-11-19 11:58:20 -08:00
Jenn Magder
c08aa6c73d Add 'explicit' to darwin embedder constructors (flutter/engine#29827) 2021-11-19 10:54:29 -08:00
Dan Field
edb87942de Use eglPresentationTimeANDROID to avoid bogging down the GPU (flutter/engine#29727)
Fixes flutter/flutter#93352

Improves Android benchmarks on both Pixel 4 and a lower end Android Go device for 99th percentile and average raster times.

This works by telling the system compositor what timestamp we intended to show this frame for. This way, if we end up with a frame that gets submitted right at the beginning of a vsync and then a second frame submitted on the same vsync, the compositor will only try to show the second frame on the screen and save the GPU some work.

Without this, a situation like that results in an "avalanche" of calls where the GPU is behind the CPU and keeps delaying CPU work until we finally stop submitting frames. This can be observed as a lengthy dequeuBuffer in a systrace enabled trace, as shown in the linked issue. This avalanche is often triggered by a frame that does a shader compile through a couple vsyncs and then is followed by a bunch of very fast frames that take less than a vsync to render - the first of those fast frames gets delivered before the end of the vsync that the slow frame ended in.

We cannot implement this ourselves because we don't know how long the swap buffers call will take on the system side, and if we try to guess we can very well get it wrong.

I've filed issues to look into adding this for Vulkan and Metal, although we should also first take traces there to make sure it's warranted.

See also: https://android-developers.googleblog.com/2020/04/high-refresh-rate-rendering-on-android.html
2021-11-19 09:29:51 -08:00
Dan Field
3942c6c9f7 Make it less likely to GC during application startup on Android (flutter/engine#29825) 2021-11-18 22:22:22 -08:00
Jenn Magder
b39436f7e5 Fix darwin namespace-comments and brace lint issues (flutter/engine#29828) 2021-11-18 21:06:56 -08:00
Jenn Magder
5291ff4193 Add 'explicit' to Android embedder constructors (flutter/engine#29830) 2021-11-18 21:06:44 -08:00
ColdPaleLight
9ecd4c1899 Make FlutterEngineGroup support dart entrypoint args (flutter/engine#29096) 2021-11-18 18:08:03 -08:00
Tong Mu
5183c56533 [Embedder] Send key data through message channel (flutter/engine#29795)
This PR changes how embedder API's SendKeyData sends ui.KeyData to the framework. The packets are now sent over the existing platform messenger, reusing the entirety of its code path and functionalities while keeping the embedder API unchanged
2021-11-18 17:53:28 -08:00
Tong Mu
5077f867cf [Linux, Keyboard] Fix synthesization upon different logical keys (flutter/engine#29768)
This PR fixes an assertion error when the physical-logical map changes during key synthesization. This error will lead to irregular key sequences, and might occur during an extremely rare edge case described in the unit test in this PR.
2021-11-18 17:52:14 -08:00
Dan Field
0a6301d5ca Listen for display refresh changes and report them correctly (flutter/engine#29800)
This makes sure the frame timings recorder and vsync waiter implementations get
the correct refresh rate if or when it adjusts at runtime. This should be OK
because we'll only query the refresh rate when the display metrics actually
change, which is much less frequent than every frame. I experimented with an NDK
implementation in the previous patch, but that vastly restricts the API levels
we can support, and currently on API 30 and 31 it just calls Java methods
through JNI anyway.

I've refactored the way Display updates are reported so that AndroidDisplay can
just dynamically get the refresh rate correctly. These values are used by a
service protocol extension and by some Stopwatches on the CompositorContext.

See also #29765

Fixes flutter/flutter#93688
Fixes flutter/flutter#93698
2021-11-18 13:09:26 -08:00
Zachary Anderson
78d9e276e2 Fix some clang-tidy lints for Linux host_debug (flutter/engine#29734) 2021-11-18 13:08:01 -08:00
Niklas Schulze
1306ea59ec winuwp: Add multi-touch support (flutter/engine#28067) 2021-11-18 13:03:03 -08:00
Justin McCandless
3d60f36a21 TextEditingDelta Mac (flutter/engine#29036)
Enables the TextEditingDelta API for Mac, and abstracts iOS's TextEditingDelta class for multi-platfor reuse.
2021-11-18 08:44:44 -08:00
chunhtai
2a4d9bb696 Fixes the accessibilityContainer of FlutterScrollableSemanticsObject (flutter/engine#29771) 2021-11-17 17:01:31 -08:00
Jenn Magder
49d561e0e1 Fix "google-objc-*" clang analyzer warning in macOS and iOS (flutter/engine#29764) 2021-11-17 16:48:04 -08:00
godofredoc
44164d408e Revert 29789 revert 29542 freiling view ref (flutter/engine#29793) 2021-11-17 12:58:02 -08:00
Zachary Anderson
03c0f7e453 Add 'explicit' to header files (flutter/engine#29741) 2021-11-17 12:49:16 -08:00
Chris Bracken
dd669f3631 Acquire context reference at the correct time for FlGlArea. (flutter/engine#29791)
This is a reland of flutter/engine#29178 onto the main branch. The
original patch was landed on the master branch during the branch switch
from master to main.
2021-11-17 11:04:33 -08:00
Greg Spencer
a079a95ef7 Fix Kanji switch in Japanese IME on WIndows (flutter/engine#29761) 2021-11-16 19:08:01 -08:00
Brandon DeRosier
4136d0117f Enable Skia's Vulkan backend on all non-mobile platforms, and test SwiftShader Vulkan on all GL unittests platforms (flutter/engine#29520) 2021-11-16 15:27:25 -08:00
Brandon DeRosier
0d67e4e080 Use Fuchsia's Windows Clang SDK (flutter/engine#29736) 2021-11-13 21:22:55 -08:00
Jenn Magder
dbe42683b9 Fix 'google-readability-braces-around-statements' analyzer warning in macOS and iOS (flutter/engine#29723) 2021-11-12 18:42:29 -08:00
Greg Spencer
8c6d3d2492 Check for both compose string and result string. (flutter/engine#29620)
It turns out that unlike the Microsoft IME, Sogou sends a single IME_COMPOSITION message that has both the GCS_COMPSTR and GCS_RESULTSTR flags set, and we check for a composition string before result string, with an "else" clause to check for the result string, so if GCS_COMPSTR is set, we never check for a result string.
2021-11-12 14:55:28 -08:00