expo-gl 15.1.1 → 15.1.2

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.
Files changed (62) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/android/build.gradle +2 -2
  3. package/build/Canvas.js.map +1 -1
  4. package/build/GLErrors.d.ts +2 -2
  5. package/build/GLErrors.d.ts.map +1 -1
  6. package/build/GLErrors.js +2 -1
  7. package/build/GLErrors.js.map +1 -1
  8. package/build/GLUtils.d.ts.map +1 -1
  9. package/build/GLUtils.js +11 -10
  10. package/build/GLUtils.js.map +1 -1
  11. package/build/GLView.types.d.ts +4 -1
  12. package/build/GLView.types.d.ts.map +1 -1
  13. package/build/GLView.types.js.map +1 -1
  14. package/build/GLView.web.d.ts +2 -2
  15. package/build/GLView.web.d.ts.map +1 -1
  16. package/build/GLView.web.js.map +1 -1
  17. package/expo-module.config.json +1 -1
  18. package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.2/expo.modules.gl-15.1.2.aar +0 -0
  19. package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.2/expo.modules.gl-15.1.2.aar.md5 +1 -0
  20. package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.2/expo.modules.gl-15.1.2.aar.sha1 +1 -0
  21. package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.2/expo.modules.gl-15.1.2.aar.sha256 +1 -0
  22. package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.2/expo.modules.gl-15.1.2.aar.sha512 +1 -0
  23. package/local-maven-repo/host/exp/exponent/expo.modules.gl/{15.1.1/expo.modules.gl-15.1.1.module → 15.1.2/expo.modules.gl-15.1.2.module} +17 -17
  24. package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.2/expo.modules.gl-15.1.2.module.md5 +1 -0
  25. package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.2/expo.modules.gl-15.1.2.module.sha1 +1 -0
  26. package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.2/expo.modules.gl-15.1.2.module.sha256 +1 -0
  27. package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.2/expo.modules.gl-15.1.2.module.sha512 +1 -0
  28. package/local-maven-repo/host/exp/exponent/expo.modules.gl/{15.1.1/expo.modules.gl-15.1.1.pom → 15.1.2/expo.modules.gl-15.1.2.pom} +1 -1
  29. package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.2/expo.modules.gl-15.1.2.pom.md5 +1 -0
  30. package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.2/expo.modules.gl-15.1.2.pom.sha1 +1 -0
  31. package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.2/expo.modules.gl-15.1.2.pom.sha256 +1 -0
  32. package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.2/expo.modules.gl-15.1.2.pom.sha512 +1 -0
  33. package/local-maven-repo/host/exp/exponent/expo.modules.gl/maven-metadata.xml +4 -4
  34. package/local-maven-repo/host/exp/exponent/expo.modules.gl/maven-metadata.xml.md5 +1 -1
  35. package/local-maven-repo/host/exp/exponent/expo.modules.gl/maven-metadata.xml.sha1 +1 -1
  36. package/local-maven-repo/host/exp/exponent/expo.modules.gl/maven-metadata.xml.sha256 +1 -1
  37. package/local-maven-repo/host/exp/exponent/expo.modules.gl/maven-metadata.xml.sha512 +1 -1
  38. package/package.json +3 -3
  39. package/src/Canvas.tsx +2 -2
  40. package/src/GLErrors.ts +3 -1
  41. package/src/GLUtils.ts +13 -11
  42. package/src/GLView.types.ts +5 -1
  43. package/src/GLView.web.tsx +4 -4
  44. package/src/ts-declarations/react-native-web.d.ts +3 -0
  45. package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.1/expo.modules.gl-15.1.1.aar +0 -0
  46. package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.1/expo.modules.gl-15.1.1.aar.md5 +0 -1
  47. package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.1/expo.modules.gl-15.1.1.aar.sha1 +0 -1
  48. package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.1/expo.modules.gl-15.1.1.aar.sha256 +0 -1
  49. package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.1/expo.modules.gl-15.1.1.aar.sha512 +0 -1
  50. package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.1/expo.modules.gl-15.1.1.module.md5 +0 -1
  51. package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.1/expo.modules.gl-15.1.1.module.sha1 +0 -1
  52. package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.1/expo.modules.gl-15.1.1.module.sha256 +0 -1
  53. package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.1/expo.modules.gl-15.1.1.module.sha512 +0 -1
  54. package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.1/expo.modules.gl-15.1.1.pom.md5 +0 -1
  55. package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.1/expo.modules.gl-15.1.1.pom.sha1 +0 -1
  56. package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.1/expo.modules.gl-15.1.1.pom.sha256 +0 -1
  57. package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.1/expo.modules.gl-15.1.1.pom.sha512 +0 -1
  58. /package/local-maven-repo/host/exp/exponent/expo.modules.gl/{15.1.1/expo.modules.gl-15.1.1-sources.jar → 15.1.2/expo.modules.gl-15.1.2-sources.jar} +0 -0
  59. /package/local-maven-repo/host/exp/exponent/expo.modules.gl/{15.1.1/expo.modules.gl-15.1.1-sources.jar.md5 → 15.1.2/expo.modules.gl-15.1.2-sources.jar.md5} +0 -0
  60. /package/local-maven-repo/host/exp/exponent/expo.modules.gl/{15.1.1/expo.modules.gl-15.1.1-sources.jar.sha1 → 15.1.2/expo.modules.gl-15.1.2-sources.jar.sha1} +0 -0
  61. /package/local-maven-repo/host/exp/exponent/expo.modules.gl/{15.1.1/expo.modules.gl-15.1.1-sources.jar.sha256 → 15.1.2/expo.modules.gl-15.1.2-sources.jar.sha256} +0 -0
  62. /package/local-maven-repo/host/exp/exponent/expo.modules.gl/{15.1.1/expo.modules.gl-15.1.1-sources.jar.sha512 → 15.1.2/expo.modules.gl-15.1.2-sources.jar.sha512} +0 -0
package/CHANGELOG.md CHANGED
@@ -10,6 +10,10 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 15.1.2 — 2025-04-14
14
+
15
+ _This version does not introduce any user-facing changes._
16
+
13
17
  ## 15.1.1 — 2025-04-09
14
18
 
15
19
  _This version does not introduce any user-facing changes._
@@ -9,7 +9,7 @@ def reactNativeArchitectures() {
9
9
  }
10
10
 
11
11
  group = 'host.exp.exponent'
12
- version = '15.1.1'
12
+ version = '15.1.2'
13
13
 
14
14
  android {
15
15
  if (rootProject.hasProperty("ndkPath")) {
@@ -22,7 +22,7 @@ android {
22
22
  namespace "expo.modules.gl"
23
23
  defaultConfig {
24
24
  versionCode 31
25
- versionName "15.1.1"
25
+ versionName "15.1.2"
26
26
 
27
27
  externalNativeBuild {
28
28
  cmake {
@@ -1 +1 @@
1
- {"version":3,"file":"Canvas.js","sourceRoot":"","sources":["../src/Canvas.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAqB,UAAU,EAAE,UAAU,EAAE,IAAI,EAAa,MAAM,cAAc,CAAC;AAC1F,OAAO,aAAa,MAAM,6CAA6C,CAAC;AAExE,SAAS,UAAU,CAAC,SAAS;IAC3B,IAAI,CAAC;QACH,OAAO,WAAW,CAAC,SAAS,CAAC,CAAC;IAChC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED,SAAS,MAAM,CAAI,OAAqB,EAAE,GAAa;IACrD,IAAI,CAAC,OAAO;QAAE,OAAO;IAErB,IAAI,OAAO,OAAO,KAAK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AC,CAAC,CAAC;IAEX,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,MAAM,MAAM,GAAG,UAAU,CAAC,OAAO,CAAC;QAClC,IAAI,MAAM,EAAE,CAAC;YACX,gBAAgB,EAAE,CAAC;QACrB,CAAC;QACD,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAClC,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IAEjB,OAAO,CACL,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAC5E;MAAA,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,aAAa,CAAC,CAAC,aAAa,CAAC,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC,YAAY,CAAC,EACtF;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,OAAO,EAAE;QACP,aAAa,EAAE,UAAU;KAC1B;CACF,CAAC,CAAC;AAEH,eAAe,aAAa,CAAC","sourcesContent":["import * as React from 'react';\nimport { findDOMNode } from 'react-dom';\nimport { LayoutChangeEvent, PixelRatio, StyleSheet, View, ViewProps } from 'react-native';\nimport createElement from 'react-native-web/dist/exports/createElement';\n\nfunction getElement(component) {\n try {\n return findDOMNode(component);\n } catch {\n return component;\n }\n}\n\nfunction setRef<T>(refProp: React.Ref<T>, ref: T | null) {\n if (!refProp) return;\n\n if (typeof refProp === 'function') {\n refProp(ref);\n } else if ('current' in refProp) {\n // @ts-ignore\n refProp.current = ref;\n }\n}\n\nconst Canvas = React.forwardRef(\n (props: React.ComponentProps<typeof View>, ref: React.Ref<HTMLCanvasElement>) =>\n createElement('canvas', { ...props, ref })\n);\n\nconst CanvasWrapper: React.FunctionComponent<\n ViewProps & {\n canvasRef: React.Ref<HTMLCanvasElement>;\n }\n> = ({ pointerEvents, children, style, ...props }) => {\n const [size, setSize] = React.useState<{ width: number; height: number } | null>(null);\n\n const ref = React.useRef<View>(null);\n const _canvasRef = React.useRef<HTMLCanvasElement>(null);\n\n function updateCanvasSize(): void {\n const canvas = _canvasRef.current;\n if (typeof HTMLCanvasElement !== 'undefined' && canvas instanceof HTMLCanvasElement) {\n const size = getSize();\n const scale = PixelRatio.get();\n\n canvas.style.width = `${size.width}px`;\n canvas.style.height = `${size.height}px`;\n\n canvas.width = size.width * scale;\n canvas.height = size.height * scale;\n }\n }\n\n function getSize(): { width: number; height: number } {\n if (size) {\n return size;\n } else if (!ref.current || typeof window === 'undefined') {\n return { width: 0, height: 0 };\n }\n const element = getElement(ref.current);\n const { offsetWidth: width = 0, offsetHeight: height = 0 } = element;\n return { width, height };\n }\n\n const onLayout = (event: LayoutChangeEvent) => {\n const {\n nativeEvent: {\n layout: { width, height },\n },\n } = event;\n\n if (width !== size?.width || height !== size.height) {\n setSize({ width, height });\n\n if (props.onLayout) {\n props.onLayout(event);\n }\n }\n };\n\n React.useEffect(() => {\n if (ref.current != null) {\n setSize(getSize());\n }\n }, [ref]);\n\n React.useEffect(() => {\n updateCanvasSize();\n }, [size]);\n\n React.useEffect(() => {\n const canvas = _canvasRef.current;\n if (canvas) {\n updateCanvasSize();\n }\n setRef(props.canvasRef, canvas);\n }, [_canvasRef]);\n\n return (\n <View {...props} style={[styles.wrapper, style]} ref={ref} onLayout={onLayout}>\n <Canvas ref={_canvasRef} pointerEvents={pointerEvents} style={StyleSheet.absoluteFill} />\n {children}\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n wrapper: {\n pointerEvents: 'box-none',\n },\n});\n\nexport default CanvasWrapper;\n"]}
1
+ {"version":3,"file":"Canvas.js","sourceRoot":"","sources":["../src/Canvas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,UAAU,CAAC,MAAM,CAAC;IAC/B,OAAO,EAAE;QACP,aAAa,EAAE,UAAU;KAC1B;CACF,CAAC,CAAC;AAEH,eAAe,aAAa,CAAC","sourcesContent":["import * as React from 'react';\nimport { findDOMNode } from 'react-dom';\nimport { LayoutChangeEvent, PixelRatio, StyleSheet, View, ViewProps } from 'react-native';\nimport createElement from 'react-native-web/dist/exports/createElement';\n\nfunction getElement(component: React.ReactInstance): React.ReactInstance | Element | null | Text {\n try {\n return findDOMNode(component);\n } catch {\n return component;\n }\n}\n\nfunction setRef<T>(refProp: React.Ref<T>, ref: T | null) {\n if (!refProp) return;\n\n if (typeof refProp === 'function') {\n refProp(ref);\n } else if ('current' in refProp) {\n // @ts-ignore\n refProp.current = ref;\n }\n}\n\nconst Canvas = React.forwardRef(\n (props: React.ComponentProps<typeof View>, ref: React.Ref<HTMLCanvasElement>) =>\n createElement('canvas', { ...props, ref })\n);\n\nconst CanvasWrapper: React.FunctionComponent<\n ViewProps & {\n canvasRef: React.Ref<HTMLCanvasElement>;\n }\n> = ({ pointerEvents, children, style, ...props }) => {\n const [size, setSize] = React.useState<{ width: number; height: number } | null>(null);\n\n const ref = React.useRef<View>(null);\n const _canvasRef = React.useRef<HTMLCanvasElement>(null);\n\n function updateCanvasSize(): void {\n const canvas = _canvasRef.current;\n if (typeof HTMLCanvasElement !== 'undefined' && canvas instanceof HTMLCanvasElement) {\n const size = getSize();\n const scale = PixelRatio.get();\n\n canvas.style.width = `${size.width}px`;\n canvas.style.height = `${size.height}px`;\n\n canvas.width = size.width * scale;\n canvas.height = size.height * scale;\n }\n }\n\n function getSize(): { width: number; height: number } {\n if (size) {\n return size;\n } else if (!ref.current || typeof window === 'undefined') {\n return { width: 0, height: 0 };\n }\n const element = getElement(ref.current);\n const { offsetWidth: width = 0, offsetHeight: height = 0 } = element as HTMLElement;\n return { width, height };\n }\n\n const onLayout = (event: LayoutChangeEvent) => {\n const {\n nativeEvent: {\n layout: { width, height },\n },\n } = event;\n\n if (width !== size?.width || height !== size.height) {\n setSize({ width, height });\n\n if (props.onLayout) {\n props.onLayout(event);\n }\n }\n };\n\n React.useEffect(() => {\n if (ref.current != null) {\n setSize(getSize());\n }\n }, [ref]);\n\n React.useEffect(() => {\n updateCanvasSize();\n }, [size]);\n\n React.useEffect(() => {\n const canvas = _canvasRef.current;\n if (canvas) {\n updateCanvasSize();\n }\n setRef(props.canvasRef, canvas);\n }, [_canvasRef]);\n\n return (\n <View {...props} style={[styles.wrapper, style]} ref={ref} onLayout={onLayout}>\n <Canvas ref={_canvasRef} pointerEvents={pointerEvents} style={StyleSheet.absoluteFill} />\n {children}\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n wrapper: {\n pointerEvents: 'box-none',\n },\n});\n\nexport default CanvasWrapper;\n"]}
@@ -1,4 +1,4 @@
1
- declare const _default: {
1
+ declare const GLErrors: {
2
2
  1280: string;
3
3
  1281: string;
4
4
  1282: string;
@@ -6,5 +6,5 @@ declare const _default: {
6
6
  1286: string;
7
7
  37442: string;
8
8
  };
9
- export default _default;
9
+ export default GLErrors;
10
10
  //# sourceMappingURL=GLErrors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"GLErrors.d.ts","sourceRoot":"","sources":["../src/GLErrors.ts"],"names":[],"mappings":";;;;;;;;AAAA,wBAOE"}
1
+ {"version":3,"file":"GLErrors.d.ts","sourceRoot":"","sources":["../src/GLErrors.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,QAAQ;;;;;;;CAOb,CAAC;AAEF,eAAe,QAAQ,CAAC"}
package/build/GLErrors.js CHANGED
@@ -1,4 +1,4 @@
1
- export default {
1
+ const GLErrors = {
2
2
  1280: 'INVALID ENUM: An unacceptable value has been specified for an enumerated argument.',
3
3
  1281: 'INVALID_VALUE: A numeric argument is out of range.',
4
4
  1282: 'INVALID_OPERATION: The specified command is not allowed for the current state.',
@@ -6,4 +6,5 @@ export default {
6
6
  1286: 'INVALID_FRAMEBUFFER_OPERATION: The currently bound framebuffer is not complete when trying to render to or to read from it.',
7
7
  37442: 'CONTEXT_LOST_WEBGL: The WebGL context is lost.',
8
8
  };
9
+ export default GLErrors;
9
10
  //# sourceMappingURL=GLErrors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GLErrors.js","sourceRoot":"","sources":["../src/GLErrors.ts"],"names":[],"mappings":"AAAA,eAAe;IACb,IAAI,EAAE,oFAAoF;IAC1F,IAAI,EAAE,oDAAoD;IAC1D,IAAI,EAAE,gFAAgF;IACtF,IAAI,EAAE,kEAAkE;IACxE,IAAI,EAAE,6HAA6H;IACnI,KAAK,EAAE,gDAAgD;CACxD,CAAC","sourcesContent":["export default {\n 1280: 'INVALID ENUM: An unacceptable value has been specified for an enumerated argument.',\n 1281: 'INVALID_VALUE: A numeric argument is out of range.',\n 1282: 'INVALID_OPERATION: The specified command is not allowed for the current state.',\n 1285: 'OUT_OF_MEMORY: Not enough memory is left to execute the command.',\n 1286: 'INVALID_FRAMEBUFFER_OPERATION: The currently bound framebuffer is not complete when trying to render to or to read from it.',\n 37442: 'CONTEXT_LOST_WEBGL: The WebGL context is lost.',\n};\n"]}
1
+ {"version":3,"file":"GLErrors.js","sourceRoot":"","sources":["../src/GLErrors.ts"],"names":[],"mappings":"AAAA,MAAM,QAAQ,GAAG;IACf,IAAI,EAAE,oFAAoF;IAC1F,IAAI,EAAE,oDAAoD;IAC1D,IAAI,EAAE,gFAAgF;IACtF,IAAI,EAAE,kEAAkE;IACxE,IAAI,EAAE,6HAA6H;IACnI,KAAK,EAAE,gDAAgD;CACxD,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["const GLErrors = {\n 1280: 'INVALID ENUM: An unacceptable value has been specified for an enumerated argument.',\n 1281: 'INVALID_VALUE: A numeric argument is out of range.',\n 1282: 'INVALID_OPERATION: The specified command is not allowed for the current state.',\n 1285: 'OUT_OF_MEMORY: Not enough memory is left to execute the command.',\n 1286: 'INVALID_FRAMEBUFFER_OPERATION: The currently bound framebuffer is not complete when trying to render to or to read from it.',\n 37442: 'CONTEXT_LOST_WEBGL: The WebGL context is lost.',\n};\n\nexport default GLErrors;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"GLUtils.d.ts","sourceRoot":"","sources":["../src/GLUtils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAmB,MAAM,gBAAgB,CAAC;AAO5E;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,yBAAyB,GAAG,IAAI,CAgFpE"}
1
+ {"version":3,"file":"GLUtils.d.ts","sourceRoot":"","sources":["../src/GLUtils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAmB,MAAM,gBAAgB,CAAC;AAO5E;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,yBAAyB,GAAG,IAAI,CAkFpE"}
package/build/GLUtils.js CHANGED
@@ -17,30 +17,31 @@ export function configureLogging(gl) {
17
17
  loggingOption = option;
18
18
  return;
19
19
  }
20
+ const __gl = gl;
20
21
  // Turn off logging.
21
22
  if (option === GLLoggingOption.DISABLED || !option) {
22
- Object.entries(gl).forEach(([key, value]) => {
23
+ Object.entries(__gl).forEach(([key, value]) => {
23
24
  if (typeof value === 'function' && value.__logWrapper) {
24
- delete gl[key];
25
+ delete __gl[key];
25
26
  }
26
27
  });
27
28
  loggingOption = option;
28
29
  return;
29
30
  }
30
31
  // Turn on logging.
31
- Object.entries(Object.getPrototypeOf(gl)).forEach(([key, originalValue]) => {
32
+ Object.entries(Object.getPrototypeOf(__gl)).forEach(([key, originalValue]) => {
32
33
  if (typeof originalValue !== 'function' || key === '__expoSetLogging') {
33
34
  return;
34
35
  }
35
- gl[key] = (...args) => {
36
+ __gl[key] = (...args) => {
36
37
  if (loggingOption & GLLoggingOption.METHOD_CALLS) {
37
38
  const params = args.map((arg) => {
38
39
  // If the type is `number`, then try to find name of the constant that has such value,
39
40
  // so it's easier to read these logs. In some cases it might be misleading
40
41
  // if the parameter is for example a width or height, so the number is still logged.
41
42
  if (loggingOption & GLLoggingOption.RESOLVE_CONSTANTS && typeof arg === 'number') {
42
- for (const prop in gl) {
43
- if (gl[prop] === arg) {
43
+ for (const prop in __gl) {
44
+ if (__gl[prop] === arg) {
44
45
  return `${arg} (${prop})`;
45
46
  }
46
47
  }
@@ -58,20 +59,20 @@ export function configureLogging(gl) {
58
59
  });
59
60
  console.log(`ExpoGL: ${key}(${params.join(', ')})`);
60
61
  }
61
- const result = originalValue.apply(gl, args);
62
+ const result = originalValue.apply(__gl, args);
62
63
  if (loggingOption & GLLoggingOption.METHOD_CALLS) {
63
64
  console.log(`ExpoGL: = ${result}`);
64
65
  }
65
66
  if (loggingOption & GLLoggingOption.GET_ERRORS && key !== 'getError') {
66
67
  // @ts-ignore We need to call into the original `getError`.
67
68
  // eslint-disable-next-line no-proto
68
- const error = gl.__proto__.getError.call(gl);
69
- if (error && error !== gl.NO_ERROR) {
69
+ const error = __gl.__proto__.getError.call(__gl);
70
+ if (error && error !== __gl.NO_ERROR) {
70
71
  // `console.error` would cause a red screen, so let's just log with red color.
71
72
  console.log(`\x1b[31mExpoGL: Error ${GLErrors[error]}\x1b[0m`);
72
73
  }
73
74
  }
74
- gl[key].__logWrapper = true;
75
+ __gl[key].__logWrapper = true;
75
76
  return result;
76
77
  };
77
78
  });
@@ -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,CAAC,EAA6B;IAC5D,kDAAkD;IAClD,IAAI,aAAa,GAAG,eAAe,CAAC,QAAQ,CAAC;IAE7C,EAAE,CAAC,gBAAgB,GAAG,CAAC,MAAuB,EAAQ,EAAE;QACtD,kEAAkE;QACl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AAQ,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;oBACjE,CAAC;gBACH,CAAC;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 === 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"]}
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,CAAC;YAC/B,aAAa,GAAG,MAAM,CAAC;YACvB,OAAO;QACT,CAAC;QAED,MAAM,IAAI,GAAG,EAA2C,CAAC;QAEzD,oBAAoB;QAC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C9B,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 const __gl = gl as Record<keyof typeof gl | string, any>;\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: any[]) => {\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 as keyof typeof GLErrors]}\\x1b[0m`);\n }\n }\n __gl[key].__logWrapper = true;\n return result;\n };\n });\n\n loggingOption = option;\n };\n}\n"]}
@@ -63,6 +63,9 @@ export interface ExpoWebGLRenderingContext extends WebGL2RenderingContext {
63
63
  endFrameEXP(): void;
64
64
  flushEXP(): void;
65
65
  __expoSetLogging(option: GLLoggingOption): void;
66
+ /** @internal */
67
+ _expo_texSubImage2D?(...props: any[]): void;
68
+ _expo_texImage2D?(...props: any[]): void;
66
69
  }
67
70
  export type ComponentOrHandle = null | number | Component<any, any> | ComponentClass<any>;
68
71
  export type GLViewProps = {
@@ -87,7 +90,7 @@ export type GLViewProps = {
87
90
  * @hidden
88
91
  * A ref callback for the native GLView
89
92
  */
90
- nativeRef_EXPERIMENTAL?(callback: ComponentOrHandle | null): any;
93
+ nativeRef_EXPERIMENTAL?(callback: ComponentOrHandle | null): void;
91
94
  } & ViewProps;
92
95
  export declare enum GLLoggingOption {
93
96
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"GLView.types.d.ts","sourceRoot":"","sources":["../src/GLView.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,C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sources":["../src/GLView.types.ts"],"names":[],"mappings":"AAwGA,cAAc;AACd,MAAM,CAAN,IAAY,eA2BX;AA3BD,WAAY,eAAe;IACzB;;OAEG;IACH,6DAAY,CAAA;IACZ;;OAEG;IACH,qEAAgB,CAAA;IAChB;;;OAGG;IACH,iEAAc,CAAA;IACd;;OAEG;IACH,+EAAqB,CAAA;IACrB;;;OAGG;IACH,6EAAoB,CAAA;IACpB;;OAEG;IACH,oDAAsE,CAAA;AACxE,CAAC,EA3BW,eAAe,KAAf,eAAe,QA2B1B","sourcesContent":["import { Component, ComponentClass } from 'react';\nimport { ViewProps } from 'react-native';\n\n// @docsMissing\nexport type SurfaceCreateEvent = {\n nativeEvent: {\n exglCtxId: number;\n };\n};\n\n// @needsAudit\nexport type SnapshotOptions = {\n /**\n * Whether to flip the snapshot vertically.\n * @default false\n */\n flip?: boolean;\n /**\n * Specify the framebuffer that we will be reading from.\n * Defaults to underlying framebuffer that is presented in the view or the current framebuffer if context is headless.\n */\n framebuffer?: WebGLFramebuffer;\n /**\n * Rect to crop the snapshot. It's passed directly to `glReadPixels`.\n */\n rect?: {\n x: number;\n y: number;\n width: number;\n height: number;\n };\n /**\n * Specifies what type of compression should be used and what is the result file extension.\n * PNG compression is lossless but slower, JPEG is faster but the image has visible artifacts.\n * > **Note:** When using WebP format, the iOS version will print a warning, and generate a `'png'` file instead.\n * > It is recommended to use [platform-specific](https://reactnative.dev/docs/platform-specific-code) code in this case.\n * @default 'jpeg'\n */\n format?: 'jpeg' | 'png' | 'webp';\n /**\n * A value in range `0` to `1.0` specifying compression level of the result image.\n * `1.0` means no compression and `0` the highest compression.\n * @default 1.0\n */\n compress?: number;\n};\n\n// @needsAudit\nexport type GLSnapshot = {\n /**\n * URI to the snapshot.\n */\n uri: string | Blob | null;\n /**\n * Synonym for `uri`. Makes snapshot object compatible with `texImage2D`.\n */\n localUri: string;\n /**\n * Width of the snapshot.\n */\n width: number;\n /**\n * Height of the snapshot.\n */\n height: number;\n};\n\n// @docsMissing\nexport interface ExpoWebGLRenderingContext extends WebGL2RenderingContext {\n contextId: number;\n endFrameEXP(): void;\n flushEXP(): void;\n __expoSetLogging(option: GLLoggingOption): void;\n}\n\n// @docsMissing\nexport type ComponentOrHandle = null | number | Component<any, any> | ComponentClass<any>;\n\n// @needsAudit\nexport type GLViewProps = {\n /**\n * A function that will be called when the OpenGL ES context is created.\n * The function is passed a single argument `gl` that extends a [WebGLRenderingContext](https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14) interface.\n */\n onContextCreate(gl: ExpoWebGLRenderingContext): void;\n /**\n * `GLView` can enable iOS's built-in [multisampling](https://www.khronos.org/registry/OpenGL/extensions/APPLE/APPLE_framebuffer_multisample.txt).\n * This prop specifies the number of samples to use. Setting this to `0` turns off multisampling.\n * @platform ios\n * @default 4\n */\n msaaSamples: number;\n /**\n * Enables support for interacting with a `gl` object from code running on the Reanimated worklet thread.\n * @default false\n */\n enableExperimentalWorkletSupport: boolean;\n /**\n * @hidden\n * A ref callback for the native GLView\n */\n nativeRef_EXPERIMENTAL?(callback: ComponentOrHandle | null);\n} & ViewProps;\n\n// @needsAudit\nexport enum GLLoggingOption {\n /**\n * Disables logging entirely.\n */\n DISABLED = 0,\n /**\n * Logs method calls, their parameters and results.\n */\n METHOD_CALLS = 1,\n /**\n * Calls `gl.getError()` after each other method call and prints an error if any is returned.\n * This option has a significant impact on the performance as this method is blocking.\n */\n GET_ERRORS = 2,\n /**\n * Resolves parameters of type `number` to their constant names.\n */\n RESOLVE_CONSTANTS = 4,\n /**\n * When this option is enabled, long strings will be truncated.\n * It's useful if your shaders are really big and logging them significantly reduces performance.\n */\n TRUNCATE_STRINGS = 8,\n /**\n * Enables all other options. It implies `GET_ERRORS` so be aware of the slowdown.\n */\n ALL = METHOD_CALLS | GET_ERRORS | RESOLVE_CONSTANTS | TRUNCATE_STRINGS,\n}\n"]}
1
+ {"version":3,"file":"GLView.types.js","sourceRoot":"","sources":["../src/GLView.types.ts"],"names":[],"mappings":"AA4GA,cAAc;AACd,MAAM,CAAN,IAAY,eA2BX;AA3BD,WAAY,eAAe;IACzB;;OAEG;IACH,6DAAY,CAAA;IACZ;;OAEG;IACH,qEAAgB,CAAA;IAChB;;;OAGG;IACH,iEAAc,CAAA;IACd;;OAEG;IACH,+EAAqB,CAAA;IACrB;;;OAGG;IACH,6EAAoB,CAAA;IACpB;;OAEG;IACH,oDAAsE,CAAA;AACxE,CAAC,EA3BW,eAAe,KAAf,eAAe,QA2B1B","sourcesContent":["import { Component, ComponentClass } from 'react';\nimport { ViewProps } from 'react-native';\n\n// @docsMissing\nexport type SurfaceCreateEvent = {\n nativeEvent: {\n exglCtxId: number;\n };\n};\n\n// @needsAudit\nexport type SnapshotOptions = {\n /**\n * Whether to flip the snapshot vertically.\n * @default false\n */\n flip?: boolean;\n /**\n * Specify the framebuffer that we will be reading from.\n * Defaults to underlying framebuffer that is presented in the view or the current framebuffer if context is headless.\n */\n framebuffer?: WebGLFramebuffer;\n /**\n * Rect to crop the snapshot. It's passed directly to `glReadPixels`.\n */\n rect?: {\n x: number;\n y: number;\n width: number;\n height: number;\n };\n /**\n * Specifies what type of compression should be used and what is the result file extension.\n * PNG compression is lossless but slower, JPEG is faster but the image has visible artifacts.\n * > **Note:** When using WebP format, the iOS version will print a warning, and generate a `'png'` file instead.\n * > It is recommended to use [platform-specific](https://reactnative.dev/docs/platform-specific-code) code in this case.\n * @default 'jpeg'\n */\n format?: 'jpeg' | 'png' | 'webp';\n /**\n * A value in range `0` to `1.0` specifying compression level of the result image.\n * `1.0` means no compression and `0` the highest compression.\n * @default 1.0\n */\n compress?: number;\n};\n\n// @needsAudit\nexport type GLSnapshot = {\n /**\n * URI to the snapshot.\n */\n uri: string | Blob | null;\n /**\n * Synonym for `uri`. Makes snapshot object compatible with `texImage2D`.\n */\n localUri: string;\n /**\n * Width of the snapshot.\n */\n width: number;\n /**\n * Height of the snapshot.\n */\n height: number;\n};\n\n// @docsMissing\nexport interface ExpoWebGLRenderingContext extends WebGL2RenderingContext {\n contextId: number;\n endFrameEXP(): void;\n flushEXP(): void;\n __expoSetLogging(option: GLLoggingOption): void;\n\n /** @internal */\n _expo_texSubImage2D?(...props: any[]): void;\n _expo_texImage2D?(...props: any[]): void;\n}\n\n// @docsMissing\nexport type ComponentOrHandle = null | number | Component<any, any> | ComponentClass<any>;\n\n// @needsAudit\nexport type GLViewProps = {\n /**\n * A function that will be called when the OpenGL ES context is created.\n * The function is passed a single argument `gl` that extends a [WebGLRenderingContext](https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14) interface.\n */\n onContextCreate(gl: ExpoWebGLRenderingContext): void;\n /**\n * `GLView` can enable iOS's built-in [multisampling](https://www.khronos.org/registry/OpenGL/extensions/APPLE/APPLE_framebuffer_multisample.txt).\n * This prop specifies the number of samples to use. Setting this to `0` turns off multisampling.\n * @platform ios\n * @default 4\n */\n msaaSamples: number;\n /**\n * Enables support for interacting with a `gl` object from code running on the Reanimated worklet thread.\n * @default false\n */\n enableExperimentalWorkletSupport: boolean;\n /**\n * @hidden\n * A ref callback for the native GLView\n */\n nativeRef_EXPERIMENTAL?(callback: ComponentOrHandle | null): void;\n} & ViewProps;\n\n// @needsAudit\nexport enum GLLoggingOption {\n /**\n * Disables logging entirely.\n */\n DISABLED = 0,\n /**\n * Logs method calls, their parameters and results.\n */\n METHOD_CALLS = 1,\n /**\n * Calls `gl.getError()` after each other method call and prints an error if any is returned.\n * This option has a significant impact on the performance as this method is blocking.\n */\n GET_ERRORS = 2,\n /**\n * Resolves parameters of type `number` to their constant names.\n */\n RESOLVE_CONSTANTS = 4,\n /**\n * When this option is enabled, long strings will be truncated.\n * It's useful if your shaders are really big and logging them significantly reduces performance.\n */\n TRUNCATE_STRINGS = 8,\n /**\n * Enables all other options. It implies `GET_ERRORS` so be aware of the slowdown.\n */\n ALL = METHOD_CALLS | GET_ERRORS | RESOLVE_CONSTANTS | TRUNCATE_STRINGS,\n}\n"]}
@@ -6,7 +6,7 @@ export type GLViewWebProps = GLViewProps & {
6
6
  onContextRestored?: (gl?: WebGLRenderingContext) => void;
7
7
  onContextLost?: () => void;
8
8
  webglContextAttributes?: WebGLContextAttributes;
9
- nativeRef_EXPERIMENTAL?(callback: ComponentOrHandle | HTMLCanvasElement | null): any;
9
+ nativeRef_EXPERIMENTAL?(callback: ComponentOrHandle | HTMLCanvasElement | null): unknown;
10
10
  };
11
11
  export declare class GLView extends React.Component<GLViewWebProps> {
12
12
  canvas?: HTMLCanvasElement;
@@ -16,7 +16,7 @@ export declare class GLView extends React.Component<GLViewWebProps> {
16
16
  static takeSnapshotAsync(gl: WebGLRenderingContext, options?: SnapshotOptions): Promise<GLSnapshot>;
17
17
  componentWillUnmount(): void;
18
18
  render(): React.JSX.Element;
19
- componentDidUpdate(prevProps: any): void;
19
+ componentDidUpdate(prevProps: GLViewWebProps): void;
20
20
  private getGLContextOrReject;
21
21
  private onContextLost;
22
22
  private onContextRestored;
@@ -1 +1 @@
1
- {"version":3,"file":"GLView.web.d.ts","sourceRoot":"","sources":["../src/GLView.web.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EACL,WAAW,EAEX,UAAU,EACV,eAAe,EACf,iBAAiB,EAClB,MAAM,gBAAgB,CAAC;AAiExB,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG;IACzC,eAAe,EAAE,CAAC,EAAE,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACrD,iBAAiB,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACzD,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,sBAAsB,CAAC,EAAE,sBAAsB,CAAC;IAEhD,sBAAsB,CAAC,CAAC,QAAQ,EAAE,iBAAiB,GAAG,iBAAiB,GAAG,IAAI,OAAE;CACjF,CAAC;AA8BF,qBAAa,MAAO,SAAQ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AqB,CAAC,CAAC;IACjE,CAAC;IAEM,KAAK,CAAC,wBAAwB;QACnC,MAAM,IAAI,mBAAmB,CAAC,QAAQ,EAAE,0BAA0B,CAAC,CAAC;IACtE,CAAC;IAEM,KAAK,CAAC,kBAAkB,CAAC,QAAqB;QACnD,MAAM,IAAI,mBAAmB,CAAC,QAAQ,EAAE,oBAAoB,CAAC,CAAC;IAChE,CAAC;CACF","sourcesContent":["import { CodedError, Platform, UnavailabilityError } from 'expo-modules-core';\nimport invariant from 'invariant';\nimport * as React from 'react';\nimport { Dimensions } from 'react-native';\n\nimport Canvas from './Canvas';\nimport { WebGLObject } from './GLView';\nimport {\n GLViewProps,\n ExpoWebGLRenderingContext,\n GLSnapshot,\n SnapshotOptions,\n ComponentOrHandle,\n} from './GLView.types';\n\nfunction getImageForAsset(asset: {\n downloadAsync?: () => Promise<any>;\n uri?: string;\n localUri?: string;\n}): HTMLImageElement | any {\n if (asset != null && typeof asset === 'object' && asset.downloadAsync) {\n const dataURI = asset.localUri || asset.uri || '';\n const image = new Image();\n image.src = dataURI;\n return image;\n }\n return asset;\n}\n\nfunction isOffscreenCanvas(element: any): element is OffscreenCanvas {\n return element && typeof element.convertToBlob === 'function';\n}\n\nfunction asExpoContext(gl: ExpoWebGLRenderingContext): WebGLRenderingContext {\n gl.endFrameEXP = function glEndFrameEXP(): void {};\n\n if (!gl['_expo_texImage2D']) {\n gl['_expo_texImage2D'] = gl.texImage2D;\n gl.texImage2D = (...props: any[]): any => {\n const nextProps = [...props];\n nextProps.push(getImageForAsset(nextProps.pop()));\n return gl['_expo_texImage2D'](...nextProps);\n };\n }\n\n if (!gl['_expo_texSubImage2D']) {\n gl['_expo_texSubImage2D'] = gl.texSubImage2D;\n gl.texSubImage2D = (...props: any[]): any => {\n const nextProps = [...props];\n nextProps.push(getImageForAsset(nextProps.pop()));\n return gl['_expo_texSubImage2D'](...nextProps);\n };\n }\n\n return gl;\n}\n\nfunction ensureContext(\n canvas?: HTMLCanvasElement,\n contextAttributes?: WebGLContextAttributes\n): WebGLRenderingContext {\n if (!canvas) {\n throw new CodedError(\n 'ERR_GL_INVALID',\n 'Attempting to use the GL context before it has been created.'\n );\n }\n\n const context =\n canvas.getContext('webgl2', contextAttributes) ||\n canvas.getContext('webgl', contextAttributes) ||\n canvas.getContext('webgl-experimental', contextAttributes) ||\n canvas.getContext('experimental-webgl', contextAttributes);\n invariant(context, 'Browser does not support WebGL');\n return asExpoContext(context as ExpoWebGLRenderingContext);\n}\n\n// @needsAudit @docsMissing\nexport type GLViewWebProps = GLViewProps & {\n onContextCreate: (gl: WebGLRenderingContext) => void;\n onContextRestored?: (gl?: WebGLRenderingContext) => void;\n onContextLost?: () => void;\n webglContextAttributes?: WebGLContextAttributes;\n // type overwrite\n nativeRef_EXPERIMENTAL?(callback: ComponentOrHandle | HTMLCanvasElement | null);\n};\n\nasync function getBlobFromWebGLRenderingContext(\n gl: WebGLRenderingContext,\n options: SnapshotOptions = {}\n): Promise<{ width: number; height: number; blob: Blob | null }> {\n invariant(gl, 'getBlobFromWebGLRenderingContext(): WebGL Rendering Context is not defined');\n\n const { canvas } = gl;\n\n let blob: Blob | null = null;\n\n if (typeof (canvas as any).msToBlob === 'function') {\n // @ts-ignore: polyfill: https://stackoverflow.com/a/29815058/4047926\n blob = await canvas.msToBlob();\n } else if (isOffscreenCanvas(canvas)) {\n blob = await canvas.convertToBlob({ quality: options.compress, type: options.format });\n } else {\n blob = await new Promise((resolve) => {\n canvas.toBlob((blob: Blob | null) => resolve(blob), options.format, options.compress);\n });\n }\n\n return {\n blob,\n width: canvas.width,\n height: canvas.height,\n };\n}\n\nexport class GLView extends React.Component<GLViewWebProps> {\n canvas?: HTMLCanvasElement;\n\n gl?: WebGLRenderingContext;\n\n static async createContextAsync(): Promise<WebGLRenderingContext | null> {\n if (!Platform.isDOMAvailable) {\n return null;\n }\n const canvas = document.createElement('canvas');\n const { width, height, scale } = Dimensions.get('window');\n canvas.width = width * scale;\n canvas.height = height * scale;\n return ensureContext(canvas);\n }\n\n static async destroyContextAsync(exgl?: WebGLRenderingContext | number): Promise<boolean> {\n // Do nothing\n return true;\n }\n\n static async takeSnapshotAsync(\n gl: WebGLRenderingContext,\n options: SnapshotOptions = {}\n ): Promise<GLSnapshot> {\n const { blob, width, height } = await getBlobFromWebGLRenderingContext(gl, options);\n\n if (!blob) {\n throw new CodedError('ERR_GL_SNAPSHOT', 'Failed to save the GL context');\n }\n\n return {\n uri: blob,\n localUri: '',\n width,\n height,\n };\n }\n\n componentWillUnmount() {\n if (this.gl) {\n const loseContextExt = this.gl.getExtension('WEBGL_lose_context');\n if (loseContextExt) {\n loseContextExt.loseContext();\n }\n this.gl = undefined;\n }\n if (this.canvas) {\n this.canvas.removeEventListener('webglcontextlost', this.onContextLost);\n this.canvas.removeEventListener('webglcontextrestored', this.onContextRestored);\n }\n }\n\n render() {\n const {\n onContextCreate,\n onContextRestored,\n onContextLost,\n webglContextAttributes,\n msaaSamples,\n nativeRef_EXPERIMENTAL,\n // @ts-ignore: ref does not exist\n ref,\n ...domProps\n } = this.props;\n\n return <Canvas {...domProps} canvasRef={this.setCanvasRef} />;\n }\n\n componentDidUpdate(prevProps) {\n const { webglContextAttributes } = this.props;\n if (this.canvas && webglContextAttributes !== prevProps.webglContextAttributes) {\n this.onContextLost(null);\n this.onContextRestored();\n }\n }\n\n private getGLContextOrReject(): WebGLRenderingContext {\n const gl = this.getGLContext();\n if (!gl) {\n throw new CodedError(\n 'ERR_GL_INVALID',\n 'Attempting to use the GL context before it has been created.'\n );\n }\n return gl;\n }\n\n private onContextLost = (event: Event | null): void => {\n if (event && event.preventDefault) {\n event.preventDefault();\n }\n this.gl = undefined;\n\n if (typeof this.props.onContextLost === 'function') {\n this.props.onContextLost();\n }\n };\n\n private onContextRestored = (): void => {\n this.gl = undefined;\n if (this.getGLContext() == null) {\n throw new CodedError('ERR_GL_INVALID', 'Failed to restore GL context.');\n }\n };\n\n private getGLContext(): WebGLRenderingContext | null {\n if (this.gl) return this.gl;\n\n if (this.canvas) {\n this.gl = ensureContext(this.canvas, this.props.webglContextAttributes);\n if (typeof this.props.onContextCreate === 'function') {\n this.props.onContextCreate(this.gl);\n }\n return this.gl;\n }\n return null;\n }\n\n private setCanvasRef = (canvas: HTMLCanvasElement): void => {\n this.canvas = canvas;\n\n if (typeof this.props.nativeRef_EXPERIMENTAL === 'function') {\n this.props.nativeRef_EXPERIMENTAL(canvas);\n }\n\n if (this.canvas) {\n this.canvas.addEventListener('webglcontextlost', this.onContextLost);\n this.canvas.addEventListener('webglcontextrestored', this.onContextRestored);\n\n this.getGLContext();\n }\n };\n\n public async takeSnapshotAsync(options: SnapshotOptions = {}): Promise<GLSnapshot> {\n if (!GLView.takeSnapshotAsync) {\n throw new UnavailabilityError('expo-gl', 'takeSnapshotAsync');\n }\n\n const gl = this.getGLContextOrReject();\n return await GLView.takeSnapshotAsync(gl, options);\n }\n\n public async startARSessionAsync(): Promise<void> {\n throw new UnavailabilityError('GLView', 'startARSessionAsync');\n }\n\n public async createCameraTextureAsync(): Promise<void> {\n throw new UnavailabilityError('GLView', 'createCameraTextureAsync');\n }\n\n public async destroyObjectAsync(glObject: WebGLObject): Promise<void> {\n throw new UnavailabilityError('GLView', 'destroyObjectAsync');\n }\n}\n"]}
1
+ {"version":3,"file":"GLView.web.js","sourceRoot":"","sources":["../src/GLView.web.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC9E,OAAO,SAAS,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,MAAM,MAAM,UAAU,CAAC;AAU9B,SAAS,gBAAgB,CAAC,KAIzB;IACC,IAAI,KAAK,IAAI,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,aAAa,EAAE,CAAC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abilityError } from 'expo-modules-core';\nimport invariant from 'invariant';\nimport * as React from 'react';\nimport { Dimensions } from 'react-native';\n\nimport Canvas from './Canvas';\nimport { WebGLObject } from './GLView';\nimport {\n GLViewProps,\n ExpoWebGLRenderingContext,\n GLSnapshot,\n SnapshotOptions,\n ComponentOrHandle,\n} from './GLView.types';\n\nfunction getImageForAsset(asset: {\n downloadAsync?: () => Promise<any>;\n uri?: string;\n localUri?: string;\n}): HTMLImageElement | any {\n if (asset != null && typeof asset === 'object' && asset.downloadAsync) {\n const dataURI = asset.localUri || asset.uri || '';\n const image = new Image();\n image.src = dataURI;\n return image;\n }\n return asset;\n}\n\nfunction isOffscreenCanvas(element: any): element is OffscreenCanvas {\n return element && typeof element.convertToBlob === 'function';\n}\n\nfunction asExpoContext(gl: ExpoWebGLRenderingContext): WebGLRenderingContext {\n gl.endFrameEXP = function glEndFrameEXP(): void {};\n\n if (!gl['_expo_texImage2D']) {\n gl['_expo_texImage2D'] = gl.texImage2D;\n gl.texImage2D = (...props: any[]): any => {\n const nextProps = [...props];\n nextProps.push(getImageForAsset(nextProps.pop()));\n return gl['_expo_texImage2D']!(...nextProps);\n };\n }\n\n if (!gl['_expo_texSubImage2D']) {\n gl['_expo_texSubImage2D'] = gl.texSubImage2D;\n gl.texSubImage2D = (...props: any[]): any => {\n const nextProps = [...props];\n nextProps.push(getImageForAsset(nextProps.pop()));\n return gl['_expo_texSubImage2D']!(...nextProps);\n };\n }\n\n return gl;\n}\n\nfunction ensureContext(\n canvas?: HTMLCanvasElement,\n contextAttributes?: WebGLContextAttributes\n): WebGLRenderingContext {\n if (!canvas) {\n throw new CodedError(\n 'ERR_GL_INVALID',\n 'Attempting to use the GL context before it has been created.'\n );\n }\n\n const context =\n canvas.getContext('webgl2', contextAttributes) ||\n canvas.getContext('webgl', contextAttributes) ||\n canvas.getContext('webgl-experimental', contextAttributes) ||\n canvas.getContext('experimental-webgl', contextAttributes);\n invariant(context, 'Browser does not support WebGL');\n return asExpoContext(context as ExpoWebGLRenderingContext);\n}\n\n// @needsAudit @docsMissing\nexport type GLViewWebProps = GLViewProps & {\n onContextCreate: (gl: WebGLRenderingContext) => void;\n onContextRestored?: (gl?: WebGLRenderingContext) => void;\n onContextLost?: () => void;\n webglContextAttributes?: WebGLContextAttributes;\n // type overwrite\n nativeRef_EXPERIMENTAL?(callback: ComponentOrHandle | HTMLCanvasElement | null): unknown;\n};\n\nasync function getBlobFromWebGLRenderingContext(\n gl: WebGLRenderingContext,\n options: SnapshotOptions = {}\n): Promise<{ width: number; height: number; blob: Blob | null }> {\n invariant(gl, 'getBlobFromWebGLRenderingContext(): WebGL Rendering Context is not defined');\n\n const { canvas } = gl;\n\n let blob: Blob | null = null;\n\n if (typeof (canvas as any).msToBlob === 'function') {\n // @ts-ignore: polyfill: https://stackoverflow.com/a/29815058/4047926\n blob = await canvas.msToBlob();\n } else if (isOffscreenCanvas(canvas)) {\n blob = await canvas.convertToBlob({ quality: options.compress, type: options.format });\n } else {\n blob = await new Promise((resolve) => {\n canvas.toBlob((blob: Blob | null) => resolve(blob), options.format, options.compress);\n });\n }\n\n return {\n blob,\n width: canvas.width,\n height: canvas.height,\n };\n}\n\nexport class GLView extends React.Component<GLViewWebProps> {\n canvas?: HTMLCanvasElement;\n\n gl?: WebGLRenderingContext;\n\n static async createContextAsync(): Promise<WebGLRenderingContext | null> {\n if (!Platform.isDOMAvailable) {\n return null;\n }\n const canvas = document.createElement('canvas');\n const { width, height, scale } = Dimensions.get('window');\n canvas.width = width * scale;\n canvas.height = height * scale;\n return ensureContext(canvas);\n }\n\n static async destroyContextAsync(exgl?: WebGLRenderingContext | number): Promise<boolean> {\n // Do nothing\n return true;\n }\n\n static async takeSnapshotAsync(\n gl: WebGLRenderingContext,\n options: SnapshotOptions = {}\n ): Promise<GLSnapshot> {\n const { blob, width, height } = await getBlobFromWebGLRenderingContext(gl, options);\n\n if (!blob) {\n throw new CodedError('ERR_GL_SNAPSHOT', 'Failed to save the GL context');\n }\n\n return {\n uri: blob,\n localUri: '',\n width,\n height,\n };\n }\n\n componentWillUnmount() {\n if (this.gl) {\n const loseContextExt = this.gl.getExtension('WEBGL_lose_context');\n if (loseContextExt) {\n loseContextExt.loseContext();\n }\n this.gl = undefined;\n }\n if (this.canvas) {\n this.canvas.removeEventListener('webglcontextlost', this.onContextLost);\n this.canvas.removeEventListener('webglcontextrestored', this.onContextRestored);\n }\n }\n\n render() {\n const {\n onContextCreate,\n onContextRestored,\n onContextLost,\n webglContextAttributes,\n msaaSamples,\n nativeRef_EXPERIMENTAL,\n // @ts-ignore: ref does not exist\n ref,\n ...domProps\n } = this.props;\n\n return <Canvas {...domProps} canvasRef={this.setCanvasRef} />;\n }\n\n componentDidUpdate(prevProps: GLViewWebProps) {\n const { webglContextAttributes } = this.props;\n if (this.canvas && webglContextAttributes !== prevProps.webglContextAttributes) {\n this.onContextLost(null);\n this.onContextRestored();\n }\n }\n\n private getGLContextOrReject(): WebGLRenderingContext {\n const gl = this.getGLContext();\n if (!gl) {\n throw new CodedError(\n 'ERR_GL_INVALID',\n 'Attempting to use the GL context before it has been created.'\n );\n }\n return gl;\n }\n\n private onContextLost = (event: Event | null): void => {\n if (event && event.preventDefault) {\n event.preventDefault();\n }\n this.gl = undefined;\n\n if (typeof this.props.onContextLost === 'function') {\n this.props.onContextLost();\n }\n };\n\n private onContextRestored = (): void => {\n this.gl = undefined;\n if (this.getGLContext() == null) {\n throw new CodedError('ERR_GL_INVALID', 'Failed to restore GL context.');\n }\n };\n\n private getGLContext(): WebGLRenderingContext | null {\n if (this.gl) return this.gl;\n\n if (this.canvas) {\n this.gl = ensureContext(this.canvas, this.props.webglContextAttributes);\n if (typeof this.props.onContextCreate === 'function') {\n this.props.onContextCreate(this.gl);\n }\n return this.gl;\n }\n return null;\n }\n\n private setCanvasRef = (canvas: HTMLCanvasElement): void => {\n this.canvas = canvas;\n\n if (typeof this.props.nativeRef_EXPERIMENTAL === 'function') {\n this.props.nativeRef_EXPERIMENTAL(canvas);\n }\n\n if (this.canvas) {\n this.canvas.addEventListener('webglcontextlost', this.onContextLost);\n this.canvas.addEventListener('webglcontextrestored', this.onContextRestored);\n\n this.getGLContext();\n }\n };\n\n public async takeSnapshotAsync(options: SnapshotOptions = {}): Promise<GLSnapshot> {\n if (!GLView.takeSnapshotAsync) {\n throw new UnavailabilityError('expo-gl', 'takeSnapshotAsync');\n }\n\n const gl = this.getGLContextOrReject();\n return await GLView.takeSnapshotAsync(gl, options);\n }\n\n public async startARSessionAsync(): Promise<void> {\n throw new UnavailabilityError('GLView', 'startARSessionAsync');\n }\n\n public async createCameraTextureAsync(): Promise<void> {\n throw new UnavailabilityError('GLView', 'createCameraTextureAsync');\n }\n\n public async destroyObjectAsync(glObject: WebGLObject): Promise<void> {\n throw new UnavailabilityError('GLView', 'destroyObjectAsync');\n }\n}\n"]}
@@ -9,7 +9,7 @@
9
9
  "publication": {
10
10
  "groupId": "host.exp.exponent",
11
11
  "artifactId": "expo.modules.gl",
12
- "version": "15.1.1",
12
+ "version": "15.1.2",
13
13
  "repository": "local-maven-repo"
14
14
  }
15
15
  }
@@ -0,0 +1 @@
1
+ 38f6d9e29f69a67ff7f07c60b7579c8215210c96
@@ -0,0 +1 @@
1
+ 6d8b8667da77b17356443b62170d2e4be9ecc56ab3d134456bb93334d0ea6584
@@ -0,0 +1 @@
1
+ f91f6be8c66741bf857a39bfbbe858f34193ba0eb1cf2f00e0b48734bb5b2d7c43d2bfb5a6cffac2b01c28d3c958dbd6549334ff11e122dd9ed80bb5b75a7194
@@ -3,7 +3,7 @@
3
3
  "component": {
4
4
  "group": "host.exp.exponent",
5
5
  "module": "expo.modules.gl",
6
- "version": "15.1.1",
6
+ "version": "15.1.2",
7
7
  "attributes": {
8
8
  "org.gradle.status": "release"
9
9
  }
@@ -24,13 +24,13 @@
24
24
  },
25
25
  "files": [
26
26
  {
27
- "name": "expo.modules.gl-15.1.1.aar",
28
- "url": "expo.modules.gl-15.1.1.aar",
29
- "size": 1044037,
30
- "sha512": "98e275d058da1c0fd707a4b197a86c02aa60c47ee43fc7dd99ccac4d14c8c84920a781a6fde5123ed350924286365a800bec6e7f9b00b81ce1d9de49ac862aa0",
31
- "sha256": "f1d1b8dd2b85484a2d851be91b00b0ff7c98455a3ea5cd0bf5c2649e310d2bb5",
32
- "sha1": "c929f7db323ea4ed4364d299c44fe2ee4a27d39d",
33
- "md5": "4e51904d935bc219545745417b20c2d7"
27
+ "name": "expo.modules.gl-15.1.2.aar",
28
+ "url": "expo.modules.gl-15.1.2.aar",
29
+ "size": 1044041,
30
+ "sha512": "f91f6be8c66741bf857a39bfbbe858f34193ba0eb1cf2f00e0b48734bb5b2d7c43d2bfb5a6cffac2b01c28d3c958dbd6549334ff11e122dd9ed80bb5b75a7194",
31
+ "sha256": "6d8b8667da77b17356443b62170d2e4be9ecc56ab3d134456bb93334d0ea6584",
32
+ "sha1": "38f6d9e29f69a67ff7f07c60b7579c8215210c96",
33
+ "md5": "abbfb2cd09e7dc57d480c0d623e7fe90"
34
34
  }
35
35
  ]
36
36
  },
@@ -53,13 +53,13 @@
53
53
  ],
54
54
  "files": [
55
55
  {
56
- "name": "expo.modules.gl-15.1.1.aar",
57
- "url": "expo.modules.gl-15.1.1.aar",
58
- "size": 1044037,
59
- "sha512": "98e275d058da1c0fd707a4b197a86c02aa60c47ee43fc7dd99ccac4d14c8c84920a781a6fde5123ed350924286365a800bec6e7f9b00b81ce1d9de49ac862aa0",
60
- "sha256": "f1d1b8dd2b85484a2d851be91b00b0ff7c98455a3ea5cd0bf5c2649e310d2bb5",
61
- "sha1": "c929f7db323ea4ed4364d299c44fe2ee4a27d39d",
62
- "md5": "4e51904d935bc219545745417b20c2d7"
56
+ "name": "expo.modules.gl-15.1.2.aar",
57
+ "url": "expo.modules.gl-15.1.2.aar",
58
+ "size": 1044041,
59
+ "sha512": "f91f6be8c66741bf857a39bfbbe858f34193ba0eb1cf2f00e0b48734bb5b2d7c43d2bfb5a6cffac2b01c28d3c958dbd6549334ff11e122dd9ed80bb5b75a7194",
60
+ "sha256": "6d8b8667da77b17356443b62170d2e4be9ecc56ab3d134456bb93334d0ea6584",
61
+ "sha1": "38f6d9e29f69a67ff7f07c60b7579c8215210c96",
62
+ "md5": "abbfb2cd09e7dc57d480c0d623e7fe90"
63
63
  }
64
64
  ]
65
65
  },
@@ -73,8 +73,8 @@
73
73
  },
74
74
  "files": [
75
75
  {
76
- "name": "expo.modules.gl-15.1.1-sources.jar",
77
- "url": "expo.modules.gl-15.1.1-sources.jar",
76
+ "name": "expo.modules.gl-15.1.2-sources.jar",
77
+ "url": "expo.modules.gl-15.1.2-sources.jar",
78
78
  "size": 12381,
79
79
  "sha512": "1cab724074b050f7459a884ac9e98fbf2d009d8239810ca6384c5113f52dd33e5ac40a72ec7174b297e1b10521e56682d73f533715316be5be66ce0e482356d8",
80
80
  "sha256": "e8892c6837d1eb5093b2c3b063883d7511799b0e246940c5b70f1515cb4451cd",
@@ -0,0 +1 @@
1
+ 444fa02a8e892d377e3d4bcd9b0692974fc7804d
@@ -0,0 +1 @@
1
+ c446f7e365c70ba89cce0e41dc7a9fd23fdcbf2ac36c5d1abe787c4d80b21009
@@ -0,0 +1 @@
1
+ e53ac2d909f8d988faff892e026efc28617a2a3c8b9793c96cc81ca123bfee09abfd35e2a98ef88bd20de7d6c1fe534bba75bbeeb4122d98ee28686ea2c5ae67
@@ -9,7 +9,7 @@
9
9
  <modelVersion>4.0.0</modelVersion>
10
10
  <groupId>host.exp.exponent</groupId>
11
11
  <artifactId>expo.modules.gl</artifactId>
12
- <version>15.1.1</version>
12
+ <version>15.1.2</version>
13
13
  <packaging>aar</packaging>
14
14
  <name>expo.modules.gl</name>
15
15
  <url>https://github.com/expo/expo</url>
@@ -0,0 +1 @@
1
+ 8baf6165b52b9bfceec96d084732e5f7833e45b2
@@ -0,0 +1 @@
1
+ 7693fbe2a0ade6abefe8c4fd3e5fa5ad7011cf3fc24f5d1bae987f5affaf5087
@@ -0,0 +1 @@
1
+ 0eae926ad3cdc9e01377942b26957dab2c772c032bf4f027877606ac9e8cfb78bb18a036ecb3861e6b6385f59284c041a7f0b840e7d5216f8f0edb59bdb80ced
@@ -3,11 +3,11 @@
3
3
  <groupId>host.exp.exponent</groupId>
4
4
  <artifactId>expo.modules.gl</artifactId>
5
5
  <versioning>
6
- <latest>15.1.1</latest>
7
- <release>15.1.1</release>
6
+ <latest>15.1.2</latest>
7
+ <release>15.1.2</release>
8
8
  <versions>
9
- <version>15.1.1</version>
9
+ <version>15.1.2</version>
10
10
  </versions>
11
- <lastUpdated>20250409202918</lastUpdated>
11
+ <lastUpdated>20250414185044</lastUpdated>
12
12
  </versioning>
13
13
  </metadata>
@@ -1 +1 @@
1
- e37eeac50b613d6d1a7771d120627b15
1
+ 915e35c32f05250645ac356c9c25d545
@@ -1 +1 @@
1
- 922ca130d24680333de33c83fb0a3d6139c3c8ff
1
+ 909a90de70679aa7d0da2f22afffd6d0b2472edd
@@ -1 +1 @@
1
- 32885d7d05b601fb36c64f4d2a64b9bdc75f2e3dc092b6a8f64d9780284c4578
1
+ 6b5e44c824beb53706e6354105311300f18e281e9bec2a6b13f31db847a29483
@@ -1 +1 @@
1
- 55c53ecf7ea5dd9e10a3ffe4c1748e5c38529ddb2f21ef056203296c2b99a0687e8be7287e2b0df63989767209068c2f03f590c4dcd6e51892a2f784b4d17231
1
+ 7441a91c16e30f187b51e8b8fef5262ade0908622ec49ea68631dabfae0324184e7627ca38651a38c8a5535128630f4d7c8ffee6ca2fce0bfbb99c802694d254
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-gl",
3
- "version": "15.1.1",
3
+ "version": "15.1.2",
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",
@@ -43,7 +43,7 @@
43
43
  "@types/invariant": "^2.2.33",
44
44
  "@types/offscreencanvas": "2019.6.4",
45
45
  "@types/webgl2": "^0.0.6",
46
- "expo-module-scripts": "^4.1.1",
46
+ "expo-module-scripts": "^4.1.2",
47
47
  "react-test-renderer": "19.0.0"
48
48
  },
49
49
  "peerDependencies": {
@@ -57,5 +57,5 @@
57
57
  "optional": true
58
58
  }
59
59
  },
60
- "gitHead": "1914bb35d23af23078da37e70988261844436505"
60
+ "gitHead": "cb9fdd93f76f28e2ace4f66080b2386d87239553"
61
61
  }
package/src/Canvas.tsx CHANGED
@@ -3,7 +3,7 @@ import { findDOMNode } from 'react-dom';
3
3
  import { LayoutChangeEvent, PixelRatio, StyleSheet, View, ViewProps } from 'react-native';
4
4
  import createElement from 'react-native-web/dist/exports/createElement';
5
5
 
6
- function getElement(component) {
6
+ function getElement(component: React.ReactInstance): React.ReactInstance | Element | null | Text {
7
7
  try {
8
8
  return findDOMNode(component);
9
9
  } catch {
@@ -58,7 +58,7 @@ const CanvasWrapper: React.FunctionComponent<
58
58
  return { width: 0, height: 0 };
59
59
  }
60
60
  const element = getElement(ref.current);
61
- const { offsetWidth: width = 0, offsetHeight: height = 0 } = element;
61
+ const { offsetWidth: width = 0, offsetHeight: height = 0 } = element as HTMLElement;
62
62
  return { width, height };
63
63
  }
64
64
 
package/src/GLErrors.ts CHANGED
@@ -1,4 +1,4 @@
1
- export default {
1
+ const GLErrors = {
2
2
  1280: 'INVALID ENUM: An unacceptable value has been specified for an enumerated argument.',
3
3
  1281: 'INVALID_VALUE: A numeric argument is out of range.',
4
4
  1282: 'INVALID_OPERATION: The specified command is not allowed for the current state.',
@@ -6,3 +6,5 @@ export default {
6
6
  1286: 'INVALID_FRAMEBUFFER_OPERATION: The currently bound framebuffer is not complete when trying to render to or to read from it.',
7
7
  37442: 'CONTEXT_LOST_WEBGL: The WebGL context is lost.',
8
8
  };
9
+
10
+ export default GLErrors;
package/src/GLUtils.ts CHANGED
@@ -21,11 +21,13 @@ export function configureLogging(gl: ExpoWebGLRenderingContext): void {
21
21
  return;
22
22
  }
23
23
 
24
+ const __gl = gl as Record<keyof typeof gl | string, any>;
25
+
24
26
  // Turn off logging.
25
27
  if (option === GLLoggingOption.DISABLED || !option) {
26
- Object.entries(gl).forEach(([key, value]) => {
28
+ Object.entries(__gl).forEach(([key, value]) => {
27
29
  if (typeof value === 'function' && value.__logWrapper) {
28
- delete gl[key];
30
+ delete __gl[key];
29
31
  }
30
32
  });
31
33
  loggingOption = option;
@@ -33,20 +35,20 @@ export function configureLogging(gl: ExpoWebGLRenderingContext): void {
33
35
  }
34
36
 
35
37
  // Turn on logging.
36
- Object.entries(Object.getPrototypeOf(gl)).forEach(([key, originalValue]) => {
38
+ Object.entries(Object.getPrototypeOf(__gl)).forEach(([key, originalValue]) => {
37
39
  if (typeof originalValue !== 'function' || key === '__expoSetLogging') {
38
40
  return;
39
41
  }
40
42
 
41
- gl[key] = (...args) => {
43
+ __gl[key] = (...args: any[]) => {
42
44
  if (loggingOption & GLLoggingOption.METHOD_CALLS) {
43
45
  const params = args.map((arg) => {
44
46
  // If the type is `number`, then try to find name of the constant that has such value,
45
47
  // so it's easier to read these logs. In some cases it might be misleading
46
48
  // if the parameter is for example a width or height, so the number is still logged.
47
49
  if (loggingOption & GLLoggingOption.RESOLVE_CONSTANTS && typeof arg === 'number') {
48
- for (const prop in gl) {
49
- if (gl[prop] === arg) {
50
+ for (const prop in __gl) {
51
+ if (__gl[prop] === arg) {
50
52
  return `${arg} (${prop})`;
51
53
  }
52
54
  }
@@ -67,7 +69,7 @@ export function configureLogging(gl: ExpoWebGLRenderingContext): void {
67
69
  console.log(`ExpoGL: ${key}(${params.join(', ')})`);
68
70
  }
69
71
 
70
- const result = originalValue.apply(gl, args);
72
+ const result = originalValue.apply(__gl, args);
71
73
 
72
74
  if (loggingOption & GLLoggingOption.METHOD_CALLS) {
73
75
  console.log(`ExpoGL: = ${result}`);
@@ -75,14 +77,14 @@ export function configureLogging(gl: ExpoWebGLRenderingContext): void {
75
77
  if (loggingOption & GLLoggingOption.GET_ERRORS && key !== 'getError') {
76
78
  // @ts-ignore We need to call into the original `getError`.
77
79
  // eslint-disable-next-line no-proto
78
- const error = gl.__proto__.getError.call(gl);
80
+ const error = __gl.__proto__.getError.call(__gl);
79
81
 
80
- if (error && error !== gl.NO_ERROR) {
82
+ if (error && error !== __gl.NO_ERROR) {
81
83
  // `console.error` would cause a red screen, so let's just log with red color.
82
- console.log(`\x1b[31mExpoGL: Error ${GLErrors[error]}\x1b[0m`);
84
+ console.log(`\x1b[31mExpoGL: Error ${GLErrors[error as keyof typeof GLErrors]}\x1b[0m`);
83
85
  }
84
86
  }
85
- gl[key].__logWrapper = true;
87
+ __gl[key].__logWrapper = true;
86
88
  return result;
87
89
  };
88
90
  });
@@ -71,6 +71,10 @@ export interface ExpoWebGLRenderingContext extends WebGL2RenderingContext {
71
71
  endFrameEXP(): void;
72
72
  flushEXP(): void;
73
73
  __expoSetLogging(option: GLLoggingOption): void;
74
+
75
+ /** @internal */
76
+ _expo_texSubImage2D?(...props: any[]): void;
77
+ _expo_texImage2D?(...props: any[]): void;
74
78
  }
75
79
 
76
80
  // @docsMissing
@@ -99,7 +103,7 @@ export type GLViewProps = {
99
103
  * @hidden
100
104
  * A ref callback for the native GLView
101
105
  */
102
- nativeRef_EXPERIMENTAL?(callback: ComponentOrHandle | null);
106
+ nativeRef_EXPERIMENTAL?(callback: ComponentOrHandle | null): void;
103
107
  } & ViewProps;
104
108
 
105
109
  // @needsAudit
@@ -39,7 +39,7 @@ function asExpoContext(gl: ExpoWebGLRenderingContext): WebGLRenderingContext {
39
39
  gl.texImage2D = (...props: any[]): any => {
40
40
  const nextProps = [...props];
41
41
  nextProps.push(getImageForAsset(nextProps.pop()));
42
- return gl['_expo_texImage2D'](...nextProps);
42
+ return gl['_expo_texImage2D']!(...nextProps);
43
43
  };
44
44
  }
45
45
 
@@ -48,7 +48,7 @@ function asExpoContext(gl: ExpoWebGLRenderingContext): WebGLRenderingContext {
48
48
  gl.texSubImage2D = (...props: any[]): any => {
49
49
  const nextProps = [...props];
50
50
  nextProps.push(getImageForAsset(nextProps.pop()));
51
- return gl['_expo_texSubImage2D'](...nextProps);
51
+ return gl['_expo_texSubImage2D']!(...nextProps);
52
52
  };
53
53
  }
54
54
 
@@ -82,7 +82,7 @@ export type GLViewWebProps = GLViewProps & {
82
82
  onContextLost?: () => void;
83
83
  webglContextAttributes?: WebGLContextAttributes;
84
84
  // type overwrite
85
- nativeRef_EXPERIMENTAL?(callback: ComponentOrHandle | HTMLCanvasElement | null);
85
+ nativeRef_EXPERIMENTAL?(callback: ComponentOrHandle | HTMLCanvasElement | null): unknown;
86
86
  };
87
87
 
88
88
  async function getBlobFromWebGLRenderingContext(
@@ -182,7 +182,7 @@ export class GLView extends React.Component<GLViewWebProps> {
182
182
  return <Canvas {...domProps} canvasRef={this.setCanvasRef} />;
183
183
  }
184
184
 
185
- componentDidUpdate(prevProps) {
185
+ componentDidUpdate(prevProps: GLViewWebProps) {
186
186
  const { webglContextAttributes } = this.props;
187
187
  if (this.canvas && webglContextAttributes !== prevProps.webglContextAttributes) {
188
188
  this.onContextLost(null);
@@ -0,0 +1,3 @@
1
+ declare module 'react-native-web/dist/exports/createElement' {
2
+ export { createElement as default } from 'react';
3
+ }
@@ -1 +0,0 @@
1
- c929f7db323ea4ed4364d299c44fe2ee4a27d39d
@@ -1 +0,0 @@
1
- f1d1b8dd2b85484a2d851be91b00b0ff7c98455a3ea5cd0bf5c2649e310d2bb5
@@ -1 +0,0 @@
1
- 98e275d058da1c0fd707a4b197a86c02aa60c47ee43fc7dd99ccac4d14c8c84920a781a6fde5123ed350924286365a800bec6e7f9b00b81ce1d9de49ac862aa0
@@ -1 +0,0 @@
1
- f529da717072ce0fc13b25711aa5baf2781226fc
@@ -1 +0,0 @@
1
- fa7ceedfb3f81ff53c7c5616dc21ffe4520fafcf1fea55195c0d464b2201aae0
@@ -1 +0,0 @@
1
- 5ea7b5f1874ecda7f874d32ab6623c47a81ffe63bc2dc3b51b519f57375ff8890750b5bb5d8fa6518938f48caa870cbe29ebd0331be3186f5ead123c82e999ce
@@ -1 +0,0 @@
1
- 3af62474b4f5749a739bd96f81e26256252580ff
@@ -1 +0,0 @@
1
- 3065427ccd36c1d43af5686572c05ab926c3dac15804445aa061f0be844aa4ee
@@ -1 +0,0 @@
1
- 668748f250773080b5bddb6f1623b8c615f8c2e784758f23ac10b542ba4830f7f9ce059d5d4bc3454dc6f509fd7c6838e926cd8acae77b6e5be23efedcd38c24