graphx icon indicating copy to clipboard operation
graphx copied to clipboard

Painting text

Open SivaramSS opened this issue 3 years ago • 6 comments

Hi, have you planned any improvements for text rendering. I’m painting >1000 paragraph objects per frame and it’s causing a huge lag.

Apology for raising this as an issue.

SivaramSS avatar Jun 16 '21 23:06 SivaramSS

Thanks for the issue. Not planning any updates currently as i didn't do a stress test with Texts. Would you mind sharing a gist with the sample code?

Did you try creating a Texture out of it?

roipeker avatar Jun 17 '21 00:06 roipeker

Sorry foe late response. I'll share the gist asap. I've tried painting in separate isolates, but getting ui actions are available only on main isolate.

!Did you try creating a Texture out of it? I didn't get this. What do you mean by texture?

SivaramSS avatar Jun 21 '21 08:06 SivaramSS

Create a dart Image (or GTexture) from a GDisplayObject and paint that (or use GBitmap) instead of the text.

roipeker avatar Jun 22 '21 12:06 roipeker

Oh okay. I've tried painting as images, using multiple engines for this purpose. The only way to send images to main isolate is by uint8list. converting bytes back to ui:image takes ~150ms. So i have to show blank screen until image decoding is complete. I need to draw images within 16ms.

SivaramSS avatar Jun 22 '21 12:06 SivaramSS

I think flutter (skia) rendering cant run outside the main thread, therefore graphx wouldn't run either. I don't know what are you trying to do specifically... but you can join our discord or telegram channels if you wanna exchange ideas.

roipeker avatar Jun 22 '21 16:06 roipeker

@roipeker Thank you very much for responding to my queries. I'm eager to join the telegram & discord channels for further discussion.

SivaramSS avatar Jun 23 '21 05:06 SivaramSS