16static jlong Matrix_Create(JNIEnv*
env, jobject, jfloat m0, jfloat m4, jfloat m8, jfloat m12,
17 jfloat m1, jfloat m5, jfloat m9, jfloat m13,
18 jfloat m2, jfloat m6, jfloat m10, jfloat m14,
19 jfloat m3, jfloat m7, jfloat m11, jfloat m15) {
20 return reinterpret_cast<jlong
>(
new SkM44(m0, m4, m8, m12,
26static jlong Matrix_CreateLookAt(JNIEnv*
env, jobject,
float eyeX,
float eyeY,
float eyeZ,
27 float coaX,
float coaY,
float coaZ,
28 float upX,
float upY,
float upZ) {
34static jlong Matrix_CreatePerspective(JNIEnv*
env, jobject,
float near,
float far,
float angle) {
38static jfloatArray Matrix_GetRowMajor(JNIEnv*
env, jobject, jlong native_matrix) {
39 jfloatArray
result =
nullptr;
40 if (
auto*
m =
reinterpret_cast<SkM44*
>(native_matrix)) {
46 env->SetFloatArrayRegion(
result, 0, 16, temp);
52static void Matrix_Release(JNIEnv*
env, jobject, jlong native_matrix) {
53 delete reinterpret_cast<SkM44*
>(native_matrix);
56static void Matrix_PreConcat(JNIEnv*
env, jobject, jlong native_matrixA, jlong native_matrixB) {
57 if (
auto* mA =
reinterpret_cast<SkM44*
>(native_matrixA),
58 * mB =
reinterpret_cast<SkM44*
>(native_matrixB); mA && mB) {
63static jlong Matrix_Inverse(JNIEnv*
env, jobject, jlong native_matrix) {
64 if (
auto*
m =
reinterpret_cast<SkM44*
>(native_matrix)) {
66 if (
m->invert(&inverse)) {
67 return reinterpret_cast<jlong
>(
new SkM44(inverse));
73static jlong Matrix_Transpose(JNIEnv*
env, jobject, jlong native_matrix) {
74 if (
auto*
matrix =
reinterpret_cast<SkM44*
>(native_matrix)) {
76 return reinterpret_cast<jlong
>(
new SkM44(trans));
81static jlong Matrix_Concat(JNIEnv*
env, jobject, jlong native_matrixA, jlong native_matrixB) {
82 if (
auto* mA =
reinterpret_cast<SkM44*
>(native_matrixA),
83 * mB =
reinterpret_cast<SkM44*
>(native_matrixB); mA && mB) {
84 return reinterpret_cast<jlong
>(
new SkM44(*mA, *mB));
89static void Matrix_Translate(JNIEnv*
env, jobject, jlong native_matrix, jfloat
x, jfloat
y, jfloat z) {
90 if (
auto*
matrix =
reinterpret_cast<SkM44*
>(native_matrix)) {
95static void Matrix_Scale(JNIEnv*
env, jobject, jlong native_matrix, jfloat
x, jfloat
y, jfloat z) {
96 if (
auto*
matrix =
reinterpret_cast<SkM44*
>(native_matrix)) {
101static void Matrix_Rotate(JNIEnv*
env, jobject, jlong native_matrix, jfloat
x, jfloat
y, jfloat z, jfloat rad) {
102 if (
auto*
matrix =
reinterpret_cast<SkM44*
>(native_matrix)) {
111 static const JNINativeMethod methods[] = {
112 {
"nCreate" ,
"(FFFFFFFFFFFFFFFF)J" ,
reinterpret_cast<void*
>(Matrix_Create)},
113 {
"nCreateLookAt" ,
"(FFFFFFFFF)J" ,
reinterpret_cast<void*
>(Matrix_CreateLookAt)},
114 {
"nCreatePerspective" ,
"(FFF)J" ,
reinterpret_cast<void*
>(Matrix_CreatePerspective)},
115 {
"nGetRowMajor" ,
"(J)[F" ,
reinterpret_cast<void*
>(Matrix_GetRowMajor)},
116 {
"nRelease" ,
"(J)V" ,
reinterpret_cast<void*
>(Matrix_Release)},
117 {
"nInverse" ,
"(J)J" ,
reinterpret_cast<void*
>(Matrix_Inverse)},
118 {
"nTranspose" ,
"(J)J" ,
reinterpret_cast<void*
>(Matrix_Transpose)},
119 {
"nPreConcat" ,
"(JJ)V" ,
reinterpret_cast<void*
>(Matrix_PreConcat)},
120 {
"nConcat" ,
"(JJ)J" ,
reinterpret_cast<void*
>(Matrix_Concat)},
121 {
"nTranslate" ,
"(JFFF)V" ,
reinterpret_cast<void*
>(Matrix_Translate)},
122 {
"nScale" ,
"(JFFF)V" ,
reinterpret_cast<void*
>(Matrix_Scale)},
123 {
"nRotate" ,
"(JFFFF)V" ,
reinterpret_cast<void*
>(Matrix_Rotate)},
126 const auto clazz =
env->FindClass(
"org/skia/jetski/Matrix");
128 ?
env->RegisterNatives(clazz, methods,
std::size(methods))
int register_jetski_Matrix(JNIEnv *env)
static bool rotate(const SkDCubic &cubic, int zero, int index, SkDCubic &rotPath)
static SkM44 LookAt(const SkV3 &eye, const SkV3 ¢er, const SkV3 &up)
static SkM44 Rotate(SkV3 axis, SkScalar radians)
@ kUninitialized_Constructor
SkM44 & preConcat(const SkM44 &m)
static SkM44 Perspective(float near, float far, float angle)
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