glass_diagnostics library Diagnostics
The seams a benchmark turns, kept out of g1455.dart.
Each of these changes how the glass is drawn or exposes the host's plumbing so a run can count it — none of them is something an application declares. They are public because the benchmarks that price the package live in another package and have to reach them; an application that imports this library is running an experiment.
Did this frame capture?
The host publishes a GlassProxyHandle through GlassProxyScope; its counters say what the host did, which is what a test or a report reads:
final GlassProxyHandle? handle = GlassProxyScope.maybeOf(context);
final int before = handle?.snapshots ?? 0;
// … pump a frame …
final bool captured = (handle?.snapshots ?? 0) > before;
The variants a measurement was priced with
- debugGlassFusedSplit and debugGlassFoldCull: how a GlassGroup's fused draw is split and culled.
- debugGlassShaderAntiAlias: the shader's anti-alias flag.
- debugGlassShaderLoader: the loader a test replaces to see a load fail.
Each has a measured default; set one back when the run is over.
Models without a frame
GlassRippleField and GlassBackdropReadings are the ripple's and the adaptive glass's models, which a test drives directly.
Classes
- GlassBackdropReadings Diagnostics
- The verdicts of every glass under one host, as something a component can listen to.
- GlassBackdropVerdict Diagnostics
- One glass's verdict over time: the readings it is offered, and the one it keeps.
- GlassFusedTile Diagnostics
- One rectangle of a fused draw, and the shapes that can colour a pixel in it.
- GlassProxyHandle Diagnostics
- The current proxy, as something a surface can listen to.
- GlassProxyScope Diagnostics
- Carries the current proxy down the tree.
- GlassRippleField Diagnostics
- The waves on one surface: touches in, uniforms out.
- GlassRippleWave Diagnostics
-
One wave as the shader takes it: two
vec4s, in the order of the uniform block. Amplitudes are signed heights in displacement px — positive magnifies — and uniforms normalises them.
Constants
- debugGlassShaderAntiAliasDefault → const bool Diagnostics
- What debugGlassShaderAntiAlias ships as, for a harness that has to name the setting it did not override — a host that wrote its own constant here would report the old default after the package changed it.
- kGlassGroupShaderAsset → const String Diagnostics
- Where the group's shader lives. See kGlassShaderAsset for why the key has a package prefix.
- kGlassRippleShaderAsset → const String Diagnostics
- The surface's shader with the ripple compiled in.
- kGlassShaderAsset → const String Diagnostics
- Where the package's own shader lives.
- kMaxFusedTiles → const int Diagnostics
- How many rectangles a fused draw may become before it gives up and covers everything with one.
Properties
- debugGlassFoldCull ↔ bool Diagnostics
-
Whether the fused fold skips a shape farther than
kfrom the field so far.getter/setter pair - debugGlassFusedSplit ↔ bool Diagnostics
-
Whether a fused group is drawn as several rectangles instead of one.
getter/setter pair
- debugGlassFusedSplitDefault → bool Diagnostics
-
What debugGlassFusedSplit reads while nothing is imposed: the split.
no setter
- debugGlassShaderAntiAlias ↔ bool Diagnostics
-
Whether a glass draw asks the engine for antialiasing —
Paint.isAntiAliason the single surface's quad and on a group's unsplit quad.getter/setter pair -
debugGlassShaderLoader
↔ Future<
FragmentProgram> Function(String asset) Diagnostics -
How every host, ripple and GlassHost.precache loads a shader:
ui.FragmentProgram.fromAsset, which a widget test cannot make fail — the
engine reads the asset itself, past the asset channel's mock.
getter/setter pair
Functions
-
fusedDrawTiles(
{required List< DiagnosticsRect> boxes, required double reach, required double cullMargin, int maxTiles = kMaxFusedTiles}) → List<GlassFusedTile> ? - Splits a fused draw into disjoint rectangles, each carrying only the shapes that can change a pixel inside it.