mapbox/mapbox-gl-native — pull request #425 by kkaefer (2014-08-15 15:14:45+00:00)
Title: Don't do gratuitous state updates

We often gratuitously update OpenGL state:

* [ ] Switch active texture
* [ ] Texture binding
* [ ] Set stencil test state
* [ ] Vertex Array binding
* [ ] Switch to shaders without using them
* [ ] Switch shaders within a render type (e.g. when rendering fills and outlines). instead, we should split it up into two passes and first render all fills for all tiles, then all outlines for all tiles to avoid shader switches
* [ ] Move GL_BLEND disabling to before clipping mask drawing
* [ ] Make sure we actually have to draw something before switching the stencilfunc to the current tile
* [ ] Remove glFlush