Skip to content

Commit aa0ba89

Browse files
committed
Use JS naming convention for JS-only symbol. NFC
The `emscripten_` naming convention is something we use for native function and this symbol is not visible to native code.
1 parent 72c3be3 commit aa0ba89

6 files changed

+11
-10
lines changed

src/library_html5_webgl.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ var LibraryHtml5WebGL = {
4545
#endif
4646
},
4747

48-
$emscripten_webgl_power_preferences: "['default', 'low-power', 'high-performance']",
48+
$webglPowerPreferences__internal: true,
49+
$webglPowerPreferences: ['default', 'low-power', 'high-performance'],
4950

5051
#if PTHREADS && OFFSCREEN_FRAMEBUFFER
5152
// In offscreen framebuffer mode, we implement a proxied version of the
@@ -74,7 +75,7 @@ var LibraryHtml5WebGL = {
7475
#if PTHREADS && OFFSCREEN_FRAMEBUFFER
7576
'emscripten_webgl_create_context_proxied',
7677
#endif
77-
'$JSEvents', '$emscripten_webgl_power_preferences', '$findEventTarget', '$findCanvasEventTarget'],
78+
'$JSEvents', '$webglPowerPreferences', '$findEventTarget', '$findCanvasEventTarget'],
7879
// This function performs proxying manually, depending on the style of context that is to be created.
7980
emscripten_webgl_do_create_context: (target, attributes) => {
8081
#if ASSERTIONS
@@ -89,7 +90,7 @@ var LibraryHtml5WebGL = {
8990
'antialias': !!HEAP32[a + ({{{ C_STRUCTS.EmscriptenWebGLContextAttributes.antialias }}}>>2)],
9091
'premultipliedAlpha': !!HEAP32[a + ({{{ C_STRUCTS.EmscriptenWebGLContextAttributes.premultipliedAlpha }}}>>2)],
9192
'preserveDrawingBuffer': !!HEAP32[a + ({{{ C_STRUCTS.EmscriptenWebGLContextAttributes.preserveDrawingBuffer }}}>>2)],
92-
'powerPreference': emscripten_webgl_power_preferences[powerPreference],
93+
'powerPreference': webglPowerPreferences[powerPreference],
9394
'failIfMajorPerformanceCaveat': !!HEAP32[a + ({{{ C_STRUCTS.EmscriptenWebGLContextAttributes.failIfMajorPerformanceCaveat }}}>>2)],
9495
// The following are not predefined WebGL context attributes in the WebGL specification, so the property names can be minified by Closure.
9596
majorVersion: HEAP32[a + ({{{ C_STRUCTS.EmscriptenWebGLContextAttributes.majorVersion }}}>>2)],
@@ -276,7 +277,7 @@ var LibraryHtml5WebGL = {
276277
},
277278

278279
emscripten_webgl_get_context_attributes__proxy: 'sync_on_webgl_context_handle_thread',
279-
emscripten_webgl_get_context_attributes__deps: ['$emscripten_webgl_power_preferences'],
280+
emscripten_webgl_get_context_attributes__deps: ['$webglPowerPreferences'],
280281
emscripten_webgl_get_context_attributes: (c, a) => {
281282
if (!a) return {{{ cDefs.EMSCRIPTEN_RESULT_INVALID_PARAM }}};
282283
c = GL.contexts[c];
@@ -291,7 +292,7 @@ var LibraryHtml5WebGL = {
291292
{{{ makeSetValue('a', C_STRUCTS.EmscriptenWebGLContextAttributes.antialias, 't.antialias', 'i32') }}};
292293
{{{ makeSetValue('a', C_STRUCTS.EmscriptenWebGLContextAttributes.premultipliedAlpha, 't.premultipliedAlpha', 'i32') }}};
293294
{{{ makeSetValue('a', C_STRUCTS.EmscriptenWebGLContextAttributes.preserveDrawingBuffer, 't.preserveDrawingBuffer', 'i32') }}};
294-
var power = t['powerPreference'] && emscripten_webgl_power_preferences.indexOf(t['powerPreference']);
295+
var power = t['powerPreference'] && webglPowerPreferences.indexOf(t['powerPreference']);
295296
{{{ makeSetValue('a', C_STRUCTS.EmscriptenWebGLContextAttributes.powerPreference, 'power', 'i32') }}};
296297
{{{ makeSetValue('a', C_STRUCTS.EmscriptenWebGLContextAttributes.failIfMajorPerformanceCaveat, 't.failIfMajorPerformanceCaveat', 'i32') }}};
297298
{{{ makeSetValue('a', C_STRUCTS.EmscriptenWebGLContextAttributes.majorVersion, 'c.version', 'i32') }}};
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8408
1+
8390
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
23069
1+
23034
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7238
1+
7219
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
19693
1+
19658
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
58237
1+
58197

0 commit comments

Comments
 (0)