Commit c56a9bf6 authored by Igor Demin's avatar Igor Demin

Fix DirectX callback

parent 24cae588
...@@ -5,10 +5,7 @@ import kotlinx.coroutines.swing.Swing ...@@ -5,10 +5,7 @@ import kotlinx.coroutines.swing.Swing
import kotlinx.coroutines.withContext import kotlinx.coroutines.withContext
import org.jetbrains.skia.DirectContext import org.jetbrains.skia.DirectContext
import org.jetbrains.skia.Surface import org.jetbrains.skia.Surface
import org.jetbrains.skiko.FrameDispatcher import org.jetbrains.skiko.*
import org.jetbrains.skiko.GpuPriority
import org.jetbrains.skiko.SkiaLayer
import org.jetbrains.skiko.SkiaLayerProperties
internal class Direct3DRedrawer( internal class Direct3DRedrawer(
private val layer: SkiaLayer, private val layer: SkiaLayer,
...@@ -19,8 +16,8 @@ internal class Direct3DRedrawer( ...@@ -19,8 +16,8 @@ internal class Direct3DRedrawer(
private var drawLock = Any() private var drawLock = Any()
private val device = createDirectXDevice(getAdapterPriority(), layer.contentHandle).also { private val device = createDirectXDevice(getAdapterPriority(), layer.contentHandle).also {
if (it == 0L) { if (it == 0L || !isVideoCardSupported(layer.renderApi)) {
throw Exception("Failed to create DirectX12 device.") throw IllegalArgumentException("Failed to create DirectX12 device.")
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment