2244 Commits

Author SHA1 Message Date
Robert Ancell
12012f135c
Refactor FlutterEngine usage in Linux shell (#17363) 2020-04-24 10:30:41 +12:00
Kaushik Iska
a544b45f26
[tracing] SceneDisplayLag is a synchronous event (#17878)
This change converts it from an events that spans a time interval
to an event that occurs at an instant.

We also emit this trace event when there is no lag as opposed to
only when there was a lag to make it monotonous.

Co-authored-by: Kaushik Iska <kaushikiska@google.com>
2020-04-23 10:53:45 -07:00
LongCatIsLooong
1df760024d
add missing case for TextInput.requestAutofill (#17857) 2020-04-23 10:52:47 -07:00
Mehmet Fidanboylu
feb94f6c97
Protect LanguageRange behind Android O. (#17882) 2020-04-23 05:59:52 -07:00
liyuqian
31ecf878aa
Read SkSL from json asset (#17861)
Fixes https://github.com/flutter/flutter/issues/55219
2020-04-22 14:10:17 -07:00
Emmanuel Garcia
b1c51cfe78
Extend external view embedder on Android (#17839) 2020-04-21 19:14:38 -07:00
Gary Qian
8dc91229b4
PlatformResolvedLocale localization message channel (#17755) 2020-04-21 15:34:44 -07:00
stuartmorgan
ed58844e8a
Use UTF-16 for C++ text input model (#17831)
The C++ text input model used by Windows and Linux currently uses UTF-32. The intention was to facilitate handling of arrow keys, backspace/delete, etc., however since part of what is synchronized with the engine is cursor+selection offsets, and those offsets are defined in terms of UTF-16 code units, this causes very bad interactions with the framework-side model.

This converts to using UTF-16, rather than UTF-32, so that the offsets align with the framework. It also adds surrogate pair handling to the operations that adjust indexes, to avoid breaking surrogate pairs. (Arbitrary grapheme cluster handling is out of scope for this PR; while definitely desirable in the long term, surrogate pair handling is much more critical since improper handling yields invalid UTF-16, which breaks the text field).

This partially fixes https://github.com/flutter/flutter/issues/55014. A framework-side fix is also necessary (since currently both the engine and the framework attempt to handle arrow keys, which is another out-of-scope-for-this-PR issue), but even without the framework fix this dramatically improves the cursor behavior on Windows when there are surrogate pairs somewhere in the string since at least the two sides agree on what indexes mean.

Includes minor plumbing changes to the text input plumbing on Windows so that we're not pointlessly converting from UTF-16 to UTF-32 and then back to UTF-16.
2020-04-21 11:01:01 -07:00
Gary Qian
52a815df0a
Accessibility null check to catch out of bounds hitTest (#17833) 2020-04-21 06:16:42 -07:00
Brian Osman
68800a2700
Remove legacy version of SkCanvas::didConcat44 (#17828)
Builds flags have been switched, so the old versions aren't needed any
longer.
2020-04-21 08:46:57 -04:00
Robert Ancell
1dba1ef1f8
Add pointer events to the Linux shell (#17304) 2020-04-21 11:27:13 +12:00
stuartmorgan
fa8b9a5380
Windows text input fixes (#17768)
Fixes a few issues with Windows text input:
- Filters out ASCII control characters
- Filters out lead surrogates, which aren't valid UTF-16 on their own so will cause assertion failures if sent to Flutter
- Adds a bandaid fix for a crash due to mismatches in indexing in the C++ and Dart text models. (A better fix would be to use UTF-16 and add surrogate pair handling to deletion and forward/back; that will be a later PR since it has a larger scope.)

Fixes https://github.com/flutter/flutter/issues/54879
2020-04-20 14:05:41 -07:00
LongCatIsLooong
1cb6db6283
Fix a typo so that the secure input view is properly initialized (#17816) 2020-04-20 11:39:55 -07:00
David Reveman
ae311ca4da
[fuchsia] Enable raster cache on Fuchsia (#17753)
The raster cache is critical for good performance. This
enables the cache and provides a GrContext to ScopedFrame
instances so the cache can be efficiently populated.

Small increase in peak GPU memory usage is expected from
this change. Otherwise, no change in behavior expected.

Fixes https://github.com/flutter/flutter/issues/54950

Co-authored-by: David Reveman <reveman@google.com>
2020-04-20 10:29:08 -07:00
David Reveman
a15eca8b4f
[fuchsia] Adjust Skia GPU resource cache size (#17798)
16 MiB -> 28 MiB

Same size as what would be used on a 1024x600 display if we
allowed the common engine code to adjust this.

Co-authored-by: David Reveman <reveman@google.com>
2020-04-20 10:07:28 -07:00
Gary Qian
a5e0b2f2f2
Remove Samsung workarounds (#17612) 2020-04-17 17:38:30 -07:00
Amir Hardon
f13031b026
Dispatch platform view touch events to the presentation (#17792) 2020-04-17 17:19:10 -07:00
Jason Simmons
f9e53c72c6
Unregister the TextInputChannel method handler when the TextInputPlugin is destroyed (#17646)
Fixes https://github.com/flutter/flutter/issues/54275
2020-04-17 14:25:34 -07:00
George Wright
9f31d81dcd
Enable Vulkan validation layers for shell_test (#17684) 2020-04-17 13:00:02 -07:00
Chris Yang
efd8adfbb3
Pipeline: complete method returns a bool to indicate if complete is successful (#17687) 2020-04-17 10:39:16 -07:00
Brian Osman
fb208b486e
Convert semantics_node from SkMatrix44 to SkM44 (#17763)
* Convert semantics_node from SkMatrix44 to SkM44
2020-04-17 07:24:40 -04:00
Michael Goderbauer
f4d6ce13dc
Clear focus if a platform view goes away (#17381) 2020-04-16 13:23:05 -07:00
Brian Osman
1cf1a5882d
Guard canvas virtuals so we can remove legacy didConcat44 (#17756)
* Guard canvas virtuals so we can remove legacy didConcat44

SkMatrix44 is also deprecated, so start transitioning to SkM44.

* Fix formatting
2020-04-16 13:40:22 -04:00
LongCatIsLooong
cf3d738f50
Android text input autofill (#17465) 2020-04-16 03:41:23 -07:00
LongCatIsLooong
104df6bba4
Add autofill support to ios text input plugin (#17493) 2020-04-16 02:47:53 -07:00
Ali Mahdiyar
6b883e9ff7
Fix RTL handling in delete key event for android (#17393) 2020-04-16 01:48:21 -07:00
Jonah Williams
6e1d7f8883
[a11y] Support TalkBack reading by word, character, and paragraph (#17626) 2020-04-15 19:07:12 -07:00
stuartmorgan
2fe73589fb
Use the right constant for macOS event timestamps (#17713)
The NSEvent->Flutter event conversion code for pointer events was
multiplying seconds by nanoseconds per milliseconds. While this does end
up giving the right number of microseconds, it's a very confusing way to
write it.
2020-04-15 14:33:00 -07:00
gaaclarke
3791f0bc8c
Added some tests after the fact for #17499 (#17714) 2020-04-15 11:52:52 -07:00
stuartmorgan
7498dc2af5
Fix Windows clipboard handling (#17706)
Fixes several bugs in the clipboard code, and makes some structural
improvements:
- Adds scoped wrappers for clipboard open/close and global lock/unlock,
  to prevent missing cleanup, fixing at least one case where the lock
  was not released.
- Adds the relevant window handle to the clipboard calls, since the docs
  suggest that some operations won't work without one.
- Adds a missing clear step to setting the clipboard data.
- Switches from TEXT to UNICODETEXT to handle non-ASCII text correctly.
  - To enable that, adds UTF-16/-8 conversion utilities built on the
    Win32 APIs (rather than the deprecated std::codecvt functions, as
    have been previously used in the engine).
- Fixes handling of getting data when the clipboard is empty, correctly
  returning null.
- Passes more errors back through the method channel, with details, for
  easier debugging of future issues.

Fixes https://github.com/flutter/flutter/issues/54226
2020-04-15 07:02:58 -07:00
stuartmorgan
e6a2534b63
Add a gn flag to disable desktop embeddings (#17708)
Desktop embedding dependencies can trigger gn-generation-time
requiremenets; e.g., the Linux embeddings have pkg-config dependencies.
This can be problematic in some build environments, such as building
flutter_engine.so with a custom sysroot where those higher-level
dependencies aren't available.

This flag allows generating build files that don't have those
dependencies.
2020-04-14 17:48:18 -07:00
gaaclarke
6d17ce60cb
switched to using the ocmock build file in //build (#17707) 2020-04-14 14:43:29 -07:00
stuartmorgan
dfe13788ed
Adjust the GLFW build options (#17704)
- Adds an explicit option for not building the GLFW embedding.
- Disables GLFW by default on Windows, where it's no longer the
  uploaded embedding.
- Moves the X11 pkg-config, which is only used by the GLFW embedding,
  behind the GLFW build flag.
2020-04-14 12:45:21 -07:00
Robert Ancell
b360eab6f7
Move Linux shell docstrings to headers (#17410)
Update docstrings for typos and grammar style specified in the style guide.
2020-04-14 15:41:23 +12:00
gaaclarke
61ec840edd
Made it so unit tests can be written against all ios engine code. (#17624) 2020-04-13 12:34:54 -07:00
George Wright
b241ec1d46 Enable required extension 2020-04-13 12:14:06 -07:00
stuartmorgan
9992a4ae66
Fix C++ MethodChannel reply type (#17607)
Makes InvokeMethod's reply a high-level response object, rather than
binary data, matching the abstraction level of the class (and the other
languages' implementations).

In support of that:
- Adds the logic to the codecs to decode response envelopes, which had
  never been implemented.
- Adds a convience implementation of MethodResult that forwards to
  lambdas, so that one-off invocation handlers are easier to write.

Also simplified BinaryMessenger's API so that subclasses only need to
implement one version of Send, rather than two almost-identical versions.

Fixes https://github.com/flutter/flutter/issues/53223
2020-04-11 19:06:37 -07:00
Jason Simmons
beb8a7ec48
Update editing state in InputConnectionAdaptor.setSelection (#17652)
The BaseInputConnection superclass does not call endBatchEdit
in setSelection and therefore does not implicitly cause
InputConnectionAdaptor to send a state update.

Some input modes such as numeric keypads will not function without
these updates.
2020-04-11 17:29:50 -07:00
Mehmet Fidanboylu
47a88e8ea3
Add support for setting allow http flag in Dart VM (#17653) 2020-04-11 11:55:05 -07:00
stuartmorgan
71d8edb13a
Always build GTK shell (#17634) 2020-04-11 11:50:03 -07:00
Gary Qian
2d19576f24
Implement Hashcode for TextEditingValue in InputConnectionAdaptor (#17643) 2020-04-10 16:00:01 -07:00
Chris Yang
68fd833488
Reland "Improve iOS PlatformViews to better handle thread merging. #16935" (#17609) 2020-04-10 13:25:02 -07:00
Chris Bracken
6aa7029596
Eliminate fx_log_init call (#17622)
fx_log_init was already a no-op, and was eliminated in the latest
Fuchsia SDK.

See: https://fuchsia.googlesource.com/fuchsia/+/47e568475f535c00f53c86e19ff4d8736a7b261f
2020-04-10 09:02:52 -07:00
liyuqian
a8af96da66
Read SkSLs from asset (#17601)
Fixes https://github.com/flutter/flutter/issues/53117

Test added:
- ShellTest.CanLoadSkSLsFromAsset
2020-04-10 00:16:33 -07:00
Francisco Magdaleno
262723a254
[windows] Sends complete key data to framework (#17577) 2020-04-09 20:55:02 -07:00
Shi-Hao Hong
63f40903de
Revert getSystemGestureExclusionRects and setSystemGestureExclusionRects (#17613)
* Revert getSystemGestureExclusionRects and setSystemGestureExclusionRects 

* Remove references to removed PlatformChannelTest.java file
2020-04-09 20:44:37 -07:00
gaaclarke
1c6934eaad
Enabled hiding the home indicator with SystemChrome.setEnabledSystemUIOverlays (#17574) 2020-04-09 09:43:38 -07:00
Chris Yang
caebc93e0c
Revert "Improve iOS PlatformViews to better handle thread merging. (#16935)" (#17600)
This reverts commit f6b8eda714680e308a801d15829a5f71abee75d1.
2020-04-08 21:15:38 -07:00
Chris Yang
f6b8eda714
Improve iOS PlatformViews to better handle thread merging. (#16935) 2020-04-08 17:33:33 -07:00
Gary Qian
3ddd1ef4b0
Implement repeat filtering logic in Android Embedder (#17509) 2020-04-08 12:51:43 -07:00