Nikita Krasnov
04/04/2025, 9:17 AMIvan Matkov
04/04/2025, 9:25 AMThomas
04/09/2025, 9:11 PMjw
04/09/2025, 9:26 PMjw
04/09/2025, 9:27 PMjw
04/09/2025, 9:29 PMjw
04/09/2025, 9:31 PMAlbertas
04/10/2025, 9:12 AMNikita Krasnov
04/10/2025, 10:33 AMI don't really see much point in supporting X11Yea, exactly. I was thinking about specifically targeting Wayland. Preferably making everything modular enough so that someone else can implement X11 themselves if they really need it.
Nikita Krasnov
04/10/2025, 11:28 AMCompose UI is even harder.@jw, could you elaborate on that? I had an impression it is Skiko that implements all the native drawing and event handling logic. After that CMP uses it through a common interface and there is not a lot of extra integration going on. I've seen your talk (great work btw), but I currently need more practical experience with CMP internals to fully understand it.
Nikita Krasnov
04/10/2025, 11:44 AMSkiko requires fundamental build changes to work, since it requires its C++ be built on a system with that OS and architecture, but it's build system is Gradle and KGP doesn't build on Linux ARM. No real movement on that support.Are you talking about the fact that Skiko, when compiled and run on the device, links to certain system libraries? I can certainly see how this would become a problem is we compile for AMD64/x86-64 and then run on arm, sure. But Skiko already has a support for native iOS, which is arm (cross-compilation, I assume?). We should be able to do the same for Linux, shouldn't we?
jw
04/10/2025, 2:00 PMNikita Krasnov
04/10/2025, 2:08 PMjw
04/10/2025, 2:09 PMjw
04/10/2025, 2:16 PMIvan Matkov
04/10/2025, 2:22 PMThe use of expect/actual instead of polymorphism means that it assumes there is only a single, canonical UI toolkit for each build target and that's simply not true for Linux.💯 Trying to change this internally (not only because of linux), but it's not so easy
Nikita Krasnov
04/10/2025, 2:24 PMlinuxMain
then? I assume it is only a stub now?jw
04/10/2025, 2:28 PMNikita Krasnov
04/10/2025, 2:35 PMxxxMain
source sets are responsible for UI? Where can I see the runtime?Ivan Matkov
04/10/2025, 2:36 PMjw
04/10/2025, 2:41 PMlinuxMain
are legacy stuff from when Skiko abstracted over window toolkits. Thankfully most of that has moved up into Compose UI, and Skiko has slimmed down mostly into a Skia MPP abstraction.
For Linux, all the interesting bits are ready to go in the nativeJsMain
source set which serves all native targets.jw
04/10/2025, 2:44 PMjw
04/10/2025, 2:50 PMNikita Krasnov
04/10/2025, 2:54 PMIvan Matkov
04/10/2025, 3:07 PMSkiko is just bindings over C++ Skia and is only responsible for drawing primitives on the screen.*to some surface. skiko also adds some logic for creating GPU context for skia.
The actual window management and event management happens in Compose UIwell, for now it just delegates it to AWT/Swing
aka the compose-multiplatform-coreIt's fork of monorepo, it contains MUCH more
Window management and event system does not exist yet*the binding between platform events and compose ones for linux doesn't exist
And Skiko works on Linux, but does not yet have a "proper" cross-compilation support from the build systemwith JNI bindings for JVM - yes. Not sure about the status for K/N bridge there. I also doubt that it already has some code to init GPU context, but probably some code might be reused from JNI variant
Ivan Matkov
04/10/2025, 3:09 PMbut foundation and up (ui, material, etc.)ui is under foundation, but both are depends on skiko and do not support linux/native, correct
jw
04/10/2025, 3:17 PMNikita Krasnov
04/11/2025, 11:29 AMcompose/foundation
and compose/ui
?
2. How does iOS handle rendering? I assume it creates some native surface that Skia knows how to draw on?
3. How does iOS handle events? In Compose, who reads and processes such events?Nikita Krasnov
04/11/2025, 11:37 AMIvan Matkov
04/11/2025, 11:42 AMOr does Skia/Skiko draw in some internal buffer and then copy its contents to an external surface?There is some cases where it happens, but in general it draws directly into GPU surface
Nikita Krasnov
04/11/2025, 12:25 PMIvan Matkov
04/11/2025, 2:31 PMWayland surface and pass it to Skia?I guess it should be OpenGL context or fallback to skia software renderer if not supported
Could you also please show me where iOS creates its Metal view to then pass it to Skia?tbh, iOS/Metal is too far from what you need to use it as example
Nikita Krasnov
04/11/2025, 2:53 PMIvan Matkov
04/11/2025, 3:00 PMIt's the only native CMP target.Not really. Compose unofficially supports macOS/Native I guess you can unroll the chain from ComposeWindow.macos.kt
Do you mean that skia accepts an OpenGL context as a surface to draw on?Yes
And what is "skia software renderer"?Skia supports drawing via directx/opengl/vulcan/metal and software. So you can generate some png for example without touching GPU. See skia docs: https://skia.org/docs/user/api/skcanvas_creation/#raster On JVM/Desktop skiko as a chain of fallbacks for each platform so if something is not supported it end up with software renderer (slow cpu way)
Thomas
04/12/2025, 5:39 PMThomas
04/12/2025, 5:57 PMThomas
04/12/2025, 6:20 PMjw
04/12/2025, 6:28 PMThomas
04/12/2025, 6:38 PMjw
04/12/2025, 6:56 PMThomas
04/12/2025, 7:06 PMThomas
04/14/2025, 7:28 PMThomas
04/14/2025, 7:47 PMorg.jetbrains.compose.material:material-icons-core
? It is not currently available for Linux, and with no source code I cannot add the Linux target.jw
04/14/2025, 7:54 PMjw
04/14/2025, 8:02 PMThomas
04/14/2025, 8:05 PMIvan Matkov
04/17/2025, 8:50 AMNikita Krasnov
04/30/2025, 12:16 PMUnresolved reference: platform
in import platform.AppKit
or import platform.darwin
. How do I resolve it? Where is this import coming from?Nikita Krasnov
04/30/2025, 12:32 PMThomas
04/30/2025, 5:14 PMNikita Krasnov
05/01/2025, 10:59 AMskiko/samples/SkiaLinuxSample
to try and draw at leas something natively. I was using other samples as examples an noticed an invalid import.Nikita Krasnov
05/01/2025, 10:59 AMThomas
05/01/2025, 11:15 AMThomas
05/01/2025, 11:16 AMcontext = DirectContext.makeEGL()
private fun draw() {
if (canvas == null) {
renderTarget = BackendRenderTarget.makeGL(
width = width,
height = height,
sampleCnt = 0,
stencilBits = 8,
fbId = 0,
fbFormat = FramebufferFormat.GR_GL_RGBA8,
)
surface = Surface.makeFromBackendRenderTarget(
context,
renderTarget!!,
SurfaceOrigin.BOTTOM_LEFT,
SurfaceColorFormat.RGBA_8888,
ColorSpace.sRGB,
SurfaceProps(),
)!!
canvas = surface!!.canvas
}
canvas!!.clear(Color.BLACK)
scene.render(canvas!!.asComposeCanvas(), currentNanoTime())
context.flush()
surface!!.flushAndSubmit()
}
Thomas
05/01/2025, 11:16 AMThomas
05/01/2025, 11:18 AM