Cheaper frosted-glass blurs: sigma 4 and one backdrop read per bar

Blur sigma 16 -> 4 keeps CanvasKit on its direct blur path; under the 84%
fill the look is unchanged (max 13/255 inside the pieces). SegmentedBar's
pieces share a BackdropGroup so Impeller reads the content behind them once.
Adds a scroll frame-time bench, a backdrop census and filler rows to the
full-app probe. CPU CanvasKit, 560x900: run timeline p50 31.8 -> 22.1 ms,
runs list 25.3 -> 19.9 ms.
This commit is contained in:
2026-11-02 00:58:23 +00:00
parent bdf70af7e8
commit b90c7e2d1d
8 changed files with 455 additions and 5 deletions
+11 -2
View File
@@ -163,6 +163,12 @@ class _SegmentedBarState extends State<SegmentedBar> {
final _titleLink = LayerLink();
final _expandedTitle = OverlayPortalController();
/// The row's pieces sit side by side, so they share one read of the
/// content behind them. The expanded title overlaps the content below the
/// bar and is drawn later, in the overlay, so it reads its own.
final _piecesBackdrop = BackdropKey();
final _expandedTitleBackdrop = BackdropKey();
@override
void didUpdateWidget(covariant SegmentedBar oldWidget) {
super.didUpdateWidget(oldWidget);
@@ -269,7 +275,10 @@ class _SegmentedBarState extends State<SegmentedBar> {
constraints: BoxConstraints(
maxWidth: titleSpace.maxWidth,
),
child: titlePill(true),
child: BackdropGroup(
backdropKey: _expandedTitleBackdrop,
child: titlePill(true),
),
),
),
),
@@ -365,7 +374,7 @@ class _SegmentedBarState extends State<SegmentedBar> {
),
child: MediaQuery.withClampedTextScaling(
maxScaleFactor: SegmentedBar.maxTextScale,
child: bar,
child: BackdropGroup(backdropKey: _piecesBackdrop, child: bar),
),
),
),