Breaking out shape hit testing so that shape implementations can implement.