Implements GL clipping with stencil buffers.