This code will eventually live outside GTK, so using privateapi in the drawing code isn't acceptable.