8#include <android/log.h>
17static jlong ShaderBuilder_Create(JNIEnv*
env, jobject, jstring jsksl) {
23 __android_log_print(ANDROID_LOG_ERROR,
"JetSki",
"Failed to compile shader: %s\n",
31static void ShaderBuilder_Release(JNIEnv*
env, jobject, jlong native_instance) {
37static void ShaderBuilder_SetUniformFloat(JNIEnv*
env, jobject, jlong native_instance, jstring jname,
float val) {
43static void ShaderBuilder_SetUniformFloat3(JNIEnv*
env, jobject, jlong native_instance, jstring jname,
float valX,
float valY,
float valZ) {
49static void ShaderBuilder_SetUniformMatrix(JNIEnv*
env, jobject, jlong native_instance, jstring jname, jlong native_matrix) {
51 if (
auto*
matrix =
reinterpret_cast<SkM44*
>(native_matrix)) {
57static jlong ShaderBuilder_MakeShader(JNIEnv*
env, jobject, jlong native_instance) {
59 auto shader =
builder->makeShader();
60 return reinterpret_cast<jlong
>(shader.release());
69 static const JNINativeMethod methods[] = {
70 {
"nCreate" ,
"(Ljava/lang/String;)J" ,
reinterpret_cast<void*
>(ShaderBuilder_Create)},
71 {
"nRelease" ,
"(J)V" ,
reinterpret_cast<void*
>(ShaderBuilder_Release)},
73 {
"nSetUniformFloat" ,
"(JLjava/lang/String;F)V" ,
reinterpret_cast<void*
>(ShaderBuilder_SetUniformFloat)},
74 {
"nSetUniformFloat3",
"(JLjava/lang/String;FFF)V" ,
reinterpret_cast<void*
>(ShaderBuilder_SetUniformFloat3)},
75 {
"nSetUniformMatrix",
"(JLjava/lang/String;J)V" ,
reinterpret_cast<void*
>(ShaderBuilder_SetUniformMatrix)},
76 {
"nMakeShader" ,
"(J)J" ,
reinterpret_cast<void*
>(ShaderBuilder_MakeShader)},
79 const auto clazz =
env->FindClass(
"org/skia/jetski/RuntimeShaderBuilder");
81 ?
env->RegisterNatives(clazz, methods,
std::size(methods))
int register_jetski_RuntimeShaderBuilder(JNIEnv *env)
static Result MakeForShader(SkString sksl, const Options &)
unsigned useCenter Optional< SkMatrix > matrix
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size