Unverified Commit c412e811 authored by Nikolay Igotti's avatar Nikolay Igotti Committed by GitHub

Move to Skia m88. (#18)

parent 9c99e212
kotlin.code.style=official kotlin.code.style=official
deploy.version=0.1 deploy.version=0.1
dependencies.skija.git.commit=cb6bbba2362726cb9c2524f14aada88ae8958331 dependencies.skija.git.commit=8fc45764727610bd4b3d228198432f6f327a34ad
dependencies.skia.windows=m87-4893488/Skia-m87-4893488-windows-Release-x64 dependencies.skia.windows=m88-59bafeeaa7/Skia-m88-59bafeeaa7-windows-Release-x64
dependencies.skia.linux=m87-4893488/Skia-m87-4893488-linux-Release-x64 dependencies.skia.linux=m88-59bafeeaa7/Skia-m88-59bafeeaa7-linux-Release-x64
dependencies.skia.macos=m87-4893488/Skia-m87-4893488-macos-Release-x64 dependencies.skia.macos=m88-59bafeeaa7/Skia-m88-59bafeeaa7-macos-Release-x64
#include <jni.h> #include <jni.h>
#include "GrBackendSurface.h" #include "GrBackendSurface.h"
#include "GrContext.h" #include "GrDirectContext.h"
extern "C" { extern "C" {
...@@ -16,7 +16,7 @@ JNIEXPORT jlong JNICALL Java_org_jetbrains_skiko_RenderTargetsKt_makeGLRenderTar ...@@ -16,7 +16,7 @@ JNIEXPORT jlong JNICALL Java_org_jetbrains_skiko_RenderTargetsKt_makeGLRenderTar
} }
JNIEXPORT jlong JNICALL Java_org_jetbrains_skiko_RenderTargetsKt_makeGLContextNative(JNIEnv* env, jclass jclass) { JNIEXPORT jlong JNICALL Java_org_jetbrains_skiko_RenderTargetsKt_makeGLContextNative(JNIEnv* env, jclass jclass) {
return reinterpret_cast<jlong>(GrContext::MakeGL().release()); return reinterpret_cast<jlong>(GrDirectContext::MakeGL().release());
} }
extern void getMetalDeviceAndQueue(void** device, void** queue); extern void getMetalDeviceAndQueue(void** device, void** queue);
...@@ -38,7 +38,7 @@ JNIEXPORT jlong JNICALL Java_org_jetbrains_skiko_RenderTargetsKt_makeMetalContex ...@@ -38,7 +38,7 @@ JNIEXPORT jlong JNICALL Java_org_jetbrains_skiko_RenderTargetsKt_makeMetalContex
void* device = nullptr; void* device = nullptr;
void* queue = nullptr; void* queue = nullptr;
getMetalDeviceAndQueue(&device, &queue); getMetalDeviceAndQueue(&device, &queue);
return reinterpret_cast<jlong>(GrContext::MakeMetal(device, queue).release()); return reinterpret_cast<jlong>(GrDirectContext::MakeMetal(device, queue).release());
#else #else
return 0; return 0;
#endif #endif
......
package org.jetbrains.skiko package org.jetbrains.skiko
import org.jetbrains.skija.BackendRenderTarget import org.jetbrains.skija.BackendRenderTarget
import org.jetbrains.skija.Context import org.jetbrains.skija.DirectContext
internal fun makeGLContext() = Context( internal fun makeGLContext() = DirectContext(
makeGLContextNative() makeGLContextNative()
) )
...@@ -15,7 +15,7 @@ internal fun makeMetalRenderTarget(width: Int, height: Int, sampleCnt: Int) = Ba ...@@ -15,7 +15,7 @@ internal fun makeMetalRenderTarget(width: Int, height: Int, sampleCnt: Int) = Ba
makeMetalRenderTargetNative(width, height, sampleCnt).also { if (it == 0L) TODO("not yet supported") } makeMetalRenderTargetNative(width, height, sampleCnt).also { if (it == 0L) TODO("not yet supported") }
) )
internal fun makeMetalContext() = Context( internal fun makeMetalContext() = DirectContext(
makeMetalContextNative().also { if (it == 0L) TODO("not yet supported") } makeMetalContextNative().also { if (it == 0L) TODO("not yet supported") }
) )
......
...@@ -6,14 +6,14 @@ import javax.swing.JFrame ...@@ -6,14 +6,14 @@ import javax.swing.JFrame
import org.jetbrains.skija.BackendRenderTarget import org.jetbrains.skija.BackendRenderTarget
import org.jetbrains.skija.Canvas import org.jetbrains.skija.Canvas
import org.jetbrains.skija.ColorSpace import org.jetbrains.skija.ColorSpace
import org.jetbrains.skija.Context import org.jetbrains.skija.DirectContext
import org.jetbrains.skija.FramebufferFormat import org.jetbrains.skija.FramebufferFormat
import org.jetbrains.skija.Surface import org.jetbrains.skija.Surface
import org.jetbrains.skija.SurfaceColorFormat import org.jetbrains.skija.SurfaceColorFormat
import org.jetbrains.skija.SurfaceOrigin import org.jetbrains.skija.SurfaceOrigin
private class SkijaState { private class SkijaState {
var context: Context? = null var context: DirectContext? = null
var renderTarget: BackendRenderTarget? = null var renderTarget: BackendRenderTarget? = null
var surface: Surface? = null var surface: Surface? = null
var canvas: Canvas? = null var canvas: Canvas? = 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