(I think the use of bitmaps is the right one here, but this code doesn't actually work, pending PR 11566)