Feature Request: Add getBackendTexture() Method to SkImage for Accessing GPU Texture ID
###Description
I would like to request a new feature in React Native Skia to expose a method on the SkImage object that returns the underlying GPU texture handle (e.g., OpenGL texture ID).
Currently, React Native Skia supports GPU-accelerated rendering and manages textures internally, but it does not expose a direct way to access the backend GL texture from a SkImage in the JavaScript/TypeScript API. This capability would enable advanced use cases such as interop with native OpenGL or Vulkan code, integration with other GPU-based frameworks, or custom GPU operations outside the Skia rendering pipeline.
##Proposed API: const backendTexture = skImage.getBackendTexture(); // returns GL texture ID (number)
##Motivation and Use Cases:
Accessing the GPU texture ID permits efficient zero-copy interoperability with other native GPU APIs.
Useful for complex video or image processing pipelines where sharing texture handles improves performance.
Enables integration scenarios where Skia-rendered content needs to be composited or manipulated with other OpenGL/Vulkan textures.
##Example Use Case - Video Texture Extraction and GPU Interop:
A common use case motivating this feature is extracting GPU texture handles from video frames. React Native Skia already supports loading video frames as SkImages via the useVideo hook, allowing playback and filtering on the Skia canvas. However, without a method like getBackendTexture(), it is challenging to share the decoded video frame texture with native OpenGL code or other 3D rendering libraries for advanced compositing or effects.
For example, on the native modules side or in React Native apps using React Three Fiber or Three.js, this texture handle could be used directly as an OpenGL texture input for 3D shaders or scene objects. This facilitates blending Skia-rendered video output with 3D graphics or custom GPU pipelines efficiently, avoiding costly readbacks or copies.
These values are available :)
image.getNativeTextureUnstable() // return opengl texture info or metal texture
surface.getNativeTextureUnstable() // same
Skia.Image.MakeImageFromNativeTextureUnstable()
check out the related C++ methods. Let me know what you think, I hope this helps.
image.getNativeTextureUnstable() // return opengl texture info or metal texture surface.getNativeTextureUnstable() // same Skia.Image.MakeImageFromNativeTextureUnstable()
hello can you tell me which versions have these api and where to find it in the source code
these are available since v2 I believe. For such advanced features, I recommend using the latest version of RN Skia
On Wed, Sep 17, 2025 at 3:42 PM Atanu Debbarma @.***> wrote:
image.getNativeTextureUnstable() // return opengl texture info or metal texture surface.getNativeTextureUnstable() // same Skia.Image.MakeImageFromNativeTextureUnstable()
hello can you tell me which versions have these api and where to find it in the source code
— Reply to this email directly, view it on GitHub or unsubscribe. You are receiving this email because you commented on the thread.
Triage notifications on the go with GitHub Mobile for iOS or Android.
Thanks