debugGlassFoldCull top-level property Diagnostics

bool get debugGlassFoldCull

Whether the fused fold skips a shape farther than k from the field so far.

True except when measuring. The skip is bit-identical — h is exactly zero there, so the fold keeps d and mix(n, ni, 0) is exactly n — which is why turning it off has to be possible: a saving that changes no pixel can only be seen as a price. It saves 25% of a twelve-shape group's cost on Adreno 830 and 44% on Xclipse 920, and a dynamic branch is not free on every GPU, so the switch exists for hardware that has not been timed.

A global rather than a constructor argument, and the same shape debugPaintGlassSurfaces has: it is a property of the process under measurement, not of any one group, and an application has no business choosing it.

Setting it repaints every group that is already mounted. That is not a convenience: the switch changes no pixel, so a group that kept its retained layer would go on culling with the switch off and a measurement would report the branch as free.

Implementation

bool get debugGlassFoldCull => _foldCull;
set debugGlassFoldCull (bool value)

Implementation

set debugGlassFoldCull(bool value) {
  if (value == _foldCull) {
    return;
  }
  _foldCull = value;
  for (final RenderGlassGroup group in RenderGlassGroup._live) {
    group.markNeedsPaint();
  }
}