4144 Commits

Author SHA1 Message Date
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
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
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
gaaclarke
1ac0bf4389 Made FlutterTextField that outlive FlutterTextPlatformNode not crash (flutter/engine#37735)
* Made FlutterTextField that outlive FlutterTextPlatformNode not crash.

* added test
2022-11-18 13:08:01 -08:00
Jonah Williams
8a1834c4d8 [Impeller] register modern shaders on Vulkan too (flutter/engine#37757) 2022-11-18 20:57:32 +00:00
Jonah Williams
667b6c0816 [Impeller] use SSBOs for gradients where supported (metal/vulkan) (flutter/engine#37654)
* [Impeller] use uniform array for more efficient small gradients

* ++

* Make this work on Android

* ++

* ++

* ++

* compiler support and basic feature detection

* ++

* ++

* rename to ssbo_fill, move to context

* ++

* ++

* ++

* tests

* ++

* ++
2022-11-18 19:02:20 +00:00
Alexander Brusher
42fb1ed9d7 [fuchsia][a11y] Set explicit hit regions in flatland embedder (flutter/engine#37338) 2022-11-18 18:16:14 +00:00
Chris Yang
6eb43b7697 iOS PlatformView only sets a maskView when necessary (flutter/engine#37434)
* only clip when necessary

tests

fix tests

format

review

fix

add scenario tset

more scenario tests

add docs and comments

use offset.zero

* remove mistakenly checked-in code
2022-11-18 02:43:50 +00:00
Chris Bracken
861b1223ec [macOS] Cleanup unnecessary references to Metal (flutter/engine#37733)
Removes a few unncessary references to Metal in the macOS embedder. Now
that Metal is the only supported rendering implementation for the macOS
embedder, specifying a class as a Metal variant is redundant.

Issue: https://github.com/flutter/flutter/issues/108304
Issue: https://github.com/flutter/flutter/issues/114445
2022-11-17 17:00:35 -08:00
Chris Bracken
5a3f2e36e7 [macOS] Merge FlutterBackingStore implementations (flutter/engine#37730)
Now that OpenGL support has been removed from the macOS embedder, we
merge FlutterRenderBackingStore and its only implementing subclass,
FlutterMetalRenderBackingStore, and similarly
FlutterRenderBackingStoreProvider and its only implementing subclass
FlutterMetalRenderBackingStoreProvider.

Issue: https://github.com/flutter/flutter/issues/108304
Issue: https://github.com/flutter/flutter/issues/114445
2022-11-17 17:00:16 -08:00
Jason Simmons
0010be93cd Add semantics constants to the exported symbols list for the embedder library (flutter/engine#37526)
Fixes https://github.com/flutter/flutter/issues/114657
2022-11-17 21:50:04 +00:00
Jenn Magder
3085f214f9 Turn on clang tidy error for underscores in Google tests (flutter/engine#37700) 2022-11-17 21:13:11 +00:00
Tong Mu
d3c69d6108 [Multiwindow] Renderers receive view IDs as argument (flutter/engine#36593)
* Impl

* Format

* TODO comments

* Fix compile

* Better empty indication

* Change invalid ID to -1

* fix doc

* Change to default view

* Better doc

* Update doc of FlutterFrameInfo

* Change to ID

* Address comment

* Fix comment

* To assertion

* Fix compile
2022-11-17 20:11:53 +00:00
Chris Bracken
0b728cbf70 [macOS] Merge FlutterSurfaceManager and impls (flutter/engine#37701)
Previously, FlutterSurfaceManager was a protocol with two concrete
implementations: FlutterGLSurfaceManager and FlutterMetalSurfaceManager.
Most of the implementation was in a shared superclass,
FlutterIOSurfaceManager, which called into the OpenGL or Metal-specific
subclass when backend-specific operations (such as allocating textures)
was required. It did so via a delegate pattern, wherein the subclasses
both implemented the FlutterIOSurfaceManagerDelegate protocol that
exposed the backend-specific functionality.

Now that only the Metal implementation remains, the delegate code can be
inlined into the calling functions, and the class hierarchy can be
squashed into a single concrete implementation class,
FlutterSurfaceManager, similar to how it was originally implemented in
https://github.com/flutter/engine/pull/21525 before we had two backends.

Issue: https://github.com/flutter/flutter/issues/108304
Issue: https://github.com/flutter/flutter/issues/114445
2022-11-17 11:46:27 -08:00
Chris Bracken
468e714771 [macOS] Consolidate external texture classes (flutter/engine#37703)
Previously, external textures were modelled in the macOS embedder by a
top-level FlutterMacOSExternalTexture protocol with a single textureID
getter, and two implementations: FlutterExternalTextureGL and
FlutterExternalTextureMetal.

With the removal of OpenGL support from the macOS embedder, the only
remaining external texture implementation is Metal. This patch squashes
this set of types into a single FlutterExternalTexture class.

Issue: https://github.com/flutter/flutter/issues/108304
Issue: https://github.com/flutter/flutter/issues/114445
2022-11-17 10:44:01 -08:00
Chris Bracken
aee7b74c33 [macOS] Merge FlutterRenderer and implementation (flutter/engine#37696) 2022-11-17 09:28:40 -08:00
Kaushik Iska
5d5a04b2b3 Fix potential null-point references (flutter/engine#37678) 2022-11-16 22:08:04 +00:00
yaakovschectman
adc79c3cf3 Add back tooltip to Embedder (flutter/engine#37676)
* Add back tooltip to Embedder

* Test inclusion of tooltip data

* Change to constexpr

* Lint
2022-11-16 17:02:09 -05:00
stuartmorgan
7bbe571f14 Fix resize crash in Android virtual display (flutter/engine#37329)
In the Virtual Display codepath for Android platform views, resize
completes asynchronously. Currently it is attempting to access the
Context in the completion handler, but there is no guarantee that it
is still present at that point, leading to possible null pointer
crashes.

This adds a check for the current state of the Context, and uses a
fallback if it's not available.

Fixes https://github.com/flutter/flutter/issues/114095
2022-11-16 19:06:30 +00:00
Josh Gargus
a1255b6105 [fuchsia] Fix shader warmup. (flutter/engine#37662)
Before, ~VulkanSurface() invokes a potentially empty std::function.
Now, checks if it is empty before invoking it.
2022-11-16 13:35:13 -05:00
Chris Bracken
c26cb23881 [macOS] Merge FlutterMetalCompositor, superclass (flutter/engine#37648)
Now that OpenGL support in Flutter on macOS has been removed, the only
FlutterCompositor implementation is the Metal-based compositor. This
patch merges it into the FlutterCompositor base class since there's no
longer any reason to keep the interface separate from its implementation.

This patch will be followed by similar patches for the renderer, surface
manager, and external textures.

Issue: https://github.com/flutter/flutter/issues/108304
Issue: https://github.com/flutter/flutter/issues/114445
2022-11-16 09:56:22 -08:00