draw/clip: cleanup viewport index handling code.