Skip to content
Discussion options

You must be logged in to vote

We support gpu accelerated offscreen rendering but we don't have a public API for it yet.
Here are some relevant code snippets: https://github.com/Shopify/react-native-skia/blob/250cf9964fe2724961d09d2050554bc2361f3a45/package/src/renderer/__tests__/e2e/Offscreen.spec.tsx
Here is an example you could play with:

const offscreen = Skia.Surface.MakeOffscreen(ctx.width, ctx.height);
if (!offscreen) {
 throw new Error("Couldn't load the image");
}
const canvas = offscreen.getCanvas();
canvas.drawImage(....) // draw your image
// Draw
offscreen.flush();
// Get the image
offscreen.makeImageSnapshot()

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@RinatRezyapov
Comment options

@RinatRezyapov
Comment options

@hungtooc
Comment options

@wcandillon
Comment options

@stemyke
Comment options

Answer selected by hungtooc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants