Switch code to SDL2.

Also simplify wasm html (now that it is suppported by all browsers).

Change-Id: I352b08594b93d3dd7d44832d4328b3546ccc1b90
This commit is contained in:
Vincent Rabaud
2023-09-28 10:18:23 +02:00
parent a429c0de64
commit 24d7f9cb6e
7 changed files with 83 additions and 120 deletions

View File

@ -20,8 +20,7 @@ Emscripten and CMake.
```shell
cd webp_js && \
emcmake cmake -DWEBP_BUILD_WEBP_JS=ON \
../
emcmake cmake -DWEBP_BUILD_WEBP_JS=ON ../
```
- compile webp.js using 'emmake make'.
@ -55,27 +54,7 @@ directory.
See webp_js/index_wasm.html for a simple demo page using the WASM version of the
library.
You will need a fairly recent version of Emscripten (at least 2.0.18,
latest-upstream is recommended) and of your WASM-enabled browser to run this
version.
## Caveats
- First decoding using the library is usually slower, due to just-in-time
compilation.
- Some versions of llvm produce the following compile error when SSE2 is
enabled.
```
"Unsupported: %516 = bitcast <8 x i16> %481 to i128
LLVM ERROR: BitCast Instruction not yet supported for integer types larger than 64 bits"
```
The corresponding Emscripten bug is at:
https://github.com/kripken/emscripten/issues/3788
Therefore, SSE2 optimization is currently disabled in CMakeLists.txt.
- If WEBP_ENABLE_SIMD is set to 1 the JavaScript version (webp.js) will be
disabled as wasm2js does not support SIMD.