Fixing two HEIF decoding issues on Android:
API 36: ImageDecoder has a known issue decoding HEIF images with certain
gain maps. Image won't load. The workaround is to use BitmapFactory
instead.
Pre-36: HEIF Flipping did not work. Image is upside.
| |Before | After |
|---|---|---|
| Api 36 | <img width="320" height="714"
alt="Screenshot_20251010_151132"
src="https://github.com/user-attachments/assets/c1f48e0e-def8-4d8e-9847-c2ca9dac16e4"
/> | <img width="320" height="714" alt="Screenshot_20251010_150551"
src="https://github.com/user-attachments/assets/f0df1d19-3a5d-4751-b529-1e062a0af48c"
/> |
| Pre Api 36 | <img width="320" height="714"
alt="Screenshot_20251010_150752"
src="https://github.com/user-attachments/assets/9291d76b-d383-49d5-b9d7-add8bbf33e59"
/> | <img width="320" height="714" alt="Screenshot_20251010_150703"
src="https://github.com/user-attachments/assets/814454dc-d97a-4baf-9a8c-d9b5fe6ac51e"
/> |
Fixes: #176407
## Pre-launch Checklist
- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [X] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [X] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [X] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [X] All existing and new tests are passing.
---------
Co-authored-by: Gray Mackall <mackall@google.com>
fixes https://github.com/flutter/flutter/issues/177172
I believe the issue is that the struct was not fully initialized (which
is usually not a problem, but can sometimes get garbage values and start
hanging). The solution is probably to initialize the struct. Let's see
if it fixes CI :)
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
## Description
This PR fixes a crash in the macOS text input plugin that occurs when
`NSAttributedString` is passed to the `insertText:replacementRange:`
method instead of `NSString`.
### Root Cause
The `insertText:replacementRange:` method of `NSTextInputClient`
protocol can receive either `NSString` or `NSAttributedString`. The
previous implementation directly called `UTF8String` on the input
parameter without type checking. Since `NSAttributedString` doesn't
respond to the `UTF8String` selector, this caused a crash with the
error:
-[NSConcreteMutableAttributedString UTF8String]: unrecognized selector
sent to instance
### Changes Made
- Added type checking to determine if the input is `NSAttributedString`
- Extract the underlying `NSString` using `[string string]` before
calling `UTF8String`
- This follows the same pattern already implemented in the
`setMarkedText:selectedRange:replacementRange:` method in the same file
### Crash Stack Trace
Thread 0 Crashed: 0 CoreFoundation __exceptionPreprocess 1
libobjc.A.dylib objc_exception_throw 2 CoreFoundation
-[NSObject(NSObject) doesNotRecognizeSelector:] 3 FlutterMacOS
-[FlutterTextInputPlugin insertText:replacementRange:]
(FlutterTextInputPlugin.mm:784) 4 AppKit
-[NSTextInputContext(NSInputContext_WithCompletion)
insertText:replacementRange:completionHandler:]
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
---------
Co-authored-by: Kim Ki Cheol <kim.kicheol@sk.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Dart recently moved Perfetto to dart/third_party/perfetto/src (see
https://dart.googlesource.com/sdk/+/07c9599ead52a2eea7164552e9525e3860a3aed5)
This PR extends create_updated_flutter_deps to handle dependencies
placed in an "src" subdirectory within the directory named for the
package.
It also adds a mapping for packages hosted at android.googlesource.com.
(Perfetto no longer needs to be fetched from Flutter's mirror
repository)
## What's new?
- Implemented `DialogWindowControllerWin32` for win32 dialogs 🚀
- Refactored and updated the Win32 embedder to support dialogs
- Updated the `multiple_windows` example to demonstrate both modal and
modeless dialogs
- Added integration tests for the dialog windows
- Added tests for dialogs in the embedder
## How to test?
1. Run the `multiple_windows` example application with a local engine
built from this pull request
2. Click the `Modeless Dialog` creation button on the main window
3. Open a regular window and click the `Modal Dialog` creation button
4. Note the behavior of modal and modeless dialogs
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
fixes https://github.com/flutter/flutter/issues/176417
This fixes the linked issue in so far as it is possible today. This opts
for the runtime lookup of bindings since it avoids all sort of messy
issues when dealing with codegen. This doesn't stop us from doing
codegen in the future.
This also adds tests for hot reload cases that would fail in the past,
like inserting new uniforms.
## Limitations
1) It doesn't handle component names like ".r" or ".x". This is possible
if we want.
1) It doesn't handle nested structs. This isn't possible with the
current shader metadata and may be a limitation with glsl?
## Features
1) Slots can be cached to amortize the cost of looking up the bindings
1) Works with hot reload (tested inserting a uniform before one accessed
by name)
## Followup work
I plan on filing the following issues:
1) Map postfixes like ".r" ".z" to offsets so a uniform can be "foo.z"
1) Support nested structs so a uniform name can be "foo.bar"
1) Support codegen for uniforms to get compile-time uniform name support
## Example
```dart
ShaderBuilder(
assetKey: 'shaders/grayscale.frag',
(context, shader, _) {
Color color = Colors.red;
shader.getUniformFloat('uColor', 0).set(color.r);
shader.getUniformFloat('uColor', 1).set(color.g);
shader.getUniformFloat('uColor', 2).set(color.b);
return BackdropFilter(
filter: ImageFilter.shader(shader),
child: Container(
color: Colors.transparent,
),
);
},
),
```
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
Changes since last roll
```
2d8e0359a76 (tag: 3.11.0-17.0.dev, origin/lkgr-dev) Version 3.11.0-17.0.dev
06be66b5b60 [cfe] Don't nest deferred prefix scopes
07c9599ead5 [vm] Tweak location of Perfetto protos
```
Includes build changes to accommodate perfetto move.
This is the second version of WebParagraph. It includes pretty much all
SkParagraph functionality except struts and justifications (eventually
they will be implemented, too).
Part of https://github.com/flutter/flutter/issues/172561
---------
Co-authored-by: Mouad Debbar <mdebbar@google.com>
This matches the other platforms who have already done this migration
(Android and iOS in 3.32, Windows and MacOS in 3.33).
Applications may opt-out of this change by setting the thread policy to
unmerged with:
```c
fl_dart_project_set_ui_thread_policy(project, FL_UI_THREAD_POLICY_RUN_ON_SEPARATE_THREAD);
```
in `linux/runner/my_application.cc`
Adds target to merge queue, the only place that the CAH is used to
produce artifacts. Today this is built in post submit and only uploads
to the githash artifact.
This should not add these artifacts to release builders as the
`enabled_branches` is set to "master"
fixes#176603
This is needed by file watching implementation after
dart-lang/sdk@ed6bab847b
Ideally we should actually move this whole code into `io_natives.{h,cc}`
on the Dart runtime side to avoid duplication.
Fixing Keyboard Animation Issue
Before:
https://github.com/user-attachments/assets/2b863ca1-20e3-47e2-94f1-5cb2083c1e28
After:
https://github.com/user-attachments/assets/914efc84-13aa-4bde-8c44-d1761f1fe79aFixes: #168768
## Pre-launch Checklist
- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [X] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [X] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [X] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [X] All existing and new tests are passing.
The build script for this version of the Vulkan headers defines
VK_USE_PLATFORM_XLIB_KHR. This brings in some X11 headers that define
macros with commonly used names.
Files that include Vulkan headers may need to undefine some of these
macros to prevent conflicts with other code that uses the same names.
This PR introduces a new protocol `FlutterImplicitEngineDelegate`, which
adds a callback called `didInitializeImplicitFlutterEngine`, which
returns a new interface called `FlutterImplicitEngineBridge`.
This was added to expose parts of an implicit `FlutterEngine`, such as
when created from a `FlutterViewController` in a storyboard.
``` swift diff
@objc class AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}
func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) {
// Register plugins with `engineBridge.pluginRegistry`
GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry)
// Create method channels with `engineBridge.applicationRegistrar.messenger()`
let batteryChannel = FlutterMethodChannel(
name: "samples.flutter.dev/battery",
binaryMessenger: engineBridge.applicationRegistrar.messenger()
)
...
// Create platform views with `engineBridge.applicationRegistrar.messenger()`
let factory = FLNativeViewFactory(messenger: engineBridge.applicationRegistrar.messenger())
...
}
```
This PR also refactors `FlutterPluginRegistrar` into 3 separate
protocols:
* `FlutterBaseRegistrar`
* `FlutterApplicationRegistrar`
* `FlutterPluginRegistrar`
Most methods are moved from `FlutterPluginRegistrar` to
`FlutterBaseRegistrar` and then `FlutterPluginRegistrar` and
`FlutterApplicationRegistrar` inherit from `FlutterBaseRegistrar`.
`FlutterPluginRegistrar` also has additional methods specific to it -
there are no meaningful/breaking changes to `FlutterPluginRegistrar`.
Fixes https://github.com/flutter/flutter/issues/173357.
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
Flutter has been migrated from dart:js_util (which is unsupported by
dart2wasm) to dart:js_interop, so we can remove/migrate all the
remaining references to js_util.
(Essentially a re-issue of
https://github.com/flutter/flutter/pull/174682 which ended up with
broken Google Testing links)
We had 2 different implementations of the rendering code for the
performance overlay layer. The skia version used some skia-specific code
to render the overlay incrementally into an offscreen surface and so we
created a different implementation for Impeller that only uses standard
rendering calls (and no surface cache). It turns out that the Impeller
version was faster anyway even on Skia so it is a simple change to
delete the old code and always use the new visualizer.
The new visualizer reduces the time to render the graph from just under
1ms to about .1ms on Skia.
The new visualizer takes .1ms longer to compute on the UI thread, but
overall we save time between the 2 threads.
The new visualizer is much faster on Impeller.
Some work could be done to save some of that time on the UI thread by
only incrementally updating the graph data, but for now we can take the
~.8-.9ms savings with just some deleted code.
**What/Why**
On Flutter Web with semantics enabled, <input type="email"> can reject
selection APIs in some browsers, causing:
cursor to not advance while typing,
selection to fail (and selected text not deletable),
and, in some cases, InvalidStateError exceptions.
This PR updates the semantics editing element for email fields to keep
selection/cursor APIs working while preserving email UX.
**How**
In
engine/src/flutter/lib/web_ui/lib/src/engine/semantics/text_field.dart:
Use type="text" for SemanticsInputType.email
Add inputmode="email" (keeps email keyboard layout/hints)
Add autocomplete="email" (preserves autofill)
Add autocapitalize="none" (prevents unwanted capitalization)
Remove the attributes when not email
Rationale: type="text" avoids browser selection restrictions;
inputmode="email" preserves the expected email keyboard; autofill and
capitalization behavior is retained/optimized.
**Before/After**
Before the change
https://email-0923-before.web.app/
After the change
https://email-0923.web.app/
**Impact**
Cursor now advances correctly while typing in email fields under
semantics.
Text can be selected and deleted normally.
Avoids InvalidStateError crashes with accessibility semantics enabled.
**Tests/Verification**
Manually verified on Chrome and safari:
Typing in email fields advances cursor correctly
Drag-select, double-click select, and Cmd/Ctrl+A work
Deleting selected text works
No exceptions thrown with semantics enabled
Autofill prompts continue to appear when saved emails are available.
Mobile keyboards (iOS/Android) show email-optimized layout via
inputmode="email".
**Fixed issues**
Fixesflutter/flutter#173239
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
## What's new?
- Renamed `DisplayMonitor` to `DisplayManager` on win32
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.