How can I get a bitmap as GL texture and get its texture id?

96 views
Skip to first unread message

Duke Dougal

unread,
Nov 29, 2022, 8:37:42 PM11/29/22
to skia-discuss
There appears to be old documentation saying this could be done by creating an SKImage and then getting the texture and then using getTextureId, but as far as I can tell this functionality has been removed from Skia?

I have an application with an SKBitmap.  My goal is to convert this to a GPU texture and get the texture id.

Can anyone suggest how this is done please?

Jim Van Verth

unread,
Nov 30, 2022, 9:51:42 AM11/30/22
to skia-d...@googlegroups.com
You could use MakeBackendTextureFromSkImage to generate a GrBackendTexture object, and then call getGLTextureInfo() on that.

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/1b23a7a4-094d-450b-8bf5-8faaf875587bn%40googlegroups.com.


--

Jim Van Verth | Software Engineer | jvan...@google.com | 919-210-7664

Reply all
Reply to author
Forward
0 new messages