Skip to content

Commit c7348c2

Browse files
authored
Clarifies blur group optimization (flutter#191613)
issue: flutter#191207 This clarifies that the blur groups need identical properties to collapse the blur. ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [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]. If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance. **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 [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [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
1 parent 15d8908 commit c7348c2

1 file changed

Lines changed: 15 additions & 7 deletions

File tree

‎packages/flutter/lib/src/widgets/basic.dart‎

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -505,13 +505,21 @@ class BackdropGroup extends InheritedWidget {
505505
/// {@endtemplate}
506506
///
507507
/// Multiple backdrop filters can be combined into a single rendering operation
508-
/// by the Flutter engine if these backdrop filters widgets all share a common
509-
/// [BackdropKey]. The backdrop key uniquely identifies the input for a backdrop
510-
/// filter, and when shared, indicates the filtering can be performed once. This
511-
/// can significantly reduce the overhead of using multiple backdrop filters in
512-
/// a scene. The key can either be provided manually via the `backdropKey`
513-
/// constructor parameter or looked up from a [BackdropGroup] inherited widget
514-
/// via the `.grouped` constructor.
508+
/// by the Flutter engine if these backdrop filter widgets all share a common
509+
/// [BackdropKey] and have equivalent filter configurations. The backdrop key
510+
/// uniquely identifies the input for a backdrop filter, and when shared, indicates
511+
/// that the backdrop capture can be shared and filtering can be performed once
512+
/// if the filters are identical. This can significantly reduce the overhead of
513+
/// using multiple backdrop filters in a scene. The key can either be provided
514+
/// manually via the `backdropKey` constructor parameter or looked up from a
515+
/// [BackdropGroup] inherited widget via the `.grouped` constructor.
516+
///
517+
/// To combine the filter passes into a single operation, the resolved filters
518+
/// across the group must have identical properties. For example, using a "bounded"
519+
/// blur ([ImageFilterConfig.blur] with `bounded: true` or [ui.ImageFilter.blur]
520+
/// with non-null `bounds`) assigns unique layout bounds to each widget, which
521+
/// prevents the engine from collapsing them into a single blur pass (though the
522+
/// initial backdrop capture is still shared across the group).
515523
///
516524
/// Backdrop filters that overlap with each other should not use the same
517525
/// backdrop key, otherwise the results may look as if only one filter is

0 commit comments

Comments
 (0)