Workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=1080646

FF throws js exception ```IndexSizeError: Index or size is negative or greater than the allowed amount``` in drawImage when source width or source height is zero.
Also i add check for blitw and blith.
avoid x - -1.0 turning into x--1.0, fixes #2869
tiny gl fixes
fix browser.test example
Merge pull request #2879 from caiiiycuk/workaround_1080646

Workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=1080646
memory growth fixes
Configure the Emscripten cache directory from the command line.

This allows passing --cache to emcc to set the Emscripten cache
directory rather than only allowing this to be configured via
the EM_CACHE environment variable.
Merge pull request #2816 from waywardmonkeys/set-cache-from-command-line

Configure the Emscripten cache directory from the command line.
Add SDL_ConvertSurface and fix SDL_SetAlpha

* Implement SDL_ConvertSurface (https://wiki.libsdl.org/SDL_ConvertSurface) works only for default emscripten pixelformat
* SDL_SetAlpha (http://www.libsdl.org/release/SDL-1.2.15/docs/html/sdlsetalpha.html) should ignore alpha channel if flag SDL_SRCALPHA is not set
Merge pull request #2871 from caiiiycuk/sdl_missed_fun

Add SDL_ConvertSurface and fix SDL_SetAlpha
cmake version note; fixes #2884
Fix GL library behavior when deleting nonexisting objects via glDeleteProgram, glDeleteShader, glDeleteFramebuffers and glDeleteRenderbuffers. Note that OpenGL is inconsistent and glDeleteProgram and glDeleteShader do report errors when deleting invalid objects, the other functions don't.
Fix an issue with glDeleteProgram and glDeleteShader not cleaning up the GL.programs and GL.shaders array of already deleted objects.