-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ImageFilter default tile mode automatic selection breaking change not…
…ice (#11338) Breaking change notice for flutter/flutter#154935 . Engine PR should land shortly... ## Presubmit checklist - [ ] This PR is marked as draft with an explanation if not meant to land until a future stable release. - [ ] This PR doesn’t contain automatically generated corrections (Grammarly or similar). - [ ] This PR follows the [Google Developer Documentation Style Guidelines](https://developers.google.com/style) — for example, it doesn’t use _i.e._ or _e.g._, and it avoids _I_ and _we_ (first person). - [ ] This PR uses [semantic line breaks](https://github.com/dart-lang/site-shared/blob/main/doc/writing-for-dart-and-flutter-websites.md#semantic-line-breaks) of 80 characters or fewer. --------- Co-authored-by: Parker Lougheed <[email protected]>
- Loading branch information
1 parent
5fba15f
commit 547da8f
Showing
2 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
82 changes: 82 additions & 0 deletions
82
src/content/release/breaking-changes/image-filter-blur-tilemode.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
--- | ||
title: ImageFilter.blur default tile mode automatic selection. | ||
description: >- | ||
If a tile mode wasn't specified in the constructor, ImageFilter.blur will | ||
select one based on the rendering context. | ||
--- | ||
|
||
## Summary | ||
|
||
The `ui.ImageFilter.blur`'s default tile mode is now automatically selected | ||
by the backend. Previously `TileMode.clamp` was used unless a different tile | ||
mode was specified. Now, the default is `null` and specifies automatic | ||
selection unless a specific tile mode is specified. | ||
|
||
## Background | ||
|
||
`ImageFilter.blur`'s _tile mode_ specifies what happens to edge pixels for | ||
the applied filter. There are four options, `TileMode.clamp` (the previous | ||
default), `Tilemode.repeated`, `TileMode.mirror`, and `TileMode.decal`. | ||
Previously, `ImageFilter` defaulted to `clamp` mode if the | ||
behavior wasn't specified, which sometimes surprised developers | ||
as it didn't always match expectations. | ||
|
||
As of this change, the filter automatically selects the following tile modes | ||
based on context: | ||
|
||
* `decal` with save layers and when applied to individual shape draws | ||
(drawRect, drawPath, ...) | ||
* `mirror` with backdrop filters. | ||
* `clamp` for drawImage. | ||
|
||
## Migration guide | ||
|
||
Only blur image filters that don't specify an explicit tile mode are | ||
impacted by this change. We believe that the new defaults are generally | ||
better and would recommend removing any specified blur tile modes. | ||
|
||
|
||
Code before migration: | ||
|
||
```dart | ||
var filter = ui.ImageFilter.blur(sigmaX: 4, sigmaY: 4, tileMode: TileMode.decal); | ||
``` | ||
|
||
Code after migration: | ||
|
||
```dart | ||
var filter = ui.ImageFilter.blur(sigmaX: 4, sigmaY: 4); | ||
``` | ||
|
||
## Timeline | ||
|
||
Landed in version: 3.27.0-1.0.pre.30 | ||
In stable release: Not yet | ||
|
||
## References | ||
|
||
{% include docs/main-api.md %} | ||
|
||
API documentation: | ||
|
||
* [`ImageFilter`][] | ||
* [`TileMode`][] | ||
|
||
Relevant issues: | ||
|
||
* [Issue #154935][] | ||
* [Issue #110318][] | ||
* [Issue #157693][] | ||
|
||
Relevant PRs: | ||
|
||
* [Change default TileMode for blur ImageFilter objects to null][] | ||
|
||
|
||
[`ImageFilter`]: https://api.flutter.dev/flutter/dart-ui/ImageFilter-class.html | ||
[`ImageFilter.blur`]: https://api.flutter.dev/flutter/dart-ui/ImageFilter/ImageFilter.blur.html | ||
[`TileMode`]: https://api.flutter.dev/flutter/dart-ui/TileMode.html | ||
[Issue #154935]: https://github.com/flutter/flutter/issues/154935 | ||
[Issue #110318]: https://github.com/flutter/flutter/issues/110318 | ||
[Issue #157693]: https://github.com/flutter/flutter/issues/157693 | ||
[Change default TileMode for blur ImageFilter objects to null]: https://github.com/flutter/engine/pull/55552 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters