Skip to content

Commit

Permalink
Remove dummy emscripten_set_offscreencanvas_size. NFC (emscripten-cor…
Browse files Browse the repository at this point in the history
…e#23279)

This is an internal-only API that is not directly callable by user code.

The only place that this function is called is from
`system/lib/html5/offscreencanvas.c` as a result of
`_emscripten_set_offscreencanvas_size_on_thread`.
  • Loading branch information
sbc100 authored Jan 2, 2025
1 parent 8cb6dbf commit b08c9f1
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 15 deletions.
11 changes: 0 additions & 11 deletions src/library_html5.js
Original file line number Diff line number Diff line change
Expand Up @@ -2297,8 +2297,6 @@ var LibraryHTML5 = {
},

#if OFFSCREENCANVAS_SUPPORT
_emscripten_set_offscreencanvas_size: 'emscripten_set_canvas_element_size',

$setOffscreenCanvasSizeOnTargetThread__deps: ['$stringToNewUTF8', '_emscripten_set_offscreencanvas_size_on_thread'],
$setOffscreenCanvasSizeOnTargetThread: (targetThread, targetCanvas, width, height) => {
targetCanvas = targetCanvas ? UTF8ToString(targetCanvas) : '';
Expand Down Expand Up @@ -2414,15 +2412,6 @@ var LibraryHTML5 = {
},
#endif

#if !PTHREADS || !OFFSCREENCANVAS_SUPPORT
_emscripten_set_offscreencanvas_size: (target, width, height) => {
#if ASSERTIONS
err('emscripten_set_offscreencanvas_size: Build with -sOFFSCREENCANVAS_SUPPORT=1 to enable transferring canvases to pthreads.');
#endif
return {{{ cDefs.EMSCRIPTEN_RESULT_NOT_SUPPORTED }}};
},
#endif

// JavaScript-friendly API, returns pair [width, height]
$getCanvasElementSize__deps: ['emscripten_get_canvas_element_size', '$stackSave', '$stackRestore', '$stringToUTF8OnStack'],
$getCanvasElementSize: (target) => {
Expand Down
1 change: 0 additions & 1 deletion src/library_sigs.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,6 @@ sigs = {
_emscripten_push_uncounted_main_loop_blocker__sig: 'vppp',
_emscripten_receive_on_main_thread_js__sig: 'dippip',
_emscripten_runtime_keepalive_clear__sig: 'v',
_emscripten_set_offscreencanvas_size__sig: 'ipii',
_emscripten_system__sig: 'ip',
_emscripten_thread_cleanup__sig: 'vp',
_emscripten_thread_exit_joinable__sig: 'vp',
Expand Down
2 changes: 1 addition & 1 deletion system/lib/html5/offscreencanvas.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ typedef struct set_cavas_size_t {

static void do_set_size(void* arg) {
set_cavas_size_t* args = (set_cavas_size_t*)arg;
_emscripten_set_offscreencanvas_size(args->target, args->width, args->height);
emscripten_set_canvas_element_size(args->target, args->width, args->height);
free((char *) args->target);
free(arg);
}
Expand Down
2 changes: 0 additions & 2 deletions system/lib/libc/emscripten_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,6 @@ size_t _emscripten_fetch_get_response_headers_length(int32_t fetchID);
size_t _emscripten_fetch_get_response_headers(int32_t fetchID, char *dst, size_t dstSizeBytes);
void emscripten_fetch_free(unsigned int);

EMSCRIPTEN_RESULT _emscripten_set_offscreencanvas_size(const char *target, int width, int height);

// Internal implementation function in JavaScript side that emscripten_create_wasm_worker() calls to
// to perform the wasm worker creation.
emscripten_wasm_worker_t _emscripten_create_wasm_worker(void *stackLowestAddress, uint32_t stackSize);
Expand Down

0 comments on commit b08c9f1

Please sign in to comment.