Commit 21f890db authored by Roman Sedaikin's avatar Roman Sedaikin

Removed unnecessary draw method and resizeBuffers.

parent b3af6583
......@@ -45,7 +45,7 @@ open class SkiaLayer(
contextHandler = createContextHandler(this, initialRenderApi)
redrawer = platformOperations.createRedrawer(this, initialRenderApi, properties)
redrawer?.syncSize()
draw(isBlank = true)
redrawer?.redrawImmediately()
}
override fun dispose() {
......@@ -109,26 +109,22 @@ open class SkiaLayer(
}
}
override fun draw() = draw(isBlank = false)
fun draw(isBlank: Boolean) {
override fun draw() {
check(!isDisposed)
contextHandler?.apply {
if (!initContext()) {
fallbackToNextApi()
return
}
if (!isBlank) {
initCanvas()
clearCanvas()
synchronized(pictureLock) {
val picture = picture
if (picture != null) {
drawOnCanvas(picture.instance)
}
initCanvas()
clearCanvas()
synchronized(pictureLock) {
val picture = picture
if (picture != null) {
drawOnCanvas(picture.instance)
}
flush()
}
flush()
}
}
......
......@@ -24,10 +24,6 @@ internal class Direct3DContextHandler(layer: SkiaLayer) : ContextHandler(layer)
if (device == 0L) {
throw Exception("Failed to create DirectX12 device.")
}
val scale = layer.contentScale
val w = (layer.width * scale).toInt().coerceAtLeast(0)
val h = (layer.height * scale).toInt().coerceAtLeast(0)
directXRedrawer.resizeBuffers(device, w, h)
context = directXRedrawer.makeContext(device)
}
} catch (e: Exception) {
......
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