expo-gl 13.0.0 → 13.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -10,6 +10,10 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 13.1.0 — 2023-07-28
14
+
15
+ _This version does not introduce any user-facing changes._
16
+
13
17
  ## 13.0.0 — 2023-06-13
14
18
 
15
19
  ### 🛠 Breaking changes
@@ -6,7 +6,7 @@ apply plugin: 'maven-publish'
6
6
  apply plugin: "de.undercouch.download"
7
7
 
8
8
  group = 'host.exp.exponent'
9
- version = '13.0.0'
9
+ version = '13.1.0'
10
10
 
11
11
  def REACT_NATIVE_BUILD_FROM_SOURCE = findProject(":ReactAndroid") != null
12
12
  def REACT_NATIVE_DIR = REACT_NATIVE_BUILD_FROM_SOURCE
@@ -96,7 +96,7 @@ android {
96
96
  minSdkVersion safeExtGet("minSdkVersion", 21)
97
97
  targetSdkVersion safeExtGet("targetSdkVersion", 33)
98
98
  versionCode 31
99
- versionName "13.0.0"
99
+ versionName "13.1.0"
100
100
 
101
101
  externalNativeBuild {
102
102
  cmake {
package/build/GLUtils.js CHANGED
@@ -18,7 +18,7 @@ export function configureLogging(gl) {
18
18
  return;
19
19
  }
20
20
  // Turn off logging.
21
- if (!option || option === GLLoggingOption.DISABLED) {
21
+ if (option === GLLoggingOption.DISABLED || !option) {
22
22
  Object.entries(gl).forEach(([key, value]) => {
23
23
  if (typeof value === 'function' && value.__logWrapper) {
24
24
  delete gl[key];
@@ -1 +1 @@
1
- {"version":3,"file":"GLUtils.js","sourceRoot":"","sources":["../src/GLUtils.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,EAA6B,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAE5E;;GAEG;AACH,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAE7B;;GAEG;AACH,MAAM,UAAU,gBAAgB,C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C,yBAAyB,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;qBAChE;iBACF;gBACD,EAAE,CAAC,GAAG,CAAC,CAAC,YAAY,GAAG,IAAI,CAAC;gBAC5B,OAAO,MAAM,CAAC;YAChB,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,aAAa,GAAG,MAAM,CAAC;IACzB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import GLErrors from './GLErrors';\nimport { ExpoWebGLRenderingContext, GLLoggingOption } from './GLView.types';\n\n/**\n * Maximum length of the strings printed to the console.\n */\nconst MAX_STRING_LENGTH = 20;\n\n/**\n * Sets up `__expoSetLogging` method providing some logging options useful when debugging GL calls.\n */\nexport function configureLogging(gl: ExpoWebGLRenderingContext): void {\n // Enable/disable logging of all GL function calls\n let loggingOption = GLLoggingOption.DISABLED;\n\n gl.__expoSetLogging = (option: GLLoggingOption): void => {\n // If boolean values are the same, just change the internal value,\n // there is no need to wrap/unwrap functions in this case.\n if (!loggingOption === !option) {\n loggingOption = option;\n return;\n }\n\n // Turn off logging.\n if (!option || option === GLLoggingOption.DISABLED) {\n Object.entries(gl).forEach(([key, value]) => {\n if (typeof value === 'function' && value.__logWrapper) {\n delete gl[key];\n }\n });\n loggingOption = option;\n return;\n }\n\n // Turn on logging.\n Object.entries(Object.getPrototypeOf(gl)).forEach(([key, originalValue]) => {\n if (typeof originalValue !== 'function' || key === '__expoSetLogging') {\n return;\n }\n\n gl[key] = (...args) => {\n if (loggingOption & GLLoggingOption.METHOD_CALLS) {\n const params = args.map((arg) => {\n // If the type is `number`, then try to find name of the constant that has such value,\n // so it's easier to read these logs. In some cases it might be misleading\n // if the parameter is for example a width or height, so the number is still logged.\n if (loggingOption & GLLoggingOption.RESOLVE_CONSTANTS && typeof arg === 'number') {\n for (const prop in gl) {\n if (gl[prop] === arg) {\n return `${arg} (${prop})`;\n }\n }\n }\n\n // Truncate strings so they don't produce too much output and don't block the bridge.\n // It mostly applies to shaders which might be very long...\n if (loggingOption & GLLoggingOption.TRUNCATE_STRINGS && typeof arg === 'string') {\n if (arg.length > MAX_STRING_LENGTH) {\n const lastIndex = arg.lastIndexOf(' ', MAX_STRING_LENGTH);\n return arg.substr(0, lastIndex >= 0 ? lastIndex : MAX_STRING_LENGTH) + '...';\n }\n }\n\n // Just return the parameter as a string.\n return '' + arg;\n });\n console.log(`ExpoGL: ${key}(${params.join(', ')})`);\n }\n\n const result = originalValue.apply(gl, args);\n\n if (loggingOption & GLLoggingOption.METHOD_CALLS) {\n console.log(`ExpoGL: = ${result}`);\n }\n if (loggingOption & GLLoggingOption.GET_ERRORS && key !== 'getError') {\n // @ts-ignore We need to call into the original `getError`.\n // eslint-disable-next-line no-proto\n const error = gl.__proto__.getError.call(gl);\n\n if (error && error !== gl.NO_ERROR) {\n // `console.error` would cause a red screen, so let's just log with red color.\n console.log(`\\x1b[31mExpoGL: Error ${GLErrors[error]}\\x1b[0m`);\n }\n }\n gl[key].__logWrapper = true;\n return result;\n };\n });\n\n loggingOption = option;\n };\n}\n"]}
1
+ {"version":3,"file":"GLUtils.js","sourceRoot":"","sources":["../src/GLUtils.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,EAA6B,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAE5E;;GAEG;AACH,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAE7B;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,EAA6B;IAC5D,kDAAkD;IAClD,IAAI,aAAa,GAAG,eAAe,CAAC,QAAQ,CAAC;IAE7C,EAAE,CAAC,gBAAgB,GAAG,CAAC,MAAuB,EAAQ,EAAE;QACtD,kEAAkE;QAClE,0DAA0D;QAC1D,IAAI,CAAC,aAAa,KAAK,CAAC,MAAM,EAAE;YAC9B,aAAa,GAAG,MAAM,CAAC;YACvB,OAAO;SACR;QAED,oBAAoB;QACpB,IAAI,MAAM,KAAK,eAAe,CAAC,QAAQ,IAAI,CAA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\n/**\n * Maximum length of the strings printed to the console.\n */\nconst MAX_STRING_LENGTH = 20;\n\n/**\n * Sets up `__expoSetLogging` method providing some logging options useful when debugging GL calls.\n */\nexport function configureLogging(gl: ExpoWebGLRenderingContext): void {\n // Enable/disable logging of all GL function calls\n let loggingOption = GLLoggingOption.DISABLED;\n\n gl.__expoSetLogging = (option: GLLoggingOption): void => {\n // If boolean values are the same, just change the internal value,\n // there is no need to wrap/unwrap functions in this case.\n if (!loggingOption === !option) {\n loggingOption = option;\n return;\n }\n\n // Turn off logging.\n if (option === GLLoggingOption.DISABLED || !option) {\n Object.entries(gl).forEach(([key, value]) => {\n if (typeof value === 'function' && value.__logWrapper) {\n delete gl[key];\n }\n });\n loggingOption = option;\n return;\n }\n\n // Turn on logging.\n Object.entries(Object.getPrototypeOf(gl)).forEach(([key, originalValue]) => {\n if (typeof originalValue !== 'function' || key === '__expoSetLogging') {\n return;\n }\n\n gl[key] = (...args) => {\n if (loggingOption & GLLoggingOption.METHOD_CALLS) {\n const params = args.map((arg) => {\n // If the type is `number`, then try to find name of the constant that has such value,\n // so it's easier to read these logs. In some cases it might be misleading\n // if the parameter is for example a width or height, so the number is still logged.\n if (loggingOption & GLLoggingOption.RESOLVE_CONSTANTS && typeof arg === 'number') {\n for (const prop in gl) {\n if (gl[prop] === arg) {\n return `${arg} (${prop})`;\n }\n }\n }\n\n // Truncate strings so they don't produce too much output and don't block the bridge.\n // It mostly applies to shaders which might be very long...\n if (loggingOption & GLLoggingOption.TRUNCATE_STRINGS && typeof arg === 'string') {\n if (arg.length > MAX_STRING_LENGTH) {\n const lastIndex = arg.lastIndexOf(' ', MAX_STRING_LENGTH);\n return arg.substr(0, lastIndex >= 0 ? lastIndex : MAX_STRING_LENGTH) + '...';\n }\n }\n\n // Just return the parameter as a string.\n return '' + arg;\n });\n console.log(`ExpoGL: ${key}(${params.join(', ')})`);\n }\n\n const result = originalValue.apply(gl, args);\n\n if (loggingOption & GLLoggingOption.METHOD_CALLS) {\n console.log(`ExpoGL: = ${result}`);\n }\n if (loggingOption & GLLoggingOption.GET_ERRORS && key !== 'getError') {\n // @ts-ignore We need to call into the original `getError`.\n // eslint-disable-next-line no-proto\n const error = gl.__proto__.getError.call(gl);\n\n if (error && error !== gl.NO_ERROR) {\n // `console.error` would cause a red screen, so let's just log with red color.\n console.log(`\\x1b[31mExpoGL: Error ${GLErrors[error]}\\x1b[0m`);\n }\n }\n gl[key].__logWrapper = true;\n return result;\n };\n });\n\n loggingOption = option;\n };\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-gl",
3
- "version": "13.0.0",
3
+ "version": "13.1.0",
4
4
  "description": "Provides GLView that acts as OpenGL ES render target and gives GL context object implementing WebGL 2.0 specification.",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -49,5 +49,5 @@
49
49
  "peerDependencies": {
50
50
  "expo": "*"
51
51
  },
52
- "gitHead": "3ccd2edee9cbfed217557675cb50f0ba5e55a9e4"
52
+ "gitHead": "663654577a7068c641b5e9474efbc502e3f334ea"
53
53
  }
package/src/GLUtils.ts CHANGED
@@ -22,7 +22,7 @@ export function configureLogging(gl: ExpoWebGLRenderingContext): void {
22
22
  }
23
23
 
24
24
  // Turn off logging.
25
- if (!option || option === GLLoggingOption.DISABLED) {
25
+ if (option === GLLoggingOption.DISABLED || !option) {
26
26
  Object.entries(gl).forEach(([key, value]) => {
27
27
  if (typeof value === 'function' && value.__logWrapper) {
28
28
  delete gl[key];