Java MaterialInstance::getName now creates string lazily.

This commit is contained in:
Philip Rideout
2020-05-06 15:55:29 -07:00
parent 474fe9c5ed
commit f53f03b5dd
3 changed files with 17 additions and 9 deletions

View File

@@ -348,3 +348,11 @@ Java_com_google_android_filament_MaterialInstance_nSetDepthCulling(JNIEnv*,
MaterialInstance* instance = (MaterialInstance*) nativeMaterialInstance;
instance->setDepthCulling(enable);
}
extern "C"
JNIEXPORT jstring JNICALL
Java_com_google_android_filament_MaterialInstance_nGetName(JNIEnv* env, jclass,
jlong nativeMaterialInstance) {
MaterialInstance* instance = (MaterialInstance*) nativeMaterialInstance;
return env->NewStringUTF(instance->getName());
}