opacityFoldedIntoFilter property

int opacityFoldedIntoFilter
getter/setter pair

Colour and image filters flattened while an alpha layer was open above them.

The engine folds the alpha into the filter's own saveLayer, and the fold changes that layer's bounds from the cull rect to the content — so a filter that paints transparent black stops covering the empty area. Measured: at opacity 1.0 the region is opaque cyan and at 254/255 it is gone, in the engine's own rendering. This pass keeps it, so with a fallback ratio the opacity's subtree is handed to the engine and named in fellBack instead of counted here; what is left here was drawn as the pass drew it.

An image filter is counted for the same reason: ImageFilterLayer accepts its parent's opacity as ColorFilterLayer does, and a colour filter can be handed over as an image filter, alone or composed. Measured with Opacity(0.5) over ImageFiltered(compose(colour filter, blur)): 2116 px differ on Impeller and every pixel by a code value on Skia.

Implementation

int opacityFoldedIntoFilter = 0;