Diagnostics topic

package:g1455/glass_diagnostics.dart: the seams a benchmark or a test turns. An application has no reason to import it.

  • The host's published proxy and its counters, GlassProxyHandle through GlassProxyScope: snapshots counts the captures, readBacks the backdrop readings, throttled the holds thermal pressure bought.
  • What the capture walk observed on the last frame, WalkLog, as handle.frame?.log: subtrees it handed to the engine because it draws them apart from it (fellBack), and what it drew as it drew them all the same, because they held glass or a marker — layers it could not reproduce (unhandledLayers), filters under a fade it flattened (opacityFoldedIntoFilter) — and the markers it reached.
  • The switches the measured arms were priced with: the tile split of a group's draw (debugGlassFusedSplit), the shader's anti-alias flag (debugGlassShaderAntiAlias) and the walk's fallback (debugGlassWalkFallback).
  • Models a test drives without a frame: GlassRippleField, GlassBackdropReadings.
final GlassProxyHandle? handle = GlassProxyScope.maybeOf(context);
final int before = handle?.snapshots ?? 0;
// … pump a frame …
final bool captured = (handle?.snapshots ?? 0) > before;

Libraries

glass_diagnostics Diagnostics
The seams a benchmark turns, kept out of g1455.dart.

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.
WalkLog Diagnostics
Everything one pass observed. A fresh instance per pass on purpose: two passes over the same tree are two measurements, not one accumulated.

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 k from 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.isAntiAlias on 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<Rect> boxes, required double reach, required double cullMargin, int maxTiles = kMaxFusedTiles}) → List<GlassFusedTile>? Diagnostics
Splits a fused draw into disjoint rectangles, each carrying only the shapes that can change a pixel inside it.