diff --git a/src/library_html5_webgl.js b/src/library_html5_webgl.js index 6f1b4787b942..22a69eefd419 100644 --- a/src/library_html5_webgl.js +++ b/src/library_html5_webgl.js @@ -20,7 +20,8 @@ var LibraryHtml5WebGL = { return len; }, - $emscripten_webgl_power_preferences: "['default', 'low-power', 'high-performance']", + $webglPowerPreferences__internal: true, + $webglPowerPreferences: ['default', 'low-power', 'high-performance'], #if PTHREADS && OFFSCREEN_FRAMEBUFFER // In offscreen framebuffer mode, we implement a proxied version of the @@ -50,7 +51,7 @@ var LibraryHtml5WebGL = { #if PTHREADS && OFFSCREEN_FRAMEBUFFER 'emscripten_webgl_create_context_proxied', #endif - '$JSEvents', '$emscripten_webgl_power_preferences', '$findEventTarget', '$findCanvasEventTarget'], + '$JSEvents', '$webglPowerPreferences', '$findEventTarget', '$findCanvasEventTarget'], // This function performs proxying manually, depending on the style of context that is to be created. emscripten_webgl_do_create_context: (target, attributes) => { #if ASSERTIONS @@ -65,7 +66,7 @@ var LibraryHtml5WebGL = { 'antialias': !!HEAP32[a + ({{{ C_STRUCTS.EmscriptenWebGLContextAttributes.antialias }}}>>2)], 'premultipliedAlpha': !!HEAP32[a + ({{{ C_STRUCTS.EmscriptenWebGLContextAttributes.premultipliedAlpha }}}>>2)], 'preserveDrawingBuffer': !!HEAP32[a + ({{{ C_STRUCTS.EmscriptenWebGLContextAttributes.preserveDrawingBuffer }}}>>2)], - 'powerPreference': emscripten_webgl_power_preferences[powerPreference], + 'powerPreference': webglPowerPreferences[powerPreference], 'failIfMajorPerformanceCaveat': !!HEAP32[a + ({{{ C_STRUCTS.EmscriptenWebGLContextAttributes.failIfMajorPerformanceCaveat }}}>>2)], // The following are not predefined WebGL context attributes in the WebGL specification, so the property names can be minified by Closure. majorVersion: HEAP32[a + ({{{ C_STRUCTS.EmscriptenWebGLContextAttributes.majorVersion }}}>>2)], @@ -252,7 +253,7 @@ var LibraryHtml5WebGL = { }, emscripten_webgl_get_context_attributes__proxy: 'sync_on_webgl_context_handle_thread', - emscripten_webgl_get_context_attributes__deps: ['$emscripten_webgl_power_preferences'], + emscripten_webgl_get_context_attributes__deps: ['$webglPowerPreferences'], emscripten_webgl_get_context_attributes: (c, a) => { if (!a) return {{{ cDefs.EMSCRIPTEN_RESULT_INVALID_PARAM }}}; c = GL.contexts[c]; @@ -267,7 +268,7 @@ var LibraryHtml5WebGL = { {{{ makeSetValue('a', C_STRUCTS.EmscriptenWebGLContextAttributes.antialias, 't.antialias', 'i32') }}}; {{{ makeSetValue('a', C_STRUCTS.EmscriptenWebGLContextAttributes.premultipliedAlpha, 't.premultipliedAlpha', 'i32') }}}; {{{ makeSetValue('a', C_STRUCTS.EmscriptenWebGLContextAttributes.preserveDrawingBuffer, 't.preserveDrawingBuffer', 'i32') }}}; - var power = t['powerPreference'] && emscripten_webgl_power_preferences.indexOf(t['powerPreference']); + var power = t['powerPreference'] && webglPowerPreferences.indexOf(t['powerPreference']); {{{ makeSetValue('a', C_STRUCTS.EmscriptenWebGLContextAttributes.powerPreference, 'power', 'i32') }}}; {{{ makeSetValue('a', C_STRUCTS.EmscriptenWebGLContextAttributes.failIfMajorPerformanceCaveat, 't.failIfMajorPerformanceCaveat', 'i32') }}}; {{{ makeSetValue('a', C_STRUCTS.EmscriptenWebGLContextAttributes.majorVersion, 'c.version', 'i32') }}}; diff --git a/test/other/metadce/test_metadce_hello_O0.gzsize b/test/other/metadce/test_metadce_hello_O0.gzsize index b2fd8c7b992c..a559385da7f9 100644 --- a/test/other/metadce/test_metadce_hello_O0.gzsize +++ b/test/other/metadce/test_metadce_hello_O0.gzsize @@ -1 +1 @@ -8408 +8390 diff --git a/test/other/metadce/test_metadce_hello_O0.jssize b/test/other/metadce/test_metadce_hello_O0.jssize index 196a2ed28ef9..4360cf1ad4c0 100644 --- a/test/other/metadce/test_metadce_hello_O0.jssize +++ b/test/other/metadce/test_metadce_hello_O0.jssize @@ -1 +1 @@ -23069 +23034 diff --git a/test/other/metadce/test_metadce_minimal_O0.gzsize b/test/other/metadce/test_metadce_minimal_O0.gzsize index 41c0d18a4ea1..db9bbf715f87 100644 --- a/test/other/metadce/test_metadce_minimal_O0.gzsize +++ b/test/other/metadce/test_metadce_minimal_O0.gzsize @@ -1 +1 @@ -7238 +7219 diff --git a/test/other/metadce/test_metadce_minimal_O0.jssize b/test/other/metadce/test_metadce_minimal_O0.jssize index 3f9f9db246a6..a01b19511865 100644 --- a/test/other/metadce/test_metadce_minimal_O0.jssize +++ b/test/other/metadce/test_metadce_minimal_O0.jssize @@ -1 +1 @@ -19693 +19658 diff --git a/test/other/test_unoptimized_code_size.js.size b/test/other/test_unoptimized_code_size.js.size index 4db6f5c53b5c..f321af743942 100644 --- a/test/other/test_unoptimized_code_size.js.size +++ b/test/other/test_unoptimized_code_size.js.size @@ -1 +1 @@ -58237 +58197