4888 Commits

Author SHA1 Message Date
Tong Mu
dafb738c0a Remove surface check when querying ExternalViewEmbedder (flutter/engine#39803) 2023-02-23 13:51:15 -08:00
luckysmg
7d62bf9aef [iOS][Text Input] Avoid crash when its UIViewController.view is nil. (flutter/engine#39768)
* [iOS] Avoid handle method calls when host UIViewController.view is nil.

* Modify code.

* ++
2023-02-23 02:46:06 +00:00
Jason Simmons
f2c5edb7fc Fix a race in ShellTest.PushBackdropFilterToVisitedPlatformViews (flutter/engine#39798)
Fixes https://github.com/flutter/flutter/issues/121096
2023-02-22 22:08:21 +00:00
Jim Graham
1cf1c0e8d8 save/restore around clipping the (potentially cached) frame canvas (flutter/engine#39797) 2023-02-22 21:41:37 +00:00
chunhtai
ef7d53ae51 Add more log when receiving semantics node not part of update (flutter/engine#39777) 2023-02-22 10:38:42 -08:00
Chris Bracken
827671aaef [common] Use FML macro to prevent copy/assignment (flutter/engine#39786)
Rather than explicitly delete the copy constructor and operator=, use
the standard FML_DISALLOW_COPY_AND_ASSIGN macro used elsewhere across
the codebase. Also ensure that files using this macro #include the
correct FML header directly, rather than relying on a transitive
include.

No test changes/additions since this patch introduces no semantic
changes.
2023-02-22 09:50:06 -08:00
hellohuanlin
a0e967921b [platform_view] fix overlapping platform view not touchable (flutter/engine#39527)
* [platform_view]fix overlapped platform view not touchable

* scenario test

* nit

* actually fix todo
2023-02-21 23:53:20 +00:00
gaaclarke
4be4a44534 Started using bgr10_xr for opaque surfaces. (flutter/engine#39727)
* Started using bgr10_xr for opaque surfaces.

* bdero feedback
2023-02-21 23:31:01 +00:00
Robert Ancell
7d854f318f Fix documentation of FlEngineOnPreEngineRestartHandler (flutter/engine#39759) 2023-02-21 19:02:16 +00:00
Chris Bracken
3a54a69dc9 [Windows] Mark move-only classes as such (flutter/engine#39738)
Applies the FML_DISALLOW_COPY_AND_ASSIGN to non-POD types in the Windows
embedder.

No new tests since no semantic change. Only has the compile-time effect
of preventing copying of classes intended to be move-only.
2023-02-21 18:06:59 +00:00
Chris Bracken
1d4e36274f [macOS] Mark move-only classes as such (flutter/engine#39734)
Applies the FML_DISALLOW_COPY_AND_ASSIGN to non-POD types in the macOS
embedder. Specifically the following three accessibility-related
classes:
* FlutterPlatformNodeDelegateMac
* FlutterTextPlatformNode
* AccessibilityBridgeMac

No new tests since no semantic change. Only has the compile-time effect
of preventing copying of classes intended to be move-only.
2023-02-17 17:18:35 -08:00
Chris Bracken
2b185ea8d8 [linux] Eliminate mirrors support (flutter/engine#39701)
Support for using dart:mirrors has been deprecated for nearly two years.
this removes support for enabling mirrors from the embedder as
documented in the deprecation comment. This was primarily added as a
workaround for an internal tooling usecase, which no longer exists.

Issue: https://github.com/flutter/flutter/issues/120924
2023-02-17 09:37:03 -08:00
Chris Bracken
63fbaec5b1 [macOS] Eliminate mirrors support (flutter/engine#39694)
Support for using dart:mirrors has been deprecated for nearly two years.
this removes support for enabling mirrors from the embedder as
documented in the deprecation comment. This was primarily added as a
workaround for an internal tooling usecase, which no longer exists.

Issue: https://github.com/flutter/flutter/issues/120924
2023-02-16 17:23:38 -08:00
Loïc Sharma
a9e12287f6 [dart:ui] Introduce PlatformDispatcher.implicitView (flutter/engine#39553)
This introduces `PlatformDispatcher.implicitView`, a low-level primitive for the framework's bootstrapping. Most code, including the framework after bootstrapping, will use `View.of(context)` instead of this new API. This new primitive will let us deprecate the `window` global.

Goals:

1. **Enable multi-window**. The `PlatformDispatcher.implicitView` is nullable. If `null`, the app must create a window to get a view it can draw into.
2. **Backwards compatibility**. For "single window" apps, `PlatformDispatcher.instance.implicitView` should behave as similar to `window` as possible.
    1. The `PlatformDispatcher.instance.implicitView.viewId` should be `0`.
    1. The `PlatformDispatcher.instance.implicitView` must be available synchronously at root isolate startup. This allows the framework to determine if it can make single window assumptions at startup.
    2. The `PlatformDispatcher.instance.implicitView` reference must not change after startup: if it is null at startup, it must always be null; if it is non-null at startup, it must always be non-null. If "single window" app enters headless mode, the implicit view must remain non-null.

In the future, the embedder will control whether an implicit view is created: mobile & legacy desktop apps will have an implicit view, multi-window desktop apps won't have an implicit view. This requires updating the engine's embedder API and is out-of-scope for this change. For now, all apps will have an implicit view.

Part of https://github.com/flutter/flutter/issues/120306
2023-02-16 16:32:14 -08:00
Matej Knopp
0a6f4a106e [macOS] Implement platform view mutators (flutter/engine#38699)
* [macOS] Implement platform view mutators

* Add FlutterMutatorViewTest

* Move private declaration to test
2023-02-16 22:32:17 +00:00
Chris Yang
7e60a47eea test (flutter/engine#39630)
more comments
2023-02-16 20:26:16 +00:00
Rulong Chen(陈汝龙)
4fb5044193 Uses int64_t instead of int for the |view_id| parameter. (flutter/engine#39618) 2023-02-16 20:20:15 +00:00
Jenn Magder
6cf3c90e27 Delete dead statusBarPadding iOS code (flutter/engine#39682) 2023-02-16 19:07:03 +00:00
Chris Bracken
a27da69cbd [macOS] Improve TextInputPlugin test readability (flutter/engine#39664)
This just extracts arguments to the TextInputClient.setClient async
method call into an NSDictionary local to reduce the deep
indentation of the formatted code.

While the bulk of these calls are identical and could be extracted to a
utility function, or a class extension method like
`handleDefaultSetClientCall`, the point of these tests is to exercise
FlutterTextInputPlugin, and the message protocol over the channel are
precisely what's  being tested, so it makes sense to keep these
explicit.

Followup patch to https://github.com/flutter/engine/pull/39632.

Issue: https://github.com/flutter/flutter/issues/120252
2023-02-16 01:20:08 +00:00
LouiseHsu
a63ba37c86 Revert "Revert "Add support for double tap action from Apple Pencil 2 (#39267)" (#39607)" (flutter/engine#39637)
This reverts commit f112c452b80012e456f9ce41deb3009010fe2336.
2023-02-15 20:00:26 +00:00
gaaclarke
6957ed75ed Added wide gamut colors to offscreen buffers (flutter/engine#39482)
* Added wide gamut support for offscreen buffers.

* bdero
2023-02-15 17:02:16 +00:00
Chris Bracken
ba3492c50a [macOS] Set textfield autofill type (flutter/engine#39632) 2023-02-15 09:01:39 -08:00
Kaushik Iska
4beb3bd963 [impeller] Refactored backend specific feature checks to capabilities (flutter/engine#39598)
part of https://github.com/flutter/flutter/issues/120498
2023-02-14 14:19:38 -05:00
Jason Simmons
239f32f794 Fix a flake in EmbedderTest.CompositorRenderTargetsNotRecycledWhenAvoidsCacheSet (flutter/engine#39596)
The test assumes that the fixture app has scheduled a specific number
of frames.  The fixture should stop scheduling after that point.

See https://github.com/flutter/flutter/issues/106589
2023-02-14 19:10:33 +00:00
Chris Yang
3752de518f Revert "[ios_platform_view] MaskView pool to reuse maskViews." (flutter/engine#39608)
* Revert "Revert "Revert "[ios_platform_view] MaskView pool to reuse maskViews. (#38989)" (#39490)" (#39498)"

This reverts commit d1a1fc6b9005519f7b9c09330a5f30d9c974c35a.

* fix build error
2023-02-14 02:14:33 +00:00
Jonah Williams
f112c452b8 Revert "Add support for double tap action from Apple Pencil 2 (#39267)" (flutter/engine#39607)
This reverts commit adb83f7d563aaaa44148f7b6a6c76846feb17cb3.
2023-02-14 02:04:06 +00:00
LouiseHsu
adb83f7d56 Add support for double tap action from Apple Pencil 2 (flutter/engine#39267)
* working commit

* some clean up

* white space fixes

* whitespace

* remove unused import

* Addressing PR comment, fix tests, update touch packet on Andriod

* formatting n whitespace again

* add new field to web ui pointer.dart

* update test

* whitespace

* fix test

* PR comments

* fix test

* whitespace

* fix test by factoring out logic into helper function

* whitespace

* fix malformed string

* pr comments

* fix type issue

* sigh whitespace

* revert test changes :)

* pr comments + separate out tests

* extra space

* change test name
2023-02-13 21:52:45 +00:00
Tong Mu
0c61f95c3f Reland [macOS] Make FlutterEngine support multiple views (flutter/engine#39576) 2023-02-13 10:21:53 -08:00
Jason Simmons
5f09e0fdf0 Remove Libtxt and Minikin (flutter/engine#39499) 2023-02-13 17:16:04 +00:00
gaaclarke
f51ea3b01f [Impeller] Adds wide gamut support for iOS. (flutter/engine#39111)
* Implemented wide gamut images for iOS

Moved the surface to an extended range color format.

* wrong gamma but default pixel format set to bgra10_xr

* BGR10_XR add

* format

* updated todos

* updated todo with information about pixel formats

* switched logic for determining if we have a wide gamut image

* cleaned up gamut math to match style and linked source

* made the color attachment pixel format match the surface

* updated vulkan format switch

* removed comment

* added enable disable switch

* moved default to bgr10 for now since there is a bug where someone is still reading this, msaa?

* fixed the decoder settings to make sure we don't lose wide gamut colors

* fixed stored srgb gamut variable

* fixed false lint

* updated test

* added ability to grab the surface data for tests

* made the screenshot utility return the format

* added width and height to the platform channel payload

* fixed a couple of broken targets

* moved back the default pixel buffer format

* cleanup and add docstrings

* made the surfacedata feature only available in debug builds

* added decoding unit test

* fixed objc tests

* turned off by default

* bdero feedback1

* bdero2

* bdero3

* fixed merge issue

* removed using std::shared_ptr
2023-02-11 00:08:20 +00:00
Chris Bracken
93ef23fca0 [macOS] Add XCode marks for TextInputPlugin (flutter/engine#39550)
Adds marks to cleanly separate the sections of TextInputPlugin when
viewing in XCode and other IDEs that recognise #pragma mark. This file
is getting pretty long.

No tests since this is a cleanup with no functional changes.
2023-02-10 23:46:07 +00:00
Justin McCandless
2e0bee3e44 Revert "Remove deprecated TextInputClient scribble method code" (flutter/engine#39516)
Fixes the scribble feature (iPad handwriting input via Apple Pencil).
2023-02-10 11:48:43 -08:00
Tong Mu
9b1a97cba6 Revert "[macOS] Make FlutterEngine support multiple views (#37976)" (flutter/engine#39536) 2023-02-10 10:18:41 -08:00
Brandon DeRosier
4d586c0346 Add Animated PNG demuxer (flutter/engine#31098) 2023-02-09 22:34:05 -08:00
Callum Moffat
a367fdc132 Fix position of BackdropFilter above PlatformView (flutter/engine#39244)
* Fix position of BackdropFilter in PlatformView

* Add check of PushFilterToVisitedPlatformViews
2023-02-09 23:58:28 +00:00
Rulong Chen(陈汝龙)
97d65c8a45 [ios] Convert int in Dart to long long in Objective-C. (flutter/engine#39331)
For native targets, an `int` in Dart maps to a signed 64-bit integer representation.
2023-02-09 23:01:22 +00:00
Tong Mu
9aeba94a67 [macOS] Make FlutterEngine support multiple views (flutter/engine#37976)
* Rebase all

* Do not remove views on hot restart

* Remove log, fix doc

* Apply suggestions from code review

Co-authored-by: Loïc Sharma <737941+loic-sharma@users.noreply.github.com>

* getDefaultView

* postpone deprecation. Add TODO

* Apply suggestions from code review

Co-authored-by: Loïc Sharma <737941+loic-sharma@users.noreply.github.com>

* Change to single

* Update FlutterEngine.h

* Update FlutterEngine_Internal.h

---------

Co-authored-by: Loïc Sharma <737941+loic-sharma@users.noreply.github.com>
2023-02-09 22:58:19 +00:00
Loïc Sharma
f5f5854e7f [Windows] Prepare keyboard & text input plugins for multi-view (flutter/engine#39464)
* Start

* Add keyboard reset hook

* Update comment

* Format
2023-02-09 22:25:59 +00:00
Matej Knopp
7c8036349d Reland "[macos] Move TextInputPlugin outside of visible area" (flutter/engine#39194) 2023-02-09 21:08:48 +00:00
yaakovschectman
3a963aaf6a Enable UIA in Window (flutter/engine#39513)
* Enable UIA

* Unit test getobject

* Formatting

* Formatting

* Formatting

* Formatting
2023-02-09 15:04:07 -05:00
Jonah Williams
ffc4619fc1 increase first frame timeout (flutter/engine#39504) 2023-02-09 02:08:22 +00:00
Chris Yang
d1a1fc6b90 Revert "Revert "[ios_platform_view] MaskView pool to reuse maskViews. (#38989)" (#39490)" (flutter/engine#39498)
This reverts commit 817f10b675dc620532990579dd56cfc890e54801.
2023-02-08 23:42:54 +00:00
chunhtai
7f0ffe360f Migrate iOS and Android to use pushRouteInformation (flutter/engine#39372)
* Migrate iOS and Android to use pushRouteInformation

* revert

* fix test
2023-02-08 20:00:58 +00:00
Amit Uttamchandani
091acd9397 Disable mouse-input-test (flutter/engine#39492)
See http://fxbug.dev/121501

Co-authored-by: Amit Uttamchandani <amituttam@google.com>
2023-02-08 11:31:31 -08:00
Chris Yang
817f10b675 Revert "[ios_platform_view] MaskView pool to reuse maskViews. (#38989)" (flutter/engine#39490)
This reverts commit 353f0b5b32ff9f3199f5fad0a02110e539c017e8.
2023-02-08 19:14:06 +00:00
Chris Bracken
7d5af83621 [macOS] Support text input autocomplete (flutter/engine#39460)
By default, autocomplete is enabled during text input on macOS. On Macs
with the touchbar enabled, the current text input and any suggested
autocompletions are listed in the touchbar.

This adds support for disabling autocomplete when autofill is disabled,
when obscureText is set in the text input configuration, and when the
autofill hint type is "password" or "username". When an AutofillGroup is
in use, we disable autocomplete for all fields within the group when any
of the fields disables autocomplete.

While OS-level autocomplete support is far more robust on iOS, this
behaviour matches our enable/disable state management behaviour on that
platform.

Issue: https://github.com/flutter/flutter/issues/119824
2023-02-07 20:23:32 -08:00
Loïc Sharma
0dbedd3617 [Windows] Remove accessibility root assumptions (flutter/engine#39441)
* [Windows] Remove accessibility root assumptions

* Improve tests

* Improve comment

* Use helper

* Add TODO

* Fix

* Make test more thorough

* Add assertion

* More assertions

* Format

* Tweak comments based off feedback
2023-02-07 23:27:07 +00:00
hangyu
13c33441ef Override _accessibilityHitTest to fix IOS 16 semantics issues (flutter/engine#38794)
* Update SemanticsObject.mm

* lint

* Update SemanticsObjectTest.mm

test

Update SemanticsObjectTest.mm

Update SemanticsObjectTest.mm

test

test

Update SemanticsObject.mm

Update SemanticsObjectTest.mm

Update SemanticsObjectTest.mm

Update SemanticsObject.mm

Update SemanticsObjectTest.mm

update

Update SemanticsObjectTest.mm

* Update SemanticsObjectTest.mm

* Update SemanticsObject.mm

* Update SemanticsObject.mm

* Update SemanticsObject.mm

* Update SemanticsObject.mm

* Update SemanticsObject.mm

* Update SemanticsObject.mm

* Update SemanticsObject.mm

* Update SemanticsObject.mm

* Update SemanticsObject.mm

* Update SemanticsObject.mm

* Update SemanticsObject.mm

* Update SemanticsObject.mm

* Update shell/platform/darwin/ios/framework/Source/SemanticsObject.mm

Co-authored-by: chunhtai <47866232+chunhtai@users.noreply.github.com>

* Update SemanticsObject.mm

* hittestorder

* Update SemanticsObject.h

* Update accessibility_bridge.mm

* Update SemanticsObject.mm

* Update SemanticsObject.mm

* Update SemanticsObject.mm

* Update SemanticsObject.mm

* Update SemanticsObject.mm

* Update SemanticsObjectTest.mm

* Update SemanticsObject.mm

* Update accessibility_bridge_test.mm

---------

Co-authored-by: chunhtai <47866232+chunhtai@users.noreply.github.com>
2023-02-07 22:25:53 +00:00
Jake Schafer
ec42a1d6e0 iOS keyboard animation synchronization (flutter/engine#37604)
* first keyboard commit

* first keyboard commit

* cleaned up from initial testing

* added keyboard animation stop calculation

* added keyboard animation stop calculation

* lucky updates :)

* type change

* final touches

* final touches

* final touches

* removed KeyboardAnimationView class

* removed KeyboardAnimationView class

* dynamic keyboard spring curve implementation

* broke out spring curve to own objc files

* broke out spring curve to own objc files

* simplified and added test

* modified spring formula to use damping

* added logic for compounding simultaneous animation calls

* remove unnecessary code

* cleanup

* cleanup

* update springCurveIos file

* cleaning up

* simple optimizations

* comment update

* bool update

* credit spring calculation project

* improved setupKeyboardAnimationCureveIfNeeded tests

Improved setupKeyboardAnimationCurveIfNeeded tests

* Optimized compounding animation checks and added new tests

* changed viewport update logic

* Update FlutterViewControllerTest.mm

Updated test nits

* Updated license

* Updated tests

* Cleanup

* Migrated spring class based on React

* Updated syntax

* Update shell/platform/darwin/ios/framework/Source/spring_curve_ios.mm

Co-authored-by: Jenn Magder <magder@google.com>

* Update shell/platform/darwin/ios/framework/Source/spring_curve_ios.h

Co-authored-by: Jenn Magder <magder@google.com>

* Updated naming

* Updated naming

* Optimized spring model calculations

* Improved interpolation accuracy

* Revert "Improved interpolation accuracy"

This reverts commit 6d025129b620db44741f70d659900430d9536628.

* Updated comment

* Updated spring curve comments

* updated to work with third_party spring animation

* updated to use SpringAnimation to/from values

* updated license (removed old files)

* updates

* allow updating springanimation position values

* updated test

* update

* fixes

---------

Co-authored-by: Jenn Magder <magder@google.com>
2023-02-07 01:12:23 +00:00
Loïc Sharma
fb53ce4e48 [Windows] Fix the 'engine restart resets keyboard' test (flutter/engine#39380) 2023-02-07 01:00:09 +00:00