Commit 427dbacf authored by Roman Sedaikin's avatar Roman Sedaikin

Rebased.

parents 17918fbc 1f13701d
......@@ -55,7 +55,6 @@ plugins {
repositories {
mavenLocal()
jcenter()
maven {
url 'https://maven.pkg.jetbrains.space/public/p/compose/dev'
}
......
......@@ -7,7 +7,7 @@ plugins {
repositories {
mavenLocal()
jcenter()
mavenCentral()
maven("https://dl.bintray.com/kotlin/kotlin-eap")
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}
......@@ -79,4 +79,4 @@ tasks.withType<Test> {
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions.freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"
}
\ No newline at end of file
}
......@@ -209,12 +209,16 @@ tasks.withType(CppCompile::class.java).configureEach {
"-I$skiaDir/include/effects",
"-I$skiaDir/include/pathops",
"-I$skiaDir/include/utils",
"-I$skiaDir/include/codec",
"-I$skiaDir/include/svg",
"-I$skiaDir/modules/skottie/include",
"-I$skiaDir/modules/skparagraph/include",
"-I$skiaDir/modules/skshaper/include",
"-I$skiaDir/modules/sksg/include",
"-I$skiaDir/modules/svg/include",
"-I$skiaDir/third_party/externals/harfbuzz/src",
"-I$skiaDir/third_party/icu",
"-I$skiaDir/third_party/externals/icu/source/common",
"-DSK_ALLOW_STATIC_GLOBAL_INITIALIZERS=1",
"-DSK_FORCE_DISTANCE_FIELD_TEXT=0",
"-DSK_GAMMA_APPLY_TO_A8",
......@@ -223,9 +227,10 @@ tasks.withType(CppCompile::class.java).configureEach {
"-DSK_SUPPORT_GPU=1",
"-DSK_GL",
"-DSK_SHAPER_HARFBUZZ_AVAILABLE",
"-DSK_UNICODE_AVAILABLE",
"-DSK_SUPPORT_OPENCL=0",
"-Dskija_EXPORTS",
"-DSK_UNICODE_AVAILABLE",
"-DU_DISABLE_RENAMING",
*buildType.flags
))
val includeDir = "$projectDir/src/jvmMain/cpp/include"
......
......@@ -4,7 +4,6 @@ plugins {
repositories {
mavenCentral()
jcenter()
}
dependencies {
......
kotlin.code.style=official
deploy.version=0.0.0
dependencies.skija.git.commit=b85e3e7a70204281cf0036d5595a8eed68bacd2c
dependencies.skia.windows-x64=m89-19889d74fa/Skia-m89-19889d74fa-windows-Release-x64
dependencies.skia.linux-x64=m89-19889d74fa/Skia-m89-19889d74fa-linux-Release-x64
dependencies.skia.macos-x64=m89-19889d74fa/Skia-m89-19889d74fa-macos-Release-x64
dependencies.skia.macos-arm64=m89-19889d74fa/Skia-m89-19889d74fa-macos-Release-arm64
dependencies.skija.git.commit=ccf303ebcf926e5ef000fc42d1a6b5b7f1e0b2b5
dependencies.skia.windows-x64=m89-109bfc9052/Skia-m89-109bfc9052-windows-Release-x64
dependencies.skia.linux-x64=m89-109bfc9052/Skia-m89-109bfc9052-linux-Release-x64
dependencies.skia.macos-x64=m89-109bfc9052/Skia-m89-109bfc9052-macos-Release-x64
dependencies.skia.macos-arm64=m89-109bfc9052/Skia-m89-109bfc9052-macos-Release-arm64
# signer=Apple Distribution: Nikolay Igotti (N462MKSJ7M)
......@@ -17,7 +17,7 @@ extern "C"
{
}
JNIEXPORT void JNICALL Java_org_jetbrains_skiko_HardwareLayer_dispose(JNIEnv *env, jobject canvas)
JNIEXPORT void JNICALL Java_org_jetbrains_skiko_HardwareLayer_nativeDispose(JNIEnv *env, jobject canvas)
{
}
......
......@@ -27,6 +27,11 @@
} while (false)
const int BuffersCount = 2;
// This is a blacklist of graphics cards that have rendering issues (black screen, flickering)
// with the current Swing/Skia integration.
// If PC has other graphics cards suitable for DirectX12, one of them will be used. Otherwise,
// rendering will falls back to OpenGL.
const std::vector<std::wstring> adapterBlacklist {
L"Intel(R) HD Graphics 520",
L"Intel(R) HD Graphics 530",
......
......@@ -8,7 +8,7 @@ extern "C"
{
}
JNIEXPORT void JNICALL Java_org_jetbrains_skiko_HardwareLayer_dispose(JNIEnv *env, jobject canvas)
JNIEXPORT void JNICALL Java_org_jetbrains_skiko_HardwareLayer_nativeDispose(JNIEnv *env, jobject canvas)
{
}
......
......@@ -24,7 +24,12 @@ abstract class HardwareLayer : Canvas() {
useDrawingSurfacePlatformInfo(::nativeInit)
}
protected open external fun nativeInit(platformInfo: Long)
internal fun dispose() {
nativeDispose()
}
private external fun nativeInit(platformInfo: Long)
private external fun nativeDispose()
// TODO checkContentScale is called before init. it is ok, but when we fix getDpiScale on Linux we should check [isInit]
internal fun checkContentScale(): Boolean {
......
......@@ -92,11 +92,14 @@ open class SkiaLayer(
open fun dispose() {
check(!isDisposed)
check(isEventDispatchThread())
redrawer?.dispose() // we should dispose redrawer first (to cancel `draw` in rendering thread)
contextHandler?.dispose()
redrawer?.dispose()
picture?.instance?.close()
pictureRecorder.close()
isDisposed = true
if (isInited) {
backedLayer.dispose()
}
}
override fun setBounds(x: Int, y: Int, width: Int, height: Int) {
......
......@@ -37,7 +37,7 @@ internal class MetalRedrawer(
override fun redrawImmediately() {
check(!isDisposed)
update(System.nanoTime())
frameDispatcher.scheduleFrame()
draw()
}
private fun update(nanoTime: Long) {
......
......@@ -115,7 +115,7 @@ JNIEXPORT void JNICALL Java_org_jetbrains_skiko_HardwareLayer_nativeInit(JNIEnv
[layerStorage addObject: layersSet];
}
JNIEXPORT void JNICALL Java_org_jetbrains_skiko_HardwareLayer_dispose(JNIEnv *env, jobject canvas)
JNIEXPORT void JNICALL Java_org_jetbrains_skiko_HardwareLayer_nativeDispose(JNIEnv *env, jobject canvas)
{
LayerHandler *layer = findByObject(env, canvas);
if (layer != NULL)
......
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