4771 Commits

Author SHA1 Message Date
gaaclarke
a76ec8c965 reland: Started using FlutterEngineGroups by default on Android (flutter/engine#38367)
* Revert "Revert "Started using FlutterEngineGroups by default on Android  (#37822)" (#38351)"

This reverts commit b0a282e0cc7e0ceb22ce75258c2b9c22266b7f47.

* fixed the entrypoint test

* updated old test

* coldpalelight's suggestion

* added entrypoint args
2022-12-19 11:26:36 -08:00
Chris Bracken
cf89f3ff75 Even though the file is pure C code, it's useful to use a C++ or Objective-C++ filename in order to use FML (assertions) in the implementation. (flutter/engine#38365)
Three implementation changes:
* Since the file is now C++, some implicit void* conversions now require
  an explicit cast.
* A malloc/free of a buffer has been replaced with a std::vector.
* An `assert()` was changed to `FML_DCHECK` for consistency with the
  rest of the embedder.

No test changes since there are no semantic changes.

Existing tests are in:
https://github.com/flutter/engine/blob/main/shell/platform/darwin/common/framework/Source/flutter_standard_codec_unittest.mm
2022-12-16 23:28:01 -08:00
Chris Bracken
1571befea8 [iOS, macOS] Migrate from assert to FML_DCHECK (flutter/engine#38368)
Eliminates raw C asserts in the iOS and macOS embedders, replacing them
with FML_DCHECK for consistency with the rest of the codebase.

No semantic change so no changes to tests.
2022-12-16 19:07:16 -08:00
gaaclarke
29c3e97f45 Sped up FlutterStandardCodec writing speed. (flutter/engine#38345)
* Sped up FlutterStandardCodec writing speed.

* added clear division of reader and writer helpers

* updated doxygen comment
2022-12-16 22:43:55 +00:00
Chris Bracken
dc3033d922 Clarify semantics action dispatch id parameter (flutter/engine#38356)
Previously the embedder API documented this as an action ID, but it's
actually the semantics node ID. This fixes the docs and renames the
parameter to clarify its purpose.

This callback is registered in the framework render bindings:
9102f2fe0b/packages/flutter/lib/src/rendering/binding.dart (L43)

Handled by `_handleSemanticsAction`:
9102f2fe0b/packages/flutter/lib/src/rendering/binding.dart (L360-L366)

Which invokes `SemanticsOwner.performAction`, where the node is looked up by ID:
9102f2fe0b/packages/flutter/lib/src/semantics/semantics.dart (L3258-L3277)
2022-12-16 13:40:48 -08:00
Erik
5262e76f26 Port touch-based tests from embedder integration test (flutter/engine#38234)
* Port touch-based tests from embedder integration test

* Remove RegisterTouchScreen and related variables

* Update embedded child view size
2022-12-16 20:54:07 +00:00
Jason Simmons
b0a282e0cc Revert "Started using FlutterEngineGroups by default on Android (#37822)" (flutter/engine#38351)
This reverts commit 91655b80d28ed70adf4e7f4d82a807a9ede8f885.

This commit caused a regression in the entrypoint_dart_registrant test.
2022-12-16 08:22:44 -08:00
gaaclarke
cf3c286780 Sped up reading with FlutterStandardCodec. (flutter/engine#38327)
* Sped up reading with FlutterStandardCodec.

* added missing license diff

* put the IsStandardType in the header so it's closer to where it should change

* added unittest for subclassing codecs

* fixed lints
2022-12-16 01:40:56 +00:00
Matej Knopp
b56271e908 Add missing include to FlutterThreadSynchronizer (flutter/engine#38337) 2022-12-15 15:55:40 -08:00
gaaclarke
91655b80d2 Started using FlutterEngineGroups by default on Android (flutter/engine#37822)
* Started using FlutterEngineGroups by default on Android and making
them accessible to plugins.

* added docstring

* format
2022-12-15 13:50:38 -08:00
LongCatIsLooong
648fe736a7 Migrate iOS text input plugin to use ARC (flutter/engine#38179)
* migrate iOS text input plugin to ARC

* review

* review

* review
2022-12-15 20:02:05 +00:00
Chris Bracken
55911c9c7f [linux] Allow overriding asset, ICU data path (flutter/engine#38296)
Support setting a custom asset directory and ICU data path.

Fixes: https://github.com/flutter/flutter/issues/117103
Issue: https://github.com/flutter/flutter/issues/117102
2022-12-15 08:25:01 -08:00
Bruno Leroux
876852439d [Windows] Synthesize modifier keys events on pointer events (flutter/engine#38138)
Co-authored-by: Bruno Leroux <bruno.leroux@gmail.com>
2022-12-15 07:25:11 +00:00
Chris Yang
b5a39aae41 Revert "Revert "reland "Migrate darwin common "framework_shared" target to ARC #37049" (#37219)" (#37320)" (flutter/engine#37883)
This reverts commit 27186a3bc77361fecf18729f7161c9895457222b.
2022-12-15 00:25:04 +00:00
Matej Knopp
ed9d9bf372 [macOS] Refactor rendering infrastructure (flutter/engine#37789)
* [macos] Refactor rendering process

* Put includes and imports together

* Update shell/platform/darwin/macos/framework/Source/FlutterCompositor.mm

Co-authored-by: Chris Bracken <chris@bracken.jp>

* Update shell/platform/darwin/macos/framework/Source/FlutterCompositor.mm

Co-authored-by: Chris Bracken <chris@bracken.jp>

* Update shell/platform/darwin/macos/framework/Source/FlutterCompositor.mm

Co-authored-by: Chris Bracken <chris@bracken.jp>

* Update shell/platform/darwin/macos/framework/Source/FlutterPlatformViewController.mm

Co-authored-by: Chris Bracken <chris@bracken.jp>

* Update shell/platform/darwin/macos/framework/Source/FlutterRenderer.mm

Co-authored-by: Chris Bracken <chris@bracken.jp>

* Remove cast

* Do not manually add platform view layer to FlutterView

* Remove unnecesary _Internal header files

* Make surfaceManager a readonly property

* Add comment

* Style nit: Rewrite as a noun phrase.

* Naming nit for consistency with removeSurfaceForSize:

* Write as ternary conditional.

* Fix plural in comment.

* Offset and index are already set to 0.

* Remove FlutterSurfaceManager lookupSurface

And the associate bookkeeping of borrowed (lent) surfaces.

* Update shell/platform/darwin/macos/framework/Source/FlutterThreadSynchronizer.mm

Co-authored-by: Chris Bracken <chris@bracken.jp>

* Update shell/platform/darwin/macos/framework/Source/FlutterSurfaceManager.mm

Co-authored-by: Chris Bracken <chris@bracken.jp>

* Update shell/platform/darwin/macos/framework/Source/FlutterSurfaceManagerTest.mm

Co-authored-by: Chris Bracken <chris@bracken.jp>

* Update shell/platform/darwin/macos/framework/Source/FlutterRenderer.mm

Co-authored-by: Chris Bracken <chris@bracken.jp>

* Update shell/platform/darwin/macos/framework/Source/FlutterSurfaceManagerTest.mm

Co-authored-by: Chris Bracken <chris@bracken.jp>

* Update shell/platform/darwin/macos/framework/Source/FlutterSurfaceManager.h

Co-authored-by: Chris Bracken <chris@bracken.jp>

* Update shell/platform/darwin/macos/framework/Source/FlutterSurfaceManagerTest.mm

Co-authored-by: Chris Bracken <chris@bracken.jp>

* Update shell/platform/darwin/macos/framework/Source/FlutterSurfaceManager.h

Co-authored-by: Chris Bracken <chris@bracken.jp>

* Update shell/platform/darwin/macos/framework/Source/FlutterSurfaceManager.h

Co-authored-by: Chris Bracken <chris@bracken.jp>

* Update shell/platform/darwin/macos/framework/Source/FlutterSurfaceManager.h

Co-authored-by: Chris Bracken <chris@bracken.jp>

* Fix build error

* Address nits

* Replace EVent with fml::AutoResetWaitableEvent

* Remove unecessary CATransaction

* Add GetRequiredFrameSize

Co-authored-by: Chris Bracken <chris@bracken.jp>
2022-12-14 20:40:56 +01:00
Victoria Ashworth
61f2e6b757 Fix issues related to keyboard inset (flutter/engine#37719)
* fix keyboard inset not collapsing when expected

* fix some formatting

* fix issue with rotating with undocked and split keyboard

* fix formatting

* fix behavior on slide over view

* fix formatting

* refactor to make logic more clear

* move enum to header file, remove unneeded parameters, syntax fixes, remove rotation logic

* ignore notification if app state is not active, change way it checks if keyboard intersects with screen to accomodate for repeating decimals, format

* fix leaking unit test

* use viewIfLoaded and update tests to fix mocking

* change ignore logic related to application state to be more specific

* add more comments

* add more comments

* change function name to be more clear, add warning log if view is not loaded, update a comment
2022-12-14 18:15:38 +00:00
Jenn Magder
fd06286e6a Always set orientation preferences on iOS 16+ (flutter/engine#38230) 2022-12-13 18:46:06 +00:00
Loïc Sharma
b5f1b4d403 [Windows] Fix headless mode crash (flutter/engine#38173) 2022-12-12 19:50:03 +00:00
Chris Bracken
bd43e9cc99 [embedder] Consistent naming for GL/Metal tests (flutter/engine#38141)
While I've sent a patch to mark the shell/platform/embedder/tests and
fixtures directories as test exempt (since they are tests), by
convention, tests should end in _unittests.* for C++ tests, and _test.*
for Dart tests. This renames for consistency with other tests such as
embedder_a11y_unittests.cc.

Uncovered by https://github.com/flutter/engine/pull/38133

Related: https://github.com/flutter/cocoon/pull/2340
Issue: https://github.com/flutter/flutter/issues/116381
2022-12-08 11:28:52 -08:00
Chris Bracken
354ce9ffe0 [embedder] Expose metal surface from test context (flutter/engine#38133)
This is a minor cleanup that exposes the test metal surface to tests via
EmbedderTestContextMeta::GetTestMetalSurface for parity with the
GetTestMetalContext method which exposes the test metal context. This
eliminates the need for the more specific GetTextureInfo method since
the texture info is accessible via the test context.

This is a test refactoring with no semantic differences to the engine.

Issue: https://github.com/flutter/flutter/issues/116381
2022-12-08 10:23:29 -08:00
Loïc Sharma
8c119e59da [Windows] Add more cursor plugin tests (flutter/engine#38112)
* [Windows] Add more cursor plugin tests

* Tweak

* Add dependency
2022-12-08 00:42:23 +00:00
Chris Bracken
0fab2ea52d [embedder] Ensure destruction called on present (flutter/engine#38078)
This is a followup to flutter/engine#38038.

In that patch, a destruction callback for textures created via the
FlutterRendererConfig callbacks (as opposed to by the FlutterCompositor
callbacks) was added and passed through to the texture info attached to
the SurfaceFrame generated in
GPUSurfaceMetalSkia::AcquireFrameFromMTLTexture (called via
GPUSurfaceMetalSkia::GetMTLTexture, which invokes the
get_next_drawable_callback), however, in order for the destruction
callback to make it to the presented Skia texture, it needs to be passed
through to the present callback here:
960af0a350/shell/gpu/gpu_surface_metal_skia.mm (LL233)

which is invoked by the submit callback passed to Skia:
960af0a350/shell/gpu/gpu_surface_metal_skia.mm (LL239)

The present callback is implemented in EmbedderSurface::PresentTexture,
which invokes the present callback registered in
FlutterMetalRendererConfig.present_drawable_callback. This patch ensures
that the destruction callback is passed through to Skia's present
callback so destruction occurs in the right place.

Issue: https://github.com/flutter/flutter/issues/116381
2022-12-07 20:40:22 +00:00
Camille Simon
374a9b507f [iOS] Change locale format for spell check (flutter/engine#38080)
* Change format

* Add pointer

* Check length

* Add check
2022-12-07 20:09:16 +00:00
fzyzcjy
52668a7252 Reland fix wrong VSYNC event (flutter/engine#37865) 2022-12-07 13:46:06 -05:00
Erik
b7bf0a3155 Full implementation of text-input-test (flutter/engine#37986)
Implements text-input-test, validates that we're able to receive the correct platform messages through the flutter/keyevent channel
2022-12-07 12:17:51 -05:00
Nayuta403
c2290f0a8f Create FlutterActivity/FlutterFragment using light weight engine with FlutterEngineGroup (flutter/engine#36963) 2022-12-07 09:17:03 -08:00
yaakovschectman
a204b24bf5 Preliminary implementation of UIA for A11y on Windows (flutter/engine#37754)
* Initial

* Comment TODOs

* Shim windowsx

* Comment testing

* UIA works at most basic

* Get Native target in win delegate

* Rework events

* FlutterWindowsView unit tests for UIA

* Enable UIA unit tests

* Conditional UIA implementation

* Text selection MSAA event

* License

* PR

* Before change to AccessibilityBridgeWindows

* AccessibilityBridgeWindows in FlutterWindowsEngine

* Use AccessibilityBridgeWindows for AXFragmentRootDelegateWin

* Format

* Remove unneeded windowsx_shim imports

* PR Comment
2022-12-07 11:12:13 -05:00
Siva
aac2690ea4 Roll Dart SDK from 35a9facce191 to e517487c5679 (Dart 3.0) (flutter/engine#38105)
* Remove uses of --no-sound-null-safety in preparation for the Dart 3.0
roll.

* Update quiver package to latest.

* Run Fuchsia engine in null safe mode.

* Run Fuchsia engine in non null safe mode.

* Update Dart version to 3.0

* Address review comments.
2022-12-06 20:38:02 -08:00
Reid Baker
e192a12f91 Add gradle option to allow/show System.out.print logs (flutter/engine#38104)
This is useful for java test debugging.
Audit of all java tests shows only 4 logged lines so this should
not add log spam but will aid in contributor test debugging.
2022-12-06 19:46:06 +00:00
Loïc Sharma
b209893339 [Windows] Make the engine own PlatformHandler (flutter/engine#37855) 2022-12-05 20:29:33 +00:00
Chris Bracken
d260fc82cd [embedder] Ensure FlutterMetalTexture cleanup call (flutter/engine#38038)
This ensures FlutterMetalTexture.destruction_callback gets called.

FlutterRendererConfig.get_next_drawable_callback holds a callback used by the embedder API to request a drawable; in the case of Metal, this drawable is a FlutterMetalTexture.

FlutterMetalTexture.destruction_callback should be called when it's safe to release resources associated with the FlutterMetalTexture. This callback is not currently invoked for textures returned via FlutterRendererConfig.get_next_drawable_callback; instead we unpack the returned struct and pass it on.

In the compositor codepath, we do create an SkSurface that triggers the destruction callback, here:
bbdb5d6a3e/shell/platform/embedder/embedder.cc (L868-L881)

Issue: https://github.com/flutter/flutter/issues/116381
2022-12-03 01:30:23 -08:00
JiaJian
96d100ebb0 save (flutter/engine#37107) 2022-12-03 00:41:46 +00:00
Chris Bracken
c31eadc734 Fix typo in Animator comment (flutter/engine#38040)
Animation::Render -> Animator::Render. Spotted during some code
archaeology during a review.
2022-12-02 21:05:12 +00:00
gaaclarke
5a10c0ead2 Made responses to platform methods threadsafe in linux (flutter/engine#37689)
* Made responses to platform methods threadsafe in linux

* brought back the logic that the engine clears handlers

* removed leak

* more feedback
2022-12-02 00:45:20 +00:00
Aleksandr Denisov
6ead832a81 Remove glitches when scrolling on old Android TV devices (flutter/engine#37493) 2022-12-01 21:24:04 +00:00
Kingtous
0ddd54b5e4 feat: add custom cursor interface on windows (flutter/engine#36143)
* feat: initial custom cursor and cache support

* opt: add cursor validity check

* opt: format code

* opt: rename more suitable name

* opt: key, method name

* opt: code

* feat: add unittests

* opt: change to ref

* opt: docs

* opt: format code

* opt: code

* opt: correct code and comments

* opt: rgba -> bgra

* opt: name

* opt: create valid/compatible mask of bitmap & mask

* opt: null check

* opt: split cursor functions into configurable ones

* fix: EncodableValue type

* opt: doc for custom cursor key

* update: cursor doc

* opt: docs

* opt: refactor vector cache to unordered_map

* opt: code

* opt: unifrom key value

* opt: uniform key_iter to name_iter

* opt: docs

* fix: get width out of range
2022-12-01 21:08:28 +00:00
Nayuta403
d5c65a7518 Fix: The Background and Overlay ImageView leak (flutter/engine#37424)
* remove image

* add test

* remove
2022-12-01 21:05:05 +00:00
ColdPaleLight
4db98c0aad [Impeller] Implement 'ui.Image.toByteData()' (flutter/engine#37709)
* [Impeller] Implement 'ui.Image.toByteData()'

* Tweak code
2022-12-01 04:30:16 +00:00
Chris Bracken
37f3705de9 Fix typo on avoid_backing_store_cache param doc (flutter/engine#37985)
Fixes a one character typo spotted in the doc comment for the
avoid_backing_store_cache parameter to the EmbedderExternalViewEmbedder
ctor.
2022-11-30 23:03:05 +00:00
Xilai Zhang
91b5562fe4 [gn] embed mac codesign metadata in android artifacts (flutter/engine#37951)
* add top level metadata for androids

* add top level metadata for androids
2022-11-29 18:24:21 +00:00
Emircan Uysaler
8a3da8a9d5 [flatland] Update bug numbers. (flutter/engine#37880) 2022-11-23 16:14:48 -08:00
Loïc Sharma
b9a416eb8d [Windows] Refactor PlatformHandler's tests (flutter/engine#37820)
* Start

* Add missing line

* Order

* Clean up includes

* Feedback

* Tweak
2022-11-22 23:41:42 +00:00
gaaclarke
633e238909 Made platform message responses threadsafe for macos. (flutter/engine#37607) 2022-11-22 22:22:04 +00:00
Emircan Uysaler
326622e3f1 Set nested clip nodes (flutter/engine#37850) 2022-11-22 17:07:36 -05:00
cfontas
02f77a716e fix pixel ratio (flutter/engine#37268) 2022-11-22 16:32:20 -05:00
Bruno Leroux
ed7aea9a05 [Linux] Synthesize modifier keys events on pointer events (flutter/engine#37491)
Co-authored-by: Bruno Leroux <bruno.leroux@gmail.com>
2022-11-21 20:34:41 +00:00
Chris Bracken
d094a6a0f5 [macOS] Add explicit weak/strong/copy annotations (flutter/engine#37768)
This adds explicit strong/copy Objective-C property annotations where
they were previously implied on NSObject properties and fixes on case
where it was previously improperly specified.
2022-11-21 10:53:18 -08:00
Zachary Anderson
2a9bcb43d1 [Impeller] Present Impeller contents in a transaction when there is a platform view (flutter/engine#37809) 2022-11-21 09:45:26 -08:00
Dan Field
6be3cc1572 [Impeller] Format shader sources. (flutter/engine#37770)
* Update format.dart to include glsl, format repo

* format more
2022-11-21 17:21:02 +00:00
Chris Bracken
a48a0bc388 [macOS] Use consistent filenames for tests (flutter/engine#37755)
Previously there were two conventions for test filenames in the macOS
embedder: some ended in Unittests.mm and others eneded in Test.mm. This
applies a consistent naming convention, which is also consistent with
the iOS and common Darwin tests. Stock C++ unittests should continue to
use the _unittests.cc convention.
2022-11-18 13:40:00 -08:00