https://kotlinlang.org logo
Title
j

jeff

12/26/2021, 7:53 PM
Any way to use compose desktop as something like a Flow<Bitmap> (or something) instead of rendering to screen?
s

sorianog

12/26/2021, 8:42 PM
What are the specifics of what you trying to accomplish?
b

Big Chungus

12/26/2021, 9:18 PM
I think he means instead of rendering a composition to a screen, have it headless and render to
Flow<Bitmap>
instead (basically each render cycle emits a screenshot of the entire app to the flow)
Sample use-case -> stream screen view to remote client
🙌 1
j

jeff

12/26/2021, 9:27 PM
Exactly
b

Big Chungus

12/26/2021, 9:29 PM
That should definitelly be possible, but not available out of the box. This kind of "rendering" would actualy unlock SSR for compose-web, so I'm sure we'll get to it eventually.
One basically needs to get rid of the entire skia rendering part of compose-desktop and replace it with bitmap screenshot rendering
a

Albert Chang

12/27/2021, 2:04 AM
I'm not sure but I don't think we need to get rid of Skia. Pure software rendering is too slow. And Chrome also uses Skia for rendering while still supporting casting web pages through Google Cast.