Skip to content

Commit 926f5d3

Browse files
authored
chore(📚): add note about canvas transparency (#289)
1 parent 945421a commit 926f5d3

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

‎README.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,19 @@ device.queue.submit([commandEncoder.finish()]);
185185
context.present();
186186
```
187187

188+
### Canvas Transparency
189+
190+
On Android, the `alphaMode` property is ignored when configuring the canvas.
191+
To have a transparent canvas by default, use the `transparent` property.
192+
193+
```tsx
194+
return (
195+
<View style={style.container}>
196+
<Canvas ref={ref} style={style.webgpu} transparent />
197+
</View>
198+
);
199+
```
200+
188201
### External Textures
189202

190203
This module provides a `createImageBitmap` function that you can use in `copyExternalImageToTexture`.

‎packages/webgpu/README.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,19 @@ device.queue.submit([commandEncoder.finish()]);
185185
context.present();
186186
```
187187

188+
### Canvas Transparency
189+
190+
On Android, the `alphaMode` property is ignored when configuring the canvas.
191+
To have a transparent canvas by default, use the `transparent` property.
192+
193+
```tsx
194+
return (
195+
<View style={style.container}>
196+
<Canvas ref={ref} style={style.webgpu} transparent />
197+
</View>
198+
);
199+
```
200+
188201
### External Textures
189202

190203
This module provides a `createImageBitmap` function that you can use in `copyExternalImageToTexture`.

0 commit comments

Comments
 (0)