Is skia never going to touch opengl until flush is called?

Skip to first unread message

Red Artist

Jun 8, 2024, 5:40:14 AMJun 8
to skia-discuss
Skia paragraphs are really expensive, so I decided to push the UI work into the background. I will draw those paragraphs to Canvas of GrBackendTexture and then on the main (gl) thread, I will render those textures into the main openGL framebuffer.

So, I was hoping someone could tell me which operations were safe to do on not-opengl-current threads and which skia functions need a current opengl context.

1. Creating a surface out of openGL GrBackendTexture?
2. Using a canvas to draw things to that canvas created out of GrBackendTexture based surface?
3. layout and draw paragraphs into the canvas? ( I remember that skia uses a scratch texture to hold glyphs)
4. draw those GrBackendTexture canvases into a surface backed by GrBackendRenderTarget (main framebuffer).
5. Now, on opengl main thread, I can simply call flush before swapping buffers.

Reply all
Reply to author
0 new messages