expo-gl 16.0.9-canary-20251205-a1dedc6 → 16.0.9-canary-20251210-1f163e3
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 +3 -0
- package/README.md +1 -1
- package/android/build.gradle +2 -2
- package/build/Canvas.js +3 -3
- package/build/Canvas.js.map +1 -1
- package/build/GLView.web.d.ts +0 -1
- package/build/GLView.web.d.ts.map +1 -1
- package/build/GLView.web.js +0 -3
- package/build/GLView.web.js.map +1 -1
- package/common/EXGLImageUtils.cpp +0 -1
- package/expo-module.config.json +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/16.0.9-canary-20251210-1f163e3/expo.modules.gl-16.0.9-canary-20251210-1f163e3.aar +0 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/16.0.9-canary-20251210-1f163e3/expo.modules.gl-16.0.9-canary-20251210-1f163e3.aar.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/16.0.9-canary-20251210-1f163e3/expo.modules.gl-16.0.9-canary-20251210-1f163e3.aar.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/16.0.9-canary-20251210-1f163e3/expo.modules.gl-16.0.9-canary-20251210-1f163e3.aar.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/16.0.9-canary-20251210-1f163e3/expo.modules.gl-16.0.9-canary-20251210-1f163e3.aar.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/{16.0.9-canary-20251205-a1dedc6/expo.modules.gl-16.0.9-canary-20251205-a1dedc6.module → 16.0.9-canary-20251210-1f163e3/expo.modules.gl-16.0.9-canary-20251210-1f163e3.module} +17 -17
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/16.0.9-canary-20251210-1f163e3/expo.modules.gl-16.0.9-canary-20251210-1f163e3.module.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/16.0.9-canary-20251210-1f163e3/expo.modules.gl-16.0.9-canary-20251210-1f163e3.module.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/16.0.9-canary-20251210-1f163e3/expo.modules.gl-16.0.9-canary-20251210-1f163e3.module.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/16.0.9-canary-20251210-1f163e3/expo.modules.gl-16.0.9-canary-20251210-1f163e3.module.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/{16.0.9-canary-20251205-a1dedc6/expo.modules.gl-16.0.9-canary-20251205-a1dedc6.pom → 16.0.9-canary-20251210-1f163e3/expo.modules.gl-16.0.9-canary-20251210-1f163e3.pom} +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/16.0.9-canary-20251210-1f163e3/expo.modules.gl-16.0.9-canary-20251210-1f163e3.pom.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/16.0.9-canary-20251210-1f163e3/expo.modules.gl-16.0.9-canary-20251210-1f163e3.pom.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/16.0.9-canary-20251210-1f163e3/expo.modules.gl-16.0.9-canary-20251210-1f163e3.pom.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/16.0.9-canary-20251210-1f163e3/expo.modules.gl-16.0.9-canary-20251210-1f163e3.pom.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/maven-metadata.xml +4 -4
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/maven-metadata.xml.md5 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/maven-metadata.xml.sha1 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/maven-metadata.xml.sha256 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/maven-metadata.xml.sha512 +1 -1
- package/package.json +3 -3
- package/src/Canvas.tsx +3 -3
- package/src/GLView.web.tsx +0 -4
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/16.0.9-canary-20251205-a1dedc6/expo.modules.gl-16.0.9-canary-20251205-a1dedc6.aar +0 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/16.0.9-canary-20251205-a1dedc6/expo.modules.gl-16.0.9-canary-20251205-a1dedc6.aar.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/16.0.9-canary-20251205-a1dedc6/expo.modules.gl-16.0.9-canary-20251205-a1dedc6.aar.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/16.0.9-canary-20251205-a1dedc6/expo.modules.gl-16.0.9-canary-20251205-a1dedc6.aar.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/16.0.9-canary-20251205-a1dedc6/expo.modules.gl-16.0.9-canary-20251205-a1dedc6.aar.sha512 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/16.0.9-canary-20251205-a1dedc6/expo.modules.gl-16.0.9-canary-20251205-a1dedc6.module.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/16.0.9-canary-20251205-a1dedc6/expo.modules.gl-16.0.9-canary-20251205-a1dedc6.module.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/16.0.9-canary-20251205-a1dedc6/expo.modules.gl-16.0.9-canary-20251205-a1dedc6.module.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/16.0.9-canary-20251205-a1dedc6/expo.modules.gl-16.0.9-canary-20251205-a1dedc6.module.sha512 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/16.0.9-canary-20251205-a1dedc6/expo.modules.gl-16.0.9-canary-20251205-a1dedc6.pom.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/16.0.9-canary-20251205-a1dedc6/expo.modules.gl-16.0.9-canary-20251205-a1dedc6.pom.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/16.0.9-canary-20251205-a1dedc6/expo.modules.gl-16.0.9-canary-20251205-a1dedc6.pom.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/16.0.9-canary-20251205-a1dedc6/expo.modules.gl-16.0.9-canary-20251205-a1dedc6.pom.sha512 +0 -1
- /package/local-maven-repo/host/exp/exponent/expo.modules.gl/{16.0.9-canary-20251205-a1dedc6/expo.modules.gl-16.0.9-canary-20251205-a1dedc6-sources.jar → 16.0.9-canary-20251210-1f163e3/expo.modules.gl-16.0.9-canary-20251210-1f163e3-sources.jar} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.gl/{16.0.9-canary-20251205-a1dedc6/expo.modules.gl-16.0.9-canary-20251205-a1dedc6-sources.jar.md5 → 16.0.9-canary-20251210-1f163e3/expo.modules.gl-16.0.9-canary-20251210-1f163e3-sources.jar.md5} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.gl/{16.0.9-canary-20251205-a1dedc6/expo.modules.gl-16.0.9-canary-20251205-a1dedc6-sources.jar.sha1 → 16.0.9-canary-20251210-1f163e3/expo.modules.gl-16.0.9-canary-20251210-1f163e3-sources.jar.sha1} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.gl/{16.0.9-canary-20251205-a1dedc6/expo.modules.gl-16.0.9-canary-20251205-a1dedc6-sources.jar.sha256 → 16.0.9-canary-20251210-1f163e3/expo.modules.gl-16.0.9-canary-20251210-1f163e3-sources.jar.sha256} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.gl/{16.0.9-canary-20251205-a1dedc6/expo.modules.gl-16.0.9-canary-20251205-a1dedc6-sources.jar.sha512 → 16.0.9-canary-20251210-1f163e3/expo.modules.gl-16.0.9-canary-20251210-1f163e3-sources.jar.sha512} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
|
|
9
9
|
### 🐛 Bug fixes
|
|
10
10
|
|
|
11
|
+
- Fix race condition bug for **web** env for `onLayout` callback. ([#41460](https://github.com/expo/expo/pull/41460) by [@psnet](https://github.com/psnet))
|
|
12
|
+
|
|
11
13
|
### 💡 Others
|
|
12
14
|
|
|
13
15
|
- Methods of the legacy `EXGLObjectManager` module are now exported from the existing native module in Swift. ([#41171](https://github.com/expo/expo/pull/41171) by [@tsapeta](https://github.com/tsapeta))
|
|
@@ -15,6 +17,7 @@
|
|
|
15
17
|
|
|
16
18
|
### ⚠️ Notices
|
|
17
19
|
|
|
20
|
+
- **Performance optimization**: remove support of **GIF** image format in image decoding in `texImage2D` expo wrapper. ([#41499](https://github.com/expo/expo/pull/41499) by [@psnet](https://github.com/psnet))
|
|
18
21
|
- **Performance optimization**: reduce supported old image formats in lib `stb_image.h` used for image decoding in `texImage2D` expo wrapper to support only **JPEG, PNG, GIF** image formats. Formats **BMP, PSD, TGA, HDR, PIC, PNM** are no longer supported. ([#41001](https://github.com/expo/expo/pull/41001) by [@psnet](https://github.com/psnet))
|
|
19
22
|
- Updated library `stb_image.h` used for image decoding in `texImage2D` expo wraper method. A lot of fixes and performance improvements, see related PR. ([#41000](https://github.com/expo/expo/pull/41000) by [@psnet](https://github.com/psnet))
|
|
20
23
|
- Added support for React Native 0.82.x. ([#39678](https://github.com/expo/expo/pull/39678) by [@gabrieldonadel](https://github.com/gabrieldonadel))
|
package/README.md
CHANGED
|
@@ -55,4 +55,4 @@ Run `npx pod-install` after installing the npm package.
|
|
|
55
55
|
|
|
56
56
|
# Contributing
|
|
57
57
|
|
|
58
|
-
Contributions are very welcome! Please refer to guidelines described in the [contributing guide](https://github.com/expo/expo
|
|
58
|
+
Contributions are very welcome! Please refer to guidelines described in the [contributing guide](https://github.com/expo/expo/blob/main/CONTRIBUTING.md).
|
package/android/build.gradle
CHANGED
|
@@ -9,7 +9,7 @@ def reactNativeArchitectures() {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
group = 'host.exp.exponent'
|
|
12
|
-
version = '16.0.9-canary-
|
|
12
|
+
version = '16.0.9-canary-20251210-1f163e3'
|
|
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 "16.0.9-canary-
|
|
25
|
+
versionName "16.0.9-canary-20251210-1f163e3"
|
|
26
26
|
|
|
27
27
|
externalNativeBuild {
|
|
28
28
|
cmake {
|
package/build/Canvas.js
CHANGED
|
@@ -46,9 +46,9 @@ const CanvasWrapper = ({ pointerEvents, children, style, ...props }) => {
|
|
|
46
46
|
const { nativeEvent: { layout: { width, height }, }, } = event;
|
|
47
47
|
if (width !== size?.width || height !== size?.height) {
|
|
48
48
|
setSize({ width, height });
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
}
|
|
50
|
+
if (props.onLayout) {
|
|
51
|
+
props.onLayout(event);
|
|
52
52
|
}
|
|
53
53
|
}, [size?.width, size?.height, props.onLayout]);
|
|
54
54
|
React.useEffect(() => {
|
package/build/Canvas.js.map
CHANGED
|
@@ -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,EAAqB,UAAU,EAAE,UAAU,EAAE,IAAI,EAAa,MAAM,cAAc,CAAC;AAC1F,OAAO,aAAa,MAAM,6CAA6C,CAAC;AAYxE,SAAS,MAAM,CAAI,OAAqB,EAAE,GAAa;IACrD,IAAI,CAAC,OAAO;QAAE,OAAO;IAErB,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE,CAAC;QAClC,OAAO,CAAC,GAAG,CAAC,CAAC;IACf,CAAC;SAAM,IAAI,SAAS,IAAI,OAAO,EAAE,CAAC;QAChC,aAAa;QACb,OAAO,CAAC,OAAO,GAAG,GAAG,CAAC;IACxB,CAAC;AACH,CAAC;AAED,SAAS,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AK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,gBAAgB,EAAE,CAAC;IACrB,CAAC,EAAE,CAAC,IAAI,CAAC,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,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,YAAY,EAAE,EAAE,aAAa,EAAE,CAAC,CAAC,EAC7E;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 { LayoutChangeEvent, PixelRatio, StyleSheet, View, ViewProps } from 'react-native';\nimport createElement from 'react-native-web/dist/exports/createElement';\n\ninterface Size {\n width: number;\n height: number;\n}\n\ninterface GetSizeParams {\n size: Size | null;\n ref: React.RefObject<View | null>;\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\nfunction getSize({ size, ref }: GetSizeParams): Size {\n if (size) {\n return size;\n } else if (!ref.current || typeof window === 'undefined') {\n return { width: 0, height: 0 };\n }\n const element = ref.current as unknown as HTMLElement;\n const { offsetWidth: width = 0, offsetHeight: height = 0 } = element;\n return { width, height };\n}\n\nconst Canvas = (\n props: React.ComponentProps<typeof View> & {\n ref?: React.Ref<HTMLCanvasElement>;\n }\n) => createElement('canvas', props);\n\nconst CanvasWrapper: React.FunctionComponent<\n ViewProps & {\n canvasRef: React.Ref<HTMLCanvasElement>;\n }\n> = ({ pointerEvents, children, style, ...props }) => {\n const [size, setSize] = React.useState<Size | null>(null);\n\n const ref = React.useRef<View>(null);\n const _canvasRef = React.useRef<HTMLCanvasElement>(null);\n\n const updateCanvasSize = React.useCallback(() => {\n const canvas = _canvasRef.current;\n if (typeof HTMLCanvasElement !== 'undefined' && canvas instanceof HTMLCanvasElement) {\n const currentSize = getSize({\n size,\n ref,\n });\n const scale = PixelRatio.get();\n\n canvas.style.width = `${currentSize.width}px`;\n canvas.style.height = `${currentSize.height}px`;\n\n canvas.width = currentSize.width * scale;\n canvas.height = currentSize.height * scale;\n }\n }, [size?.width, size?.height]);\n\n const onLayout = React.useCallback(\n (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\n if (props.onLayout) {\n props.onLayout(event);\n }\n },\n [size?.width, size?.height, props.onLayout]\n );\n\n React.useEffect(() => {\n if (ref.current != null) {\n setSize(getSize({ size, ref }));\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} style={[StyleSheet.absoluteFill, { pointerEvents }]} />\n {children}\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n wrapper: {\n pointerEvents: 'box-none',\n },\n});\n\nexport default CanvasWrapper;\n"]}
|
package/build/GLView.web.d.ts
CHANGED
|
@@ -23,7 +23,6 @@ export declare class GLView extends React.Component<GLViewWebProps> {
|
|
|
23
23
|
private getGLContext;
|
|
24
24
|
private setCanvasRef;
|
|
25
25
|
takeSnapshotAsync(options?: SnapshotOptions): Promise<GLSnapshot>;
|
|
26
|
-
startARSessionAsync(): Promise<void>;
|
|
27
26
|
createCameraTextureAsync(): Promise<void>;
|
|
28
27
|
destroyObjectAsync(glObject: WebGLObject): Promise<void>;
|
|
29
28
|
}
|
|
@@ -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,GAAG,OAAO,CAAC;CAC1F,CAAC;AA8BF,qBAAa,MAAO,SAAQ,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC;IACzD,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAE3B,EAAE,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AK,CAAC,SAAS,CAAC,cAAc,CAAC;IACzD,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAE3B,EAAE,CAAC,EAAE,qBAAqB,CAAC;WAEd,kBAAkB,IAAI,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC;WAW3D,mBAAmB,CAAC,IAAI,CAAC,EAAE,qBAAqB,GAAG,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;WAK5E,iBAAiB,CAC5B,EAAE,EAAE,qBAAqB,EACzB,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,UAAU,CAAC;IAetB,oBAAoB;IAcpB,MAAM;IAgBN,kBAAkB,CAAC,SAAS,EAAE,cAAc;IAQ5C,OAAO,CAAC,oBAAoB;IAW5B,OAAO,CAAC,aAAa,CASnB;IAEF,OAAO,CAAC,iBAAiB,CAKvB;IAEF,OAAO,CAAC,YAAY;IAapB,OAAO,CAAC,YAAY,CAalB;IAEW,iBAAiB,CAAC,OAAO,GAAE,eAAoB,GAAG,OAAO,CAAC,UAAU,CAAC;IASrE,wBAAwB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIzC,kBAAkB,CAAC,QAAQ,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAGtE"}
|
package/build/GLView.web.js
CHANGED
|
@@ -175,9 +175,6 @@ export class GLView extends React.Component {
|
|
|
175
175
|
const gl = this.getGLContextOrReject();
|
|
176
176
|
return await GLView.takeSnapshotAsync(gl, options);
|
|
177
177
|
}
|
|
178
|
-
async startARSessionAsync() {
|
|
179
|
-
throw new UnavailabilityError('GLView', 'startARSessionAsync');
|
|
180
|
-
}
|
|
181
178
|
async createCameraTextureAsync() {
|
|
182
179
|
throw new UnavailabilityError('GLView', 'createCameraTextureAsync');
|
|
183
180
|
}
|
package/build/GLView.web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GLView.web.js","sourceRoot":"","sources":["../src/GLView.web.tsx"],"names":[],"mappings":"AAAA,O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CAAC;IAEM,KAAK,CAAC,mBAAmB;QAC9B,MAAM,IAAI,mBAAmB,CAAC,QAAQ,EAAE,qBAAqB,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): 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"]}
|
|
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,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availabilityError } 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 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"]}
|
package/expo-module.config.json
CHANGED
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
bab52ec465ce78611f9de353ed5a09b6
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
09a064ca3310bc0bbdf62769c19cd78eeda0570a
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
7f4b4884197301ff6c2e3b312f3ff87133e318892e9aa26e9adbd06c1f75df46
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
49402e20958a1f2e59c6922e8fea2d39df073102827f2c440f6b6793b71153a48420d08512fa2024f802ea359237f6674cf7f551f1892e25b3c79e39acd256a4
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"component": {
|
|
4
4
|
"group": "host.exp.exponent",
|
|
5
5
|
"module": "expo.modules.gl",
|
|
6
|
-
"version": "16.0.9-canary-
|
|
6
|
+
"version": "16.0.9-canary-20251210-1f163e3",
|
|
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-16.0.9-canary-
|
|
28
|
-
"url": "expo.modules.gl-16.0.9-canary-
|
|
29
|
-
"size":
|
|
30
|
-
"sha512": "
|
|
31
|
-
"sha256": "
|
|
32
|
-
"sha1": "
|
|
33
|
-
"md5": "
|
|
27
|
+
"name": "expo.modules.gl-16.0.9-canary-20251210-1f163e3.aar",
|
|
28
|
+
"url": "expo.modules.gl-16.0.9-canary-20251210-1f163e3.aar",
|
|
29
|
+
"size": 981245,
|
|
30
|
+
"sha512": "49402e20958a1f2e59c6922e8fea2d39df073102827f2c440f6b6793b71153a48420d08512fa2024f802ea359237f6674cf7f551f1892e25b3c79e39acd256a4",
|
|
31
|
+
"sha256": "7f4b4884197301ff6c2e3b312f3ff87133e318892e9aa26e9adbd06c1f75df46",
|
|
32
|
+
"sha1": "09a064ca3310bc0bbdf62769c19cd78eeda0570a",
|
|
33
|
+
"md5": "bab52ec465ce78611f9de353ed5a09b6"
|
|
34
34
|
}
|
|
35
35
|
]
|
|
36
36
|
},
|
|
@@ -53,13 +53,13 @@
|
|
|
53
53
|
],
|
|
54
54
|
"files": [
|
|
55
55
|
{
|
|
56
|
-
"name": "expo.modules.gl-16.0.9-canary-
|
|
57
|
-
"url": "expo.modules.gl-16.0.9-canary-
|
|
58
|
-
"size":
|
|
59
|
-
"sha512": "
|
|
60
|
-
"sha256": "
|
|
61
|
-
"sha1": "
|
|
62
|
-
"md5": "
|
|
56
|
+
"name": "expo.modules.gl-16.0.9-canary-20251210-1f163e3.aar",
|
|
57
|
+
"url": "expo.modules.gl-16.0.9-canary-20251210-1f163e3.aar",
|
|
58
|
+
"size": 981245,
|
|
59
|
+
"sha512": "49402e20958a1f2e59c6922e8fea2d39df073102827f2c440f6b6793b71153a48420d08512fa2024f802ea359237f6674cf7f551f1892e25b3c79e39acd256a4",
|
|
60
|
+
"sha256": "7f4b4884197301ff6c2e3b312f3ff87133e318892e9aa26e9adbd06c1f75df46",
|
|
61
|
+
"sha1": "09a064ca3310bc0bbdf62769c19cd78eeda0570a",
|
|
62
|
+
"md5": "bab52ec465ce78611f9de353ed5a09b6"
|
|
63
63
|
}
|
|
64
64
|
]
|
|
65
65
|
},
|
|
@@ -73,8 +73,8 @@
|
|
|
73
73
|
},
|
|
74
74
|
"files": [
|
|
75
75
|
{
|
|
76
|
-
"name": "expo.modules.gl-16.0.9-canary-
|
|
77
|
-
"url": "expo.modules.gl-16.0.9-canary-
|
|
76
|
+
"name": "expo.modules.gl-16.0.9-canary-20251210-1f163e3-sources.jar",
|
|
77
|
+
"url": "expo.modules.gl-16.0.9-canary-20251210-1f163e3-sources.jar",
|
|
78
78
|
"size": 12052,
|
|
79
79
|
"sha512": "11a34a55c37c76b33f3931b9caa588e4d4ac4c204f943b6bc46580a3587fd782a3c1814ad275da5a086860e42b60cdf7de12d16eb835d14ecef8bedd4e0a1209",
|
|
80
80
|
"sha256": "34258c1facd47505795431b582b01ae721e99682f193a8029e6d33b419247f80",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2d6175855d9969a45702dad5ea8792e4
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
d2f927ad08c99c36b21c913e5bb0fdd644f72aee
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
fb91acb185396260c8853bbb4f96a3f7436f66889da29e5265fb0a9bb5910025
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0d7af4dbc3d2d33f48fcc1d5d6d6f6da1bc4e8782d659a6ac0965f8054e400073f9812f2324eb24075c347cd09ebaf7421767731fceef45bca91b22e878d2069
|
|
@@ -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>16.0.9-canary-
|
|
12
|
+
<version>16.0.9-canary-20251210-1f163e3</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
|
+
c363a7ce0809d074484c4b104ecafbc5
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
9449e48ded4153bca62d2fab6c6f21cbd69ee5cb
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1df3ff83bd08223476d2bd8ca5baebdb81a634d36394b9add30033e90443b466
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1ca69a93b909209c72092af10ece771c41f311c62fe608245aacc6405197b94327ec784f4f660d498482ef69cfca1efe36caa6d03daae1359a87478eb16a049d
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
<groupId>host.exp.exponent</groupId>
|
|
4
4
|
<artifactId>expo.modules.gl</artifactId>
|
|
5
5
|
<versioning>
|
|
6
|
-
<latest>16.0.9-canary-
|
|
7
|
-
<release>16.0.9-canary-
|
|
6
|
+
<latest>16.0.9-canary-20251210-1f163e3</latest>
|
|
7
|
+
<release>16.0.9-canary-20251210-1f163e3</release>
|
|
8
8
|
<versions>
|
|
9
|
-
<version>16.0.9-canary-
|
|
9
|
+
<version>16.0.9-canary-20251210-1f163e3</version>
|
|
10
10
|
</versions>
|
|
11
|
-
<lastUpdated>
|
|
11
|
+
<lastUpdated>20251210173501</lastUpdated>
|
|
12
12
|
</versioning>
|
|
13
13
|
</metadata>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
2fc99c69361fcf7827e8d6287f76240f
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
5abf74449801f83e765e5f11b884933f7358d5d9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
baaa7235c31dece632a105532b1c24692b4c261b66a8db1a9cbc038be8ddc6e1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
667501214bbcfe417657423616212c43bf7ea0a8394a93912d2c4c1abee15e0008dec34d7d1c50cc3bce77ecb25278be920957de4be6fdf5d8f0fd341c0a0d9d
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-gl",
|
|
3
|
-
"version": "16.0.9-canary-
|
|
3
|
+
"version": "16.0.9-canary-20251210-1f163e3",
|
|
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,11 +43,11 @@
|
|
|
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": "5.1.0-canary-
|
|
46
|
+
"expo-module-scripts": "5.1.0-canary-20251210-1f163e3",
|
|
47
47
|
"react-test-renderer": "19.2.0"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"expo": "55.0.0-canary-
|
|
50
|
+
"expo": "55.0.0-canary-20251210-1f163e3",
|
|
51
51
|
"react": "*",
|
|
52
52
|
"react-dom": "*",
|
|
53
53
|
"react-native": "*",
|
package/src/Canvas.tsx
CHANGED
|
@@ -77,10 +77,10 @@ const CanvasWrapper: React.FunctionComponent<
|
|
|
77
77
|
|
|
78
78
|
if (width !== size?.width || height !== size?.height) {
|
|
79
79
|
setSize({ width, height });
|
|
80
|
+
}
|
|
80
81
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
82
|
+
if (props.onLayout) {
|
|
83
|
+
props.onLayout(event);
|
|
84
84
|
}
|
|
85
85
|
},
|
|
86
86
|
[size?.width, size?.height, props.onLayout]
|
package/src/GLView.web.tsx
CHANGED
|
@@ -256,10 +256,6 @@ export class GLView extends React.Component<GLViewWebProps> {
|
|
|
256
256
|
return await GLView.takeSnapshotAsync(gl, options);
|
|
257
257
|
}
|
|
258
258
|
|
|
259
|
-
public async startARSessionAsync(): Promise<void> {
|
|
260
|
-
throw new UnavailabilityError('GLView', 'startARSessionAsync');
|
|
261
|
-
}
|
|
262
|
-
|
|
263
259
|
public async createCameraTextureAsync(): Promise<void> {
|
|
264
260
|
throw new UnavailabilityError('GLView', 'createCameraTextureAsync');
|
|
265
261
|
}
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
030a58aff45d1740eb41f56e569a9806
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
2f331e219ec204579952bc6043f67e7c370f9197
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
372b2930b67b4385c1eeb83db8436cc75ab00e4a0ce74cae8d43dd49efffa763
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
75c8b2cad3bcaa2e816e61cbe9ca6ec1ad542ede80d786db4abee8fd08d350ac7be3e942a96b05907735912864f263ccc3550cd211ad77f6d151e17180230aea
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
8e9da3904a48e198dab1bf5931b1c718
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
2499ae555209977b267f65186a7675c540330283
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
c5f553c62d23420d417928c390c96bc1e9a5fd388a80e49defc8554fb57c3692
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ea146b6620c03906d1ce1f4fc34b4173af00826346b56124d6bf13aed09fc0672062fdbd5983eb333455289ab9e768407d2952ed6f21316c37521b6c17839380
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
dbfface30326adae5cd6ea63dc328957
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1028d7d9bc74b6c1ed5a59e1b9a4b40254b16fc9
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
482a04ee1cf86b4d316f498189d58ef64d17843c6cc91e10250ec8c0be2f50ff
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
fa13b48e700b34918c624fc3507d8df023e64d78de05b79b1b625ffe381a185aad59894ce333e3fc4f54aea03a58d953843c920adac4cc1418ce129f38999b02
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|