Optimize stencil uploading

This tries to avoid it in the normal case (e.g. when the memory is all zeroes.)  It also scans to determine which bits are set, so as to avoid the expensive fills.

Also, it's quite clear that 1x is way faster than 2x.  Where glBlitFramebuffer is available, this makes it upload the stencil at 1x and then blit the stencil across.  This takes Star Ocean (while panning) from 600% to 1000% at 5x on my desktop.  It may also help Tegra and GLES3 devices, but performance there is untested.

-[Unknown]