kripken/emscripten — pull request #2870 by juj (2014-10-08 15:26:03+00:00)
Title: Sdl surface lock optimizations.

Optimize Emscripten SDL handwritten JS-implemented SDL_LockSurface() and SDL_UnlockSurface() by adding an option to perform discarding locks that are fast no-ops and to avoid the screen-is-always-opaque emulation which fills alpha=0xFF bytes to each pixel on lock and unlock. Call something like EM_ASM("SDL.defaults.copyOnLock = false; SDL.defaults.discardOnLock = true; SDL.defaults.opaqueFrontBuffer = false;"); at startup to enable these.