Almost complete implementation of clipping in renderInContext.