Make the core flood fill algorithm static.