GlassTier enum Cost and policy
What a surface paints. The rungs of the finish ladder, in order of what they draw rather than of what they cost.
A whole host is on one rung, chosen by a GlassTierPolicy and handed to GlassHost.tier as a GlassTierChoice. A single surface can still be read at its own rung through GlassSurfaceRecord.tier.
final GlassTierChoice choice = const GlassTierPolicy(
ceiling: GlassTier.cheap,
).choose();
assert(!choice.tier.readsBackdrop); // nothing on this screen is captured
See also:
- GlassTierPolicy, which turns the application's signals into a rung.
- GlassLoad.capturedSurfaceCount, which counts only the full surfaces.
- g1455.plugfox.dev/foundations/tiers, for the three rungs side by side.
Values
- full → const GlassTier
-
The route: proxy, atlas, residual blur, refraction, rim.
- cheap → const GlassTier
-
The same shape, the same rim, and the finish's own tint drawn straight over whatever is behind — no backdrop read at all.
The "no read" half is a requirement rather than an optimisation: on Skia a
BackdropFiltergrows with the number of surfaces (0.37 M cycles at 6 against 1.26 M at 36, on Adreno). A screen whose surfaces are all below full takes no capture, so there is no texture to read even by accident.The level it produces is not a new constant: drawing a tint of alpha
aover the backdrop ismix(backdrop, tint, a), the same affine law that fits Apple's own materials on four backdrops (R² = 1.0000). So this rung transmits1 - aof what is behind it — for GlassFinish.regularDark the 0.307 measured off.regularitself. The material's level survives; what is lost is the low-pass and the refraction. - opaque → const GlassTier
-
A fill: the same shape and rim, nothing behind it showing through.
The reason for it is accessibility, not economy. It is the rung Apple's own Reduce Transparency lands on, and the only one that answers a reader who cannot read text over a moving background at all.
What it fills with is the same law as the other two rungs, evaluated at the declared backdrop —
mix(GlassThemeData.backdrop, tint, a), see GlassFinish.opaqueFillOver. The tint alone (that law ata = 1) is the colour the material lays on, not the level it shows: over a light screen it is 23.3 ΔE from the glass it stands in for, against 2.4 through the declared backdrop. This is the one rung that needs something declared about the backdrop: it reads nothing, so it can measure nothing.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- index → int
-
A numeric identifier for the enumerated value.
no setterinherited
- name → String
-
Available on Enum, provided by the EnumName extension
The name of the enum value.no setter - readsBackdrop → bool
-
Whether this rung reads a proxy. True for full and nothing else, and it
is the whole structural consequence of the axis: the host captures for the
surfaces where this is true and for no others.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited