debugGlassFoldCull top-level property

bool get debugGlassFoldCull

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

True everywhere but a measurement. 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 precisely why turning it off has to be possible: a saving that changes no pixel is invisible in every frame and can only be seen as a price. It bought 25% of a twelve-shape group's whole addition on Adreno 830 (D170) and 44% on Xclipse 920 (D171), and a dynamic branch is not free on every GPU, so the arm that says so has to exist on hardware nobody here has run.

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 the run would report the branch as free. The first arm written against this found exactly that.

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();
  }
}