Unused import patrol.
Nuke some unnecessary semicolons
@Overrides
Speeling
Nix unused privates
Access static statically
That was renamed a while back.

Switch to the modern version, not the deprecated one.
Unused imports
Whitespace
Don't suppress that.

It isn't actually doing any sketchy-looking fallthrough that things
will warn about.
Yes, this is this.
Multitexture painting.

Instead of needing to flush every time a draw involves a new texture,
take advantage of multiple textures and allow N different at a time.
This is a particularly big win if you're repeatedly bouncing back and
forth between a few textures.

A few key points walking along the evolution of this code to help explain
some of the weirdness of its final state:

 * The nature of QuadShader really means it's easiest to add vec4s,
   not arbitrary other things, so I had to grow the size per quad more
   than I'd have liked. In an ideal world, it would've been one float
   (well, int, but there's another limitation) with the index, but I was
   immediately bumping against other issues trying to do that.
 * GLSL ES won't allow an array of textures and indexing into that, so
   now you're staring down the barrel of generated code to emulate that.
 * Oh crap. Fake indexing into an array is really a series of if/else
   statements, which is easy enough to generate, but that's branching,
   and shaders HATE branching. It works, but performance is suddenly
   WORSE than flushing between each draw.
 * If you can't do conditional code, you need to do something silly
   like get the value from every texture and multiply the ones you
   don't want by zero.
 * Oh thank god, at least the conditionals to generate ones or zeroes
   is fast, so it doesn't need to something insane like pass in actual
   ones and zeroes instead of a single index.

For QuadShader, my tests with playn-perf (which is, admittedly, pretty
contrived and lining up perfectly with what this changes) handles about
twice as many quads at the same framerate.

For IndexedTrisShader, things are a little less clear; I'm seeing virtually
identical performance before & after, but then again it keeps expanding the
vertex buffer into infinity & my machine can completely handle that. This
might play a bit differently on something less beefy.
Temporarily cap multitexture painting at 4.

My card can actually handle 16, but apparently doing all that makes something
blow out a max size on something.

It'd all fit early on, but I'd capped myself for OTHER performance reasons,
but apparently in the current state of things, it's a no-go.

I have a sneaking suspicion it's that I need to shave off some more in
usableMaxUniformVectors to compensate for how big v_TexMults has grown, but
for the moment this unbreaks QuadShader for the weekend.
No reason to think all images are 256x256
Split apart the texture shader more.

Break out the major bits for subclasses to reuse.
Rollback the multitexturing for the moment.

Things are less stellar in real-world applications; there's a cost
to the multitexturing, but it's outweighed by the gain from reducing
flushes. But if you're managing to do lots and lots of quads using the
same texture, no such gain.

I'm digging into ways to reduce the cost, but so far the best looking
option is waiting until playn can really use opengl es 3.0 because that
adds functionality to properly handle this instead of jumping through
flaming hoops like this. Damnit.

This DOES keep the splitting out from a5d3813, though. That change
definitely makes it much easier for custom shader to do moderate color
twiddling without so much copy & paste.
Workaround a bug in Intel graphics.

In IndexedTrisShaders, if we do the various attribute binding up in
activate(), Intel cards give broken behavior. To reproduce it, add three
layers:
 1) An ImageLayer from a CanvasImage (alternately use a SurfaceLayer)
 2) An ImageLayer from an assets-sourced Image
 3) Another ImageLayer from the same assets-sourced Image (subimages count)

Layers 2 & 3 wind up with Layer 1's geometry. If you only do layers 1 & 2,
everything's fine. If it's not a CanvasImage nor SurfaceLayer in position 1,
everything's fine. Very strange.

But we can just do the bind at the last possible chance instead of the first
possible, and everything's fine.
Hurk. That meant to go down there, too.
checkGLError fiddling
Degenerate matrices mean no pixels, no hits.