Skip to content

Commit

Permalink
🔧
Browse files Browse the repository at this point in the history
  • Loading branch information
wcandillon committed Oct 25, 2024
1 parent 67c36af commit 5d45d9f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/webgpu/src/Canvas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export type RNCanvasContext = GPUCanvasContext & {
};

export interface CanvasRef {
getContextId: () => number;
getContext(contextName: "webgpu"): RNCanvasContext | null;
getNativeSurface: () => NativeCanvas;
whenReady: (callback: () => void) => void;
Expand Down Expand Up @@ -105,6 +106,7 @@ export const Canvas = forwardRef<
}
}, [size]);
useImperativeHandle(ref, () => ({
getContextId: () => contextId,
getNativeSurface: () => {
if (size === null) {
throw new Error("[WebGPU] Canvas size is not available yet");
Expand Down

0 comments on commit 5d45d9f

Please sign in to comment.