James Zern
f88666eb47
webp_js/*.html: fix canvas mapping
...
after:
24d7f9cb
Switch code to SDL2.
fixes:
webp_wasm.js:1 Uncaught TypeError: Cannot read properties of null
(reading 'addEventListener')
at Object.registerOrRemoveHandler (webp_wasm.js:1:101330)
at registerMouseEventCallback (webp_wasm.js:1:154227)
at _emscripten_set_mousemove_callback_on_thread (webp_wasm.js:1:155015)
...
The SDL2 port forces the canvas id to '#canvas':
324df6865a/src/video/emscripten/SDL_emscriptenvideo.c (L210)
This change maps '#output_canvas' to this entry in specialHTMLTargets[]:
https://emscripten.org/docs/api_reference/html5.h.html
https://github.com/libsdl-org/SDL/issues/5260 &
https://github.com/emscripten-ports/SDL2/issues/130 may also be related.
Change-Id: I26f4aa22b9d68b0fc45b83edfe6fe074b59a82a7
Test: emscripten 3.1.16
2024-03-29 12:53:05 -07:00
Vincent Rabaud
24d7f9cb6e
Switch code to SDL2.
...
Also simplify wasm html (now that it is suppported by all browsers).
Change-Id: I352b08594b93d3dd7d44832d4328b3546ccc1b90
2023-10-28 23:36:35 +02:00
James Zern
ed92a62649
extras: WebpToSDL -> WebPToSDL
...
this normalizes the function case to what's more commonly used in the
project
Change-Id: If614cb8eff4afba96b2468e28c52d850651a759b
2022-12-15 18:11:40 -08:00
skal
6878d42720
fix memory leak in SDL_Init()
...
we use a static guard to only call SDL_Init() once.
Another option would be to call SDL_Quit(), but it doesn't seem to be
doing anything.
Also, fix the HTML code and add 'use strict' directive.
BUG=webp:354
Change-Id: I3c6421e2c1c8cc200556cd4092a0ead9a8b054ef
2017-07-31 12:47:02 -07:00
Pascal Massimino
134e314fd8
WASM support
...
demo page: webp_js/index_wasm.html
Change-Id: I9e6bde205c2730f96c5f30ec01f4bfacf1f5d128
2017-03-21 14:07:22 +01:00