Commit 73a6720d authored by Igor Demin's avatar Igor Demin

Make HardwareLayer internal. It doesn't provide any API now, and when it does...

Make HardwareLayer internal. It doesn't provide any API now, and when it does - we can provide it in SkiaLayer.
parent 1d61852a
...@@ -2,9 +2,8 @@ package org.jetbrains.skiko ...@@ -2,9 +2,8 @@ package org.jetbrains.skiko
import java.awt.Canvas import java.awt.Canvas
import java.awt.Graphics import java.awt.Graphics
import java.awt.event.HierarchyEvent
abstract class HardwareLayer : Canvas() { internal open class HardwareLayer : Canvas() {
companion object { companion object {
init { init {
Library.load() Library.load()
...@@ -14,17 +13,17 @@ abstract class HardwareLayer : Canvas() { ...@@ -14,17 +13,17 @@ abstract class HardwareLayer : Canvas() {
// getDpiScale is expensive operation on some platforms, so we cache it // getDpiScale is expensive operation on some platforms, so we cache it
private var _contentScale: Float? = null private var _contentScale: Float? = null
internal fun defineContentScale() { fun defineContentScale() {
_contentScale = getDpiScale() _contentScale = getDpiScale()
} }
override fun paint(g: Graphics) {} override fun paint(g: Graphics) {}
internal open fun init() { open fun init() {
useDrawingSurfacePlatformInfo(::nativeInit) useDrawingSurfacePlatformInfo(::nativeInit)
} }
internal fun dispose() { fun dispose() {
nativeDispose() nativeDispose()
} }
...@@ -32,7 +31,7 @@ abstract class HardwareLayer : Canvas() { ...@@ -32,7 +31,7 @@ abstract class HardwareLayer : Canvas() {
private external fun nativeDispose() private external fun nativeDispose()
// TODO checkContentScale is called before init. it is ok, but when we fix getDpiScale on Linux we should check [isInit] // TODO checkContentScale is called before init. it is ok, but when we fix getDpiScale on Linux we should check [isInit]
internal fun checkContentScale(): Boolean { fun checkContentScale(): Boolean {
val contentScale = getDpiScale() val contentScale = getDpiScale()
if (contentScale != _contentScale) { if (contentScale != _contentScale) {
_contentScale = contentScale _contentScale = contentScale
......
...@@ -19,7 +19,7 @@ open class SkiaLayer( ...@@ -19,7 +19,7 @@ open class SkiaLayer(
private val properties: SkiaLayerProperties = SkiaLayerProperties() private val properties: SkiaLayerProperties = SkiaLayerProperties()
) : JPanel() { ) : JPanel() {
val backedLayer : HardwareLayer internal val backedLayer : HardwareLayer
init { init {
setOpaque(false) setOpaque(false)
......
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