4483 Commits

Author SHA1 Message Date
Chris Bracken
c9a4689faf [Windows] Support native functions in test fixtures (flutter/engine#35357)
Adds the ability to register native functions for use in test fixtures.
This allows registering native C++ functions that can be invoked from
Dart code to perform the following common actions:

* Signal a waiting latch in the C++ part of the test.
* Pass data back to the C++ part of the test.
* Allow the C++ part of the test to pass data to the test.

Fixes: https://github.com/flutter/flutter/issues/109242
Fixes: https://github.com/flutter/flutter/issues/87299
2022-08-12 01:17:38 +01:00
Chris Bracken
0daf9e6c85 Add doc comments to WindowsTestContext (flutter/engine#35350)
Adds missing doc comments to WindowsTestContext.

Issue: https://github.com/flutter/flutter/issues/87299
2022-08-11 14:04:31 -07:00
Javon Thomas
ab6376ac20 Pushing BackdropFilter Mutator (flutter/engine#34355) 2022-08-10 21:36:39 +00:00
Shivesh Ganju
0f4214ccfd [fuchsia][scenic] Reset the state of a PointerInjectorEndpoint on (flutter/engine#35241)
channel closure.

This CL resets the state including cleaning up the buffers whenever
a fuchsia.ui.pointerinjector.Device channel closes due to some error.

Test: flutter_runner_tests
2022-08-10 16:43:59 -04:00
Chris Bracken
93f9caca1f [Windows] Replace memset with C++ alternatives (flutter/engine#35312)
Eliminate a few uses of memset in the code, replacing them with C++
alternatives, like using initialiser list syntax and std::array + fill.
This avoids some double-hardcoding of array length in the code.
2022-08-10 19:40:11 +01:00
Chris Bracken
2712ac0d4b Support custom entrypoints in public Windows API (flutter/engine#35285)
This adds a dart_entrypoint field to FlutterDesktopEngineProperties in
the public C Windows API, which mirrors that in the embedder API.

When a null or empty entrypoint is specified, a default entrypoint of
'main' is assumed. Otherwise, the app is launched at the top-level
function specified, which must be annotated with
@pragma('vm:entry-point') in the Dart source.

This change is backward-compatible for existing users of the Windows C API
and the C++ client wrapper API. To avoid breaking backward compatibility,
this patch preserves the entry_point parameter to FlutterDesktopEngineRun
in the public Windows C API as well as in the FlutterEngine::Run method
in the C++ client wrapper API. The entrypoint can be specified in either
the engine properties struct or via the parameter, but if conflicting
non-empty values are specified, the engine launch will intentionally fail
with an error message.

This change has no effect on existing Flutter Windows desktop apps and no
migration is required, because our app templates never specify a custom
entrypoint, nor was the option to specify one via the old method particularly
feasible, because the FlutterViewController class constructor immediately
invokes FlutterViewControllerCreate which immediately launches the engine
passed to it with a null entrypoint argument, so long as the engine is not
already running. However, running the engine without a view controller
previously resulted in errors due to failure to create a rendering surface.

This is a followup patch to https://github.com/flutter/engine/pull/35273
which added support for running Dart fixture tests with a live Windows
embedder engine.

Fixes: https://github.com/flutter/flutter/issues/93537
Related: https://github.com/flutter/flutter/issues/87299
2022-08-10 18:31:03 +01:00
Chris Bracken
9215e15d91 Add FLUTTER_DEPRECATED macro and flutter_macros.h (flutter/engine#35293)
Adds a new header, flutter_macros.h which includes a FLUTTER_DEPRECATED
macro that can be used to mark deprecated API as such, with a
hopefully-informative message, ideally describing the expected removal
version and any migration tips.

This will need to be #included in flutter_windows.h and flutter_linux.h,
but prior to doing so, we'll need to update the engine recipe to bundle
the new header, here:
https://flutter.googlesource.com/recipes/+/refs/heads/main/recipes/engine/engine.py#1457

No tests since this adds a compiler macro that will be used for future
C/C++ API deprecation once the above recipe change has landed;
specifically: FlutterDesktopEngineProcessMessages.

Related: https://github.com/flutter/flutter/issues/93537
2022-08-10 17:23:09 +01:00
Chris Bracken
41609b4521 Formatting: Correct whitespace in flutter_export.h (flutter/engine#35292)
Fixes a minor whitespace inconsistency on the documentation for
FLUTTER_EXPORT.

No test change since there is no change to code semantics.

Related: https://github.com/flutter/flutter/issues/93537
2022-08-10 17:22:01 +01:00
J-P Nurmi
5ced18fed0 [Linux] use top-level GTK IM client window (flutter/engine#35272)
This PR takes a step back and changes the GTK IM client window back from FlView to GtkApplicationWindow as it was before #33111. The window was originally changed to FlView to make the code testable by cutting a dependency to gtk_widget_translate_coordinates(). The change was hard to revert because there were several conflicting changes on top. Therefore, this PR introduces an FlTextInputViewDelegate to be able to provide coordinate mapping in a testable way.

Fixes: flutter/flutter#108832
2022-08-09 16:55:41 -07:00
Dan Field
132ab1a321 Reland toImageSync (flutter/engine#35283) 2022-08-09 22:32:04 +00:00
Dan Field
abbca7b5e4 Revert "Collect textures from toImageSync safely (#35073)" (flutter/engine#35281)
This reverts commit 1f9bb2c26554f53995e7d02afc54a5566ad3310c.
2022-08-09 14:32:32 -07:00
Dan Field
1f9bb2c265 Collect textures from toImageSync safely (flutter/engine#35073) 2022-08-09 13:21:59 -07:00
Chris Bracken
4a1f6e5569 Support fixture tests for Windows embedder (flutter/engine#35273)
This adds support for running end-to-end tests that use a live engine to
run Dart test fixtures. This enables testing the public Windows C API in
//flutter/shell/platform/windows/public/flutter_windows.h

This only adds support for a single test entrypoint (main). A followup
patch will add support for this. See:
https://github.com/flutter/flutter/issues/93537

Issue: https://github.com/flutter/flutter/issues/87299
2022-08-09 19:35:32 +01:00
Chris Bracken
105625bb77 [Windows] Shut down VM on shutdown of last engine (flutter/engine#35251)
All Flutter engines in the same process share a common Dart VM, which is
launched with the start of the first engine in the process and should be
terminated when the last engine in the process has been deallocated.

Formerly, it was not possible to cleanly shut down and restart the VM in
a process, but this was resolved in the Dart SDK and a flag exposed in
flutter/engine#10652. Since some embedders take advantage of the fact
that the VM remains running after engine shutdown, this flag is not
enabled by default, however it should be enabled for the Windows
embedder, which we control.

No tests added since this is not testable via any API to which the
Windows embedder has access. The behaviour of this flag is tested in the
embedder API tests in `EmbedderTest.VMShutsDownWhenNoEnginesInProcess`
in shell/platform/embedder/tests/embedder_unittests.cc.

Issue: https://github.com/flutter/flutter/issues/109191
2022-08-09 17:44:40 +01:00
Chris Bracken
f935a6d1d9 [Windows] Fix dllimport issue in unit tests (flutter/engine#35246)
In flutter/engine#35106, I landed a parameter type fix for the
declaration of FlutterDesktopEngineGetTextureRegistrar in our public
Windows C API. I also added a unit test that called this function.

That function (and all others) in our public Windows API is marked
FLUTTER_EXPORT, which resolves to __declspec(dllexport) or
__declspec(dllimport) depending on whether FLUTTER_DESKTOP_LIBRARY is
defined. It can be defined by adding the following build config:
//flutter/shell/platform/common:desktop_library_implementation

If the function is marked as an import, we get linker warnings that
we're importing a function that's defined in the same executable image.
This patch resolves this by marking the functions as export.

An alternative fix would be to support a third macro resolution that
resolves to nothing in the presence of some definition like
FLUTTER_NO_EXPORT; however, since flutter_export.h is a public header,
I'd prefer not to complicate it further, and this is a unit test that
can't be linked against either way.

Issue: https://github.com/flutter/flutter/issues/109184
Original issue: https://github.com/flutter/flutter/issues/86617

See: https://github.com/flutter/engine/blob/main/shell/platform/common/public/flutter_export.h
See: 61c0051a63/shell/platform/common/BUILD.gn (L8-L10)

No new tests since this simply fixes a link warning message in unit tests.
2022-08-09 01:04:40 +01:00
Loïc Sharma
a015114478 [Embedder API] Add next frame callback (flutter/engine#35244) 2022-08-08 23:19:04 +00:00
Jonah Williams
1245043020 Support hot reload of asset fonts (flutter/engine#35213) 2022-08-08 18:06:05 +00:00
Zachary Anderson
ab33453a89 Roll mac clang, ignore spurious lints (flutter/engine#35196) 2022-08-05 15:50:08 -07:00
Jonah Williams
43c54b4b98 Update setAssetDirectory service extension to fail if provided path is invalid (flutter/engine#35178) 2022-08-05 15:47:04 +00:00
Dwayne Slater
86d2aa6f59 Fix handling of external texture transforms on Android (flutter/engine#24888) 2022-08-05 00:12:04 +00:00
Jim Graham
1413379354 Embedders use DisplayListBuilder for compositing (flutter/engine#35170) 2022-08-04 22:23:04 +00:00
J-P Nurmi
bacc6eb5cc [Linux] remove AtkText stub implementation (flutter/engine#34839)
When Orca has "Speak object under mouse" enabled, it tries to get the
text range extents for any object that implements the AtkText interface
and gets a bit confused by our AtkText stub implementation that merely
returns null for `get_text`.

Removing the stub implementation helps to avoid the issue that Orca
would try to call `atk_text_get_range_extents()` with `start_offset=0`
and `end_offset=0`:

> Atk-CRITICAL **: atk_text_get_range_extents: assertion 'start_offset >= 0 && start_offset < end_offset' failed
2022-08-04 11:33:55 -07:00
Nayuta403
e46b6ee859 Make FlutterEngineGroup support more params (#107394) (flutter/engine#34663) 2022-08-04 03:43:04 +00:00
Chris Bracken
3e485ec15e [Windows] Add missing testing namespace (flutter/engine#35131)
flutter_windows_unittests.cc had its tests inside the flutter namespace
rather than the flutter:testing namespace. This adds the missing
namespace and makes one namespace-related cleanup in one of the key
event unit tests as well.

This is a post-landing cleanup for PR:
https://github.com/flutter/engine/pull/35106

Issue: https://github.com/flutter/flutter/issues/86617
2022-08-03 20:26:44 +01:00
Chris Bracken
66e6cd880d [Windows] Fix incorrect public C API argument type (flutter/engine#35106)
FlutterDesktopEngineGetTextureRegistrar is used to get the texture
registrar associated with an engine object and therefore should take a
FlutterDesktopEngineRef parameter.

This bug was initially identified and fixed by @knopp in:
https://github.com/flutter/engine/pull/27522

This patch replaces that one and adds the simplest possible unit test to
get it landed.

This also adds an initial unit test for the public Windows C API used to
implement the C++ client wrapper. In order to fully test this API, we'll
want to support test fixtures similar to what we do in the embedder API
tests. See: https://github.com/flutter/flutter/issues/87299

Fixes: https://github.com/flutter/flutter/issues/86617
2022-08-03 01:09:48 +01:00
Jim Graham
74e390f3d4 fix typos buider -> builder (flutter/engine#35104) 2022-08-02 22:58:03 +00:00
Camille Simon
f428a1aa1f Delete splash screen guidance with old APIs (flutter/engine#35014) 2022-08-02 21:51:04 +00:00
Ryan Macnak
3efe2e75e1 Remove architecture restriction from //flutter/testing:opengl. (flutter/engine#35098)
Cf. f7163f555c764e00ff220d079361fe9511f959f4.

Bug: https://github.com/flutter/flutter/issues/90425
Bug: https://github.com/flutter/flutter/issues/103386
2022-08-02 13:46:29 -07:00
Xilai Zhang
6effb999a6 [gn] entitlement config for macos framework zip (flutter/engine#34987) 2022-08-02 15:51:08 +00:00
Jia Hao
8de3c46804 Javadoc for background platform chnanels (flutter/engine#34774) 2022-08-01 22:43:04 +00:00
Chinmay Garde
6a65c72d43 Don't insist on modules when attempting to include the Flutter umbrella header. (flutter/engine#35060) 2022-08-01 22:09:04 +00:00
Chinmay Garde
2bd509563a [Impeller] Remove redundant GN flags. (flutter/engine#35062) 2022-08-01 21:54:03 +00:00
Tong Mu
1f64120a78 [Window, Keyboard] Fix repeat events of modifier keys (flutter/engine#35046) 2022-08-01 21:41:03 +00:00
Tong Mu
b5c58a0a9b [macOS, Keyboard] Fix Khmer layout crashing (flutter/engine#35044)
Fix test

Impl
2022-08-01 13:58:29 -07:00
Chris Bracken
f33f5c486e [Windows] Merge PlatformHandlerWin32 to superclass (flutter/engine#35056)
With the removal of the UWP embedder, we can merge Win32-specific
implementation classes with their abstract superclasses where those
superclasses existed only to support both UWP and Win32.

No new tests since this is purely a restructuring of existing code
within the Win32 embedder, with no expected change in behaviour.
Covered by existing tests in task_runner_unittests.cc.

Issue: https://github.com/flutter/flutter/issues/108386
2022-08-01 21:12:36 +01:00
Chris Bracken
374899e94b [Windows] Merge TaskRunnerWin32 into TaskRunner (flutter/engine#35029)
With the removal of the UWP embedder, we can merge Win32-specific
implementation classes with their abstract superclasses where those
superclasses existed only to support both UWP and Win32.

No new tests since this is purely a restructuring of existing code
within the Win32 embedder, with no expected change in behaviour.

Issue: https://github.com/flutter/flutter/issues/108386
2022-08-01 20:09:01 +01:00
Jaeheon Yi
392af31793 [fuchsia] Convert Gfx PlatformView to use modern TouchSource API (flutter/engine#35018)
Original PR: #32877

Revert of #32877: commit 6a1def3db7da00641f9fabab3d09d7326a7bdfd6 (#33471)

*This* patch: Revert of #33471

fxbug.dev/85125
2022-08-01 12:06:23 -07:00
Chris Bracken
75fbd93951 [Windows] Merge SettingsPluginWin32 and superclass (flutter/engine#35019)
This merges SettingsPluginWin32 into SettingsPlugin.

With the removal of the UWP embedder, we can merge Win32-specific
implementation classes with their abstract superclasses where those
superclasses existed only to support both UWP and Win32.

No new tests since this is purely a restructuring of existing code
within the Win32 embedder, with no expected change in behaviour.

Issue: https://github.com/flutter/flutter/issues/108386
2022-07-30 19:07:20 +01:00
Chris Bracken
4d4da408e0 Eliminate Win32 suffixes in KeyboardManager (flutter/engine#35008)
This renames KeyboardManagerWin32 to KeyboardManager and updates all
usage sites and tests.

This is a followup to 89bbfcc, which applied most of the straightforward
renamings of FooWin32 to Foo (or where a superclass Foo exists,
FooWindows) to the Windows embedding. In that patch I missed
KeyboardManagerWin32, as well as two straightforward file renames:
* keyboard_win32_common.{h,cc} -> keyboard_utils.{h,cc}
* system_utils_win32.cc -> system_utils.cc

No new tests since this is a rename with no semantic change intended.

Issue: https://github.com/flutter/flutter/issues/108386
2022-07-29 13:51:36 -07:00
Chris Bracken
8372fc6a32 Eliminate redundant Win32 suffix in Windows embedder (flutter/engine#34983)
Now that we've removed the UWP embedder, eliminate remaining Win32
suffixes on identifiers and _win32 suffixes from filenames.

This renames all files and types ending in _win32/Win32 that don't
require further rework/merging/simplification. All remaining files/types
ending in _win32/Win32 are less straightforward and will be submitted
class by class.

Issue: https://github.com/flutter/flutter/issues/108386
2022-07-29 10:16:55 -07:00
Matej Knopp
5c9df63ade [macOS] Remove isComposing workaround (flutter/engine#33838) 2022-07-29 09:21:12 +02:00
xster
3ddada0be5 We should delete this old embedding class, but fixing an urgent issue b/240230736 to unblock Android rolls inside Google (flutter/engine#34980) 2022-07-28 21:26:15 -07:00
Wu Zhong
42f499b4f0 [iOS] Fixes SplashScreenView crash when remove from view hierarchy (flutter/engine#34496) 2022-07-29 02:11:04 +00:00
gaaclarke
645ac3c239 optimized IncomingMessageDispatcher::HandleMessage a bit (flutter/engine#34954)
* optimized IncomingMessageDispatcher::HandleMessage a bit.

* removed std::string ref
2022-07-28 14:12:57 -07:00
Filip Filmar
e4a2f48892 [fuchsia] Support multi-line text editing (flutter/engine#34410)
Multi-line text editing and actions other than DONE were
never implemented in Flutter on Fuchsia.  This change
implements the feature, by plumbing the desired action
through to Fuchsia proper, and back, as Fuchsia's text
editing API expects.

Tested: the new behavior was verified by Fuchsia-side
integration tests.

Issue: https://github.com/flutter/flutter/issues/106905
2022-07-28 13:33:11 -07:00
Chinmay Garde
7d7a19a1fd Remove IO manager Fuchsia workaround. (flutter/engine#34959) 2022-07-28 06:10:03 +00:00
Chinmay Garde
e1218270fd Don't compile the Skia GL backend on iOS. (flutter/engine#34924) 2022-07-28 00:51:03 +00:00
Wu Zhong
2452603d31 [iOS API breaking change] Make splashScreenView of FlutterViewController nullable (flutter/engine#34743) 2022-07-27 20:13:03 +00:00
Chris Bracken
97e03b7033 [Windows] Rename WindowWin32 to Window (flutter/engine#34920)
With the removal of the UWP embedder, there's no longer any need to call
out that a given class is Win32-specific, since the Win32 embedder is
now our only embedder.

Issue: https://github.com/flutter/flutter/issues/108386
2022-07-27 18:51:03 +01:00
Alexander Biggs
57ffd65615 [fuchsia] Add comment explaining config-data. (flutter/engine#34940) 2022-07-27 13:37:45 -04:00