Commit 9c99e212 authored by Nikolay Igotti's avatar Nikolay Igotti

Move to Skija cb6bbba and Skia 4893488

parent 3ce644f2
......@@ -62,21 +62,6 @@ fun String.insertAfterFirst(substring: String, stringToInsert: String): String =
fun AbstractCopyTask.configureSkiaCopy(targetDir: File) {
into(targetDir)
if (target == "windows") {
doLast {
// temporary hack
// todo: remove after https://github.com/google/skia/commit/0d6f81593b1fa222e8e4afb56cc961ce8c9be375 is included
// in used version of skia
val skPathRef = targetDir.resolve("include/private/SkPathRef.h")
val skPathRefContent = skPathRef.readText()
if ("#include <tuple>" !in skPathRefContent) {
val includeToInsertAfter = "#include <limits>"
check(includeToInsertAfter in skPathRefContent) { "Substring not found: '${includeToInsertAfter}' in $skPathRef" }
val newContent = skPathRefContent.insertAfterFirst(includeToInsertAfter, "\n#include <tuple>")
skPathRef.writeText(newContent)
}
}
}
}
val skiaDir = run {
......@@ -143,7 +128,7 @@ val skijaSrcDir = run {
tasks.register("delombokSkija", JavaExec::class) {
classpath = lombok + jetbrainsAnnotations
main = "lombok.launch.Main"
args("delombok", skijaDir.get().resolve("src/main/java"), "-d", delombokSkijaSrcDir)
args("delombok", skijaDir.get().resolve("shared/src/main/java"), "-d", delombokSkijaSrcDir)
inputs.dir(skijaDir)
outputs.dirs(delombokSkijaSrcDir)
}.map { delombokSkijaSrcDir }
......@@ -233,7 +218,7 @@ tasks.withType(CppCompile::class.java).configureEach {
"-DSK_SHAPER_HARFBUZZ_AVAILABLE",
"-DSK_SUPPORT_OPENCL=0",
"-Dskija_EXPORTS",
// "-DSK_UNICODE_AVAILABLE",
"-DSK_UNICODE_AVAILABLE",
"-DNDEBUG"
))
when (target) {
......@@ -346,7 +331,7 @@ tasks.withType(LinkSharedLibrary::class.java).configureEach {
extensions.configure<CppLibrary> {
source.from(
skijaDir.map { fileTree(it.resolve("src/main/cc")) },
skijaDir.map { fileTree(it.resolve("native/src")) },
fileTree("$projectDir/src/jvmMain/cpp/common"),
fileTree("$projectDir/src/jvmMain/cpp/$target")
)
......
kotlin.code.style=official
deploy.version=0.1
dependencies.skija.git.commit=11dc7805b8148df8f7b2c72651008b73bf06c00d
dependencies.skia.windows=m87-a0c82f0/Skia-m87-a0c82f0-windows-Release-x64
dependencies.skia.linux=m87-a0c82f0/Skia-m87-a0c82f0-linux-Release-x64
dependencies.skia.macos=m87-a0c82f0/Skia-m87-a0c82f0-macos-Release-x64
dependencies.skija.git.commit=cb6bbba2362726cb9c2524f14aada88ae8958331
dependencies.skia.windows=m87-4893488/Skia-m87-4893488-windows-Release-x64
dependencies.skia.linux=m87-4893488/Skia-m87-4893488-linux-Release-x64
dependencies.skia.macos=m87-4893488/Skia-m87-4893488-macos-Release-x64
......@@ -31,7 +31,8 @@ object Library {
// in Skiko's home, and if not - unpacks it. Also, it could load additional
// localization resource on platforms wher it is needed.
@Synchronized
fun load(resourcePath: String, name: String) {
fun load(resourcePath: String = "/", name: String = "skiko") {
// TODO: remove arguments.
if (loaded) return
val platformName = System.mapLibraryName(name)
......@@ -55,7 +56,7 @@ object Library {
private fun miscSystemInit() {
// we have to set this property to avoid render flickering.
System.setProperty("sun.awt.noerasebackground", "true")
// System.setProperty("skija.staticLoad", "false")
System.setProperty("skija.staticLoad", "false")
// setup menu look and feel
try {
......
......@@ -11,7 +11,7 @@ fun main() {
private class SkiaLibraryTester {
companion object {
init {
Library.load("/", "skiko")
Library.load()
}
}
......
......@@ -125,7 +125,7 @@ open class SkiaLayer() : HardwareLayer() {
open class SkiaWindow : JFrame() {
companion object {
init {
Library.load("/", "skiko")
Library.load()
}
}
......
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