debugGlassFusedSplit top-level property Diagnostics

bool get debugGlassFusedSplit

Whether a fused group is drawn as several rectangles instead of one.

The split changes no pixel — fusedDrawTiles carries the proof — so it can only be seen as a price, and what it trades runs both ways: fewer fragments, each folding fewer shapes, against more draw calls. On by default on every platform. On Adreno 830 eleven rectangles cost 0.91x the one quad's frame and twenty cost 0.52x it. On the M2 iPad Pro the same two scenes cost 0.71-0.76x and 0.40-0.42x in GPU time. On an M3 Max (Metal System Trace) the split costs 0.94-0.95x the quad's frame on a clustered layout and 0.70-0.75x on a scattered one.

On macOS that holds only because the tiles are drawn without antialiasing: where the engine runs SDFs, an antialiased shader rectangle is three offscreen passes — a white SDF mask, the shader and a kSrcIn blend (canvas.cc:2185-2209, flutter/flutter#192994). A false set on the first draw of a picture is not recorded, because the recorder does not write a value it already holds and Impeller starts from true, so the picture is primed first (primeAliasedDraw).

Set null to return to the default.

Independent of debugGlassFoldCull: dropping a shape from a tile is exact whether or not the shader's own skip runs, so measuring one does not silently measure the other.

Set it before the tree mounts, and restore it afterwards. Setting it repaints every group already mounted, for the reason the cull's setter does: a retained layer would go on drawing the old way and a measurement would report the split as free.

Implementation

bool get debugGlassFusedSplit => _fusedSplit ?? debugGlassFusedSplitDefault;
set debugGlassFusedSplit (bool? value)

Implementation

set debugGlassFusedSplit(bool? value) {
  final bool was = debugGlassFusedSplit;
  _fusedSplit = value;
  if (debugGlassFusedSplit == was) {
    return;
  }
  for (final RenderGlassGroup group in RenderGlassGroup._live) {
    group.markNeedsPaint();
  }
}