4513 Commits

Author SHA1 Message Date
J-P Nurmi
6321cd7b64 [Linux][FlView] guard against disconnecting a disconnected signal (flutter/engine#35490)
GObject's dispose() method may be called multiple times. Guard against
trying to disconnect the same signal multiple times by clearing the ID
to avoid warnings when closing the window.

```
(bug:74019): GLib-GObject-WARNING **: 11:15:08.697: ../../../gobject/gsignal.c:2731: instance '0x55e1c3ea0200' has no handler with id '255'
```
2022-08-25 13:27:20 -07:00
yaakovschectman
ceb25d38d0 Detect high contrast mode on Windows (flutter/engine#35682)
* Recognize high contrast theme switch

* Trigger high contrast mode based on OS

* Confirm updated status and flag via unit test

* Remove null check, format

* Formatting

* More formatting

* Import order

* Refactor for PR

* Formatting

* Rename Update to Send

* Remove queued flags

* Add OnThemeChange unit test

* Format for linux_unopt

* Remove unneeded expect

* Test SendInitialAccessibilityFeatures

* Keep null check to embedder
2022-08-25 16:24:21 -04:00
Alexander Biggs
2b0b6b630f [fuchsia] Document found != flatland_views.end(). (flutter/engine#35607)
This crash has come up a number of times and we tend to
burn time looking in the wrong places for the fix. Documenting
some stuff about how we've fixed it previously in the error
message.
2022-08-24 16:00:39 -04:00
hangyu
81cf8b00d9 Support BoldText for a11y in android (flutter/engine#35589)
* Update AccessibilityBridge.java

* Add test

* lint

* lint

* Add TargetApi

* Add comment

* Update constant
2022-08-24 20:19:55 +08:00
Jonah Williams
27b4f29d7e Include TextureLayer in contents of toImageSync (flutter/engine#35608) 2022-08-23 02:16:06 +00:00
yaakovschectman
53c321a3e3 Include checkbox in check state update (flutter/engine#35557)
* Include checkbox in check state update

* Windows test for checkbox native state

* Reformat to appease linux_unopt test

* More format hoops

* Update accessibility_bridge_unittests.cc

* Update flutter_windows_view_unittests.cc
2022-08-22 16:01:02 -04:00
Zachary Anderson
0969d4c4a1 Adjust rules for analyze_snapshot (flutter/engine#35585) 2022-08-22 11:26:22 -07:00
Casey Hillers
1c20221e24 Revert "Include TextureViews in the output of Scene.toImage[Sync]" (flutter/engine#35587) 2022-08-22 10:26:09 +00:00
godofredoc
be9ba9f07f MacOS framework was simplified to remove an internal zip. (flutter/engine#35563) 2022-08-20 05:30:19 +00:00
Chris Bracken
e8b5dd908e [Windows] Set Platform.executable on engine start (flutter/engine#35560)
When setting FlutterProjectArgs.command_line_argv prior to launching the
engine, we were previously setting a placeholder value rather than the
executable name. This resulted in Platform.executable (from dart:io)
returning "placeholder" in application code.

This updates the Windows implementation for consistency with macOS and
guarantees that Platform.executable will return a reasonable value in
Dart code.

Note that this does not affect Platform.resolvedExecutable, which returns
a full, resolved path, and is implemented in the Dart runtime itself.
Previously the code:

   print(Platform.executable);
   print(Platform.resolvedExecutable);

resulted in the following output on Windows:

   flutter: placeholder
   flutter: C:\path\to\project\build\windows\runner\Debug\project.exe

after this patch, it results in:

   flutter: project.exe
   flutter: C:\path\to\project\build\windows\runner\Debug\project.exe

Issue: https://github.com/flutter/flutter/issues/83921
2022-08-20 02:38:49 +01:00
David Worsham
b0d80cc091 [fuchsia] Migrate integration test to CFv2 (flutter/engine#35318) 2022-08-19 17:58:53 -07:00
Jonah Williams
ed952f4503 Include TextureViews in the output of Scene.toImage[Sync] (flutter/engine#35527)
Update Picture rasterization for toImage to accept a layer tree, optionally flattening on the raster thread if present.
Update Deferred GPU image for toImageSync to accept a layer tree, flattening it the first time it creates an image, storing the resulting display list.

This is also a performance fix for the zoom page transition, which currently does too much work on the UI thread on frame 1
2022-08-19 16:28:30 -07:00
chunhtai
1a38d2e54b Updates accessible_navigation trigger in Android (flutter/engine#35478)
* Updates accessible_navigation trigger in Android

* update doc comments

* comment

* addressing comment
2022-08-19 13:54:47 -07:00
Kaushik Iska
7cdcb0f837 Do not override partial repaint support globally (flutter/engine#35539) 2022-08-19 18:41:46 +00:00
Zachary Anderson
407fb9e192 Revert "Pushing BackdropFilter Mutator (#34355)" (flutter/engine#35543)
This reverts commit ab6376ac20f0ab557b5d4737a8b61f20716b8e85.
2022-08-19 10:01:01 -07:00
gaaclarke
8e8b3912a0 Backfilled unit tests for IncomingMessageDispatcher. (flutter/engine#35139)
* Backfilled unit tests for IncomingMessageDispatcher.

* added license golden
2022-08-18 17:30:34 -07:00
Gary Qian
b30aeada6d Upgrade Android SDK to 33 Tiramisu (flutter/engine#35415) 2022-08-19 00:26:52 +00:00
WenJingRui
d36bf1d5e3 [iOS] Avoid keyboard animation junk and laggy on Promotion devices. (flutter/engine#34871) 2022-08-18 22:26:00 +00:00
simonla
1711a00c0d Avoid object creation during each frame (flutter/engine#35343) 2022-08-18 18:45:47 +00:00
xiaomiao
d490b4edae Move task running to UI thread for loadDartDefferredLibrary. (flutter/engine#35460) 2022-08-18 16:43:24 +00:00
Loïc Sharma
5da65cec98 [Windows] Don't crash if GetPointerType is unsupported (flutter/engine#35442) 2022-08-17 21:50:46 +00:00
Jenn Magder
b2529fd20a Prevent leaking inputViews between iOS unit tests (flutter/engine#35450) 2022-08-17 18:15:05 +00:00
Jason Simmons
9e3d202f48 Null check for the activity intent in FlutterEngineConnectionRegistry.attachToActivityInternal (flutter/engine#35419) 2022-08-16 14:58:05 +00:00
Jim Graham
5f9579eae8 Display list multiplexer (flutter/engine#35421) 2022-08-16 05:34:52 +00:00
Loïc Sharma
8f877e0315 [Windows] Add callback for when the next frame is drawn (flutter/engine#35408) 2022-08-15 23:17:04 +00:00
Jaeheon Yi
e8f7bc4f7d [fuchsia] Adjust FakeFocuser inheritance (flutter/engine#35413) 2022-08-15 15:56:27 -07:00
Chinmay Garde
88bf841fa6 Fix race in PushingMutlipleFramesSetsUpNewRecordingCanvas. (flutter/engine#35412) 2022-08-15 21:28:30 +00:00
harbor
814bd40d90 Fix PlatformView multiple pointer crash caused by toMotionEvent (flutter/engine#34182) 2022-08-15 12:05:26 +00:00
Chris Bracken
491db72a66 [Windows] Migrate error logging to FML_LOG (flutter/engine#35367)
Migrates error logging from logging directly to stderr to using the
FML_LOG macro with a specified log level.

No additional tests since there is no semantic change to the logging
(FML_LOG simply writes to stderr).
2022-08-12 22:19:39 -07:00
Bernardo Eilert Trevisan
d9da8e0d2e Enable dirty region management within the Embedder API (flutter/engine#35022) 2022-08-12 10:52:54 -07:00
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