ProxyResolution class Cost and policy

The proxy's recording resolution, as an integer divisor of the device pixel ratio.

An integer because that is what was measured (1 to 8) and because it keeps the ratio comparable between devices; on a device whose own ratio is integral it also keeps one texel a whole number of device pixels, so the source grid and the texel grid share a phase.

The policy picks one per frame; a host pins one through GlassHost.resolution, which is how an unpriced divisor gets priced (see ProxyDivisorReason.pinnedByHost). Its tables can also be read directly:

const ProxyResolution quarter = ProxyResolution.quarter();
final ProxyDamage? damage = ProxyResolution.damageAtTexelScale(
  'regularDark',
  quarter.ratioFor(3), // a dpr-3 phone: 0.75 texels per logical pixel
);
final double? capture = quarter.captureCostFactor(ProxyCostModel.areaCharged);

See also:

Annotations

Constructors

ProxyResolution.divisor(int divisor)
Recording at 1/divisor of the device pixel ratio. divisor is at least 1.
const
ProxyResolution.full()
Recording at the screen's own resolution.
const
ProxyResolution.half()
Recording at half the device pixel ratio, a quarter of the texels.
const
ProxyResolution.quarter()
Recording at a quarter of the device pixel ratio — what the policy picks for regular on a dpr-2 screen at the default budget.
const

Properties

divisor → int
How many times coarser than the screen the proxy is recorded, per axis.
final
hashCode → int
The hash code for this object.
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

captureCostFactor(ProxyCostModel model) → double?
Capture price relative to ProxyResolution.full on the same hardware, or null when this point was never measured.
deliveredSigmaLogical(double devicePixelRatio) → double
What this divisor low-passes the proxy by, in logical pixels, before any blur pass runs — relative to a full-resolution recording, which is the frame every comparison here is made in.
meanDamage(String finish, {bool blurCorrected = false}) → double?
Mean ΔE against the same finish at full resolution, over seven test scenes, or null for a divisor that was never measured.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
ratioFor(double devicePixelRatio) → double
Texels per logical pixel.
residualSigmaFor(double finishSigmaLogical, double devicePixelRatio) → double?
The sigma a blur pass should ask for so the finish lands at finishSigmaLogical rather than past it — or null when this divisor has already exceeded the finish and no blur can undo it.
routeCostFactor(ProxyCostModel model) → ProxyRouteCost?
What the whole route costs at this divisor, relative to the same route at full resolution — or null where nobody has measured it.
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
override

Static Properties

measuredDivisors → List<int>
The divisors the tables above have rows for, deepest last.
final

Static Methods

damageAtTexelScale(String finish, double texelsPerLogicalPixel, {bool blurCorrected = false}) → ProxyDamage?
Mean ΔE at a texel scale — texels per logical pixel, which is what ratioFor returns and what the damage actually indexes on.
maxDivisorFor(double finishSigmaLogical, double devicePixelRatio) → int
The largest divisor at which a finish of finishSigmaLogical is still reachable — a ceiling from the optics, not a recommendation.

Constants

damageSource → const String
The reports test/proxy_recorder_test.dart re-derives the two tables from, tracked because a constant baked into the package needs its source in the repository.
damageSourceCorrected → const String
The same measurement as damageSource under the blur-corrected recipe — the source of meanDamage(..., blurCorrected: true).
damageTableDevicePixelRatio → const double
The density the damage table was taken at — which is what makes its rows texel scales of 1.0, 0.5 and 0.25 rather than divisors of 2, 4 and 8.
kMaterialScaleDeltaE → const double
ΔE between Apple's own .regular and .clear glass on one backdrop, measured off iOS 26.
lightDamageSource → const String
Where regularLight's rows came from: the same measurement, both recipes, over regular and regularLight — and the regular rows reproduce damageSource and damageSourceCorrected to 0.0006 ΔE, which is what lets a row from another run sit in this table.
lightDamageSourceCorrected → const String
lightDamageSource under the blur-corrected recipe.
magnificationSource → const String
The run that says the table's key survives a magnification that is not a power of two, and the reason the 3 and 6 rows can be read the same way as the others.
measuredFinishes → const List<String>
Finishes the damage table has rows for, in the order of how much backdrop they let through — which is also the order of how much a lost texel costs them.
metalAdditionAreaShare → const double
What a two-point fit of A·f + C with f = 1/k² over divisors 1 and 4 returns for the share of the route's addition a divisor can buy back on Metal (M2 iPad Pro). Do not price anything with it.
metalBlurCurveSource → const String
The middle of that curve, which says the knee belongs to the blur pass itself rather than to the route around it.
metalBlurSplitSource → const String
The run that says what a divisor actually buys, by turning the residual blur pass off and measuring the same two divisors again.
metalRouteCostSource → const String
The run routeCostFactor's four factors are read from — one binary, one shuffled order, one floor, all four divisors.
metalRouteSources → const Map<int, String>
The pair of runs routeCostFactor is read from, digested to their cells.
metalThreePointSource → const String
A run with three divisors in one binary, in shuffled order.
sigmaPerTexel → const double
Gaussian-equivalent sigma the recording delivers on its own, in texels — the rasterization at the texel grid plus the bilinear reconstruction back.
transportControlSources → const Map<int, String>
The same runs with the photographic backdrop pinned to one density instead of following the view, at dpr 1 and 4.
transportSources → const Map<int, String>
The same measurement at three screen densities — the runs that say which key the damage table has. Keyed by the device pixel ratio.
transportSpreadMedian → const double
How far apart two measurements at the same texel scale and different densities landed, over densities 1…4: the accuracy of every number damageAtTexelScale returns away from its own row.
xclipseDefaultSource → const String
The run that measured the default policy on a host that declares no hardware, beside the two divisors it could have landed on, pinned 1 and pinned 4, in one binary.
xclipseRouteSources → const Map<int, String>
The two runs that justify ProxyResolutionPolicy.choose lowering the resolution on ProxyCostModel.unmeasured at all, digested and keyed by the shuffle seed they ran under.