Skip to content

Commit 2df5ba9

Browse files
committed
fixup! Add support for EGL
1 parent 583eabe commit 2df5ba9

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

skiko/src/commonTest/kotlin/org/jetbrains/skia/SurfaceTest.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ package org.jetbrains.skia
22

33
import org.jetbrains.skia.impl.interopScope
44
import org.jetbrains.skia.impl.use
5+
import org.jetbrains.skiko.Arch
56
import org.jetbrains.skiko.KotlinBackend
67
import org.jetbrains.skiko.OS
8+
import org.jetbrains.skiko.hostArch
79
import org.jetbrains.skiko.hostOs
810
import org.jetbrains.skiko.kotlinBackend
911
import org.jetbrains.skiko.tests.TestGlContext
@@ -115,7 +117,12 @@ class SurfaceTest {
115117
}
116118

117119
val pixels = TestGlContext.run {
118-
DirectContext.makeGL().useContext { ctx ->
120+
val ctx = when (hostArch) {
121+
Arch.X64 -> DirectContext.makeGL()
122+
Arch.Arm64 -> DirectContext.makeEGL()
123+
else -> error("Unsupported arch: $hostArch")
124+
}
125+
ctx.useContext {
119126
val imageInfo = ImageInfo.makeN32Premul(16, 16)
120127
val surface = Surface.makeRenderTarget(ctx, budgeted = false, imageInfo)
121128

0 commit comments

Comments
 (0)