Port PrintRegion::flow() and LayerRegion.flow() to XS