7#include <android/hardware_buffer_jni.h>
8#include <android/native_window_jni.h>
14#include "unicode/uchar.h"
31#define ANDROID_SHELL_HOLDER \
32 (reinterpret_cast<AndroidShellHolder*>(shell_holder))
65#define FLUTTER_FOR_EACH_JNI_METHOD(V) \
66 V(g_handle_platform_message_method, handlePlatformMessage, \
67 "(Ljava/lang/String;Ljava/nio/ByteBuffer;IJ)V") \
68 V(g_handle_platform_message_response_method, handlePlatformMessageResponse, \
69 "(ILjava/nio/ByteBuffer;)V") \
70 V(g_update_semantics_method, updateSemantics, \
71 "(Ljava/nio/ByteBuffer;[Ljava/lang/String;[Ljava/nio/ByteBuffer;)V") \
72 V(g_set_application_locale_method, setApplicationLocale, \
73 "(Ljava/lang/String;)V") \
74 V(g_set_semantics_tree_enabled_method, setSemanticsTreeEnabled, "(Z)V") \
75 V(g_on_display_platform_view_method, onDisplayPlatformView, \
76 "(IIIIIIILio/flutter/embedding/engine/mutatorsstack/" \
77 "FlutterMutatorsStack;)V") \
78 V(g_on_begin_frame_method, onBeginFrame, "()V") \
79 V(g_on_end_frame_method, onEndFrame, "()V") \
80 V(g_on_display_overlay_surface_method, onDisplayOverlaySurface, "(IIIII)V") \
81 V(g_create_transaction_method, createTransaction, \
82 "()Landroid/view/SurfaceControl$Transaction;") \
83 V(g_swap_transaction_method, swapTransactions, "()V") \
84 V(g_apply_transaction_method, applyTransactions, "()V") \
85 V(g_create_overlay_surface2_method, createOverlaySurface2, \
86 "()Lio/flutter/embedding/engine/FlutterOverlaySurface;") \
87 V(g_destroy_overlay_surface2_method, destroyOverlaySurface2, "()V") \
88 V(g_on_display_platform_view2_method, onDisplayPlatformView2, \
89 "(IIIIIIILio/flutter/embedding/engine/mutatorsstack/" \
90 "FlutterMutatorsStack;)V") \
91 V(g_hide_platform_view2_method, hidePlatformView2, "(I)V") \
92 V(g_on_end_frame2_method, endFrame2, "()V") \
93 V(g_show_overlay_surface2_method, showOverlaySurface2, "()V") \
94 V(g_hide_overlay_surface2_method, hideOverlaySurface2, "()V") \
95 V(g_get_scaled_font_size_method, getScaledFontSize, "(FI)F") \
96 V(g_update_custom_accessibility_actions_method, \
97 updateCustomAccessibilityActions, \
98 "(Ljava/nio/ByteBuffer;[Ljava/lang/String;)V") \
99 V(g_on_first_frame_method, onFirstFrame, "()V") \
100 V(g_on_engine_restart_method, onPreEngineRestart, "()V") \
101 V(g_create_overlay_surface_method, createOverlaySurface, \
102 "()Lio/flutter/embedding/engine/FlutterOverlaySurface;") \
103 V(g_destroy_overlay_surfaces_method, destroyOverlaySurfaces, "()V") \
104 V(g_maybe_resize_surface_view, maybeResizeSurfaceView, "(II)V") \
107#define FLUTTER_DECLARE_JNI(global_field, jni_name, jni_arg) \
108 static jmethodID global_field = nullptr;
110#define FLUTTER_BIND_JNI(global_field, jni_name, jni_arg) \
112 env->GetMethodID(g_flutter_jni_class->obj(), #jni_name, jni_arg); \
113 if (global_field == nullptr) { \
114 FML_LOG(ERROR) << "Could not locate " << #jni_name << " method."; \
185static jlong
AttachJNI(JNIEnv* env, jclass clazz, jobject flutterJNI) {
187 std::shared_ptr<PlatformViewAndroidJNI> jni_facade =
188 std::make_shared<PlatformViewAndroidJNIImpl>(java_object);
189 auto shell_holder = std::make_unique<AndroidShellHolder>(
192 if (shell_holder->IsValid()) {
193 return reinterpret_cast<jlong
>(shell_holder.release());
199static void DestroyJNI(JNIEnv* env, jobject jcaller, jlong shell_holder) {
218 jstring jInitialRoute,
219 jobject jEntrypointArgs,
222 if (jni ==
nullptr) {
223 FML_LOG(ERROR) <<
"Could not create a FlutterJNI instance";
228 std::shared_ptr<PlatformViewAndroidJNI> jni_facade =
229 std::make_shared<PlatformViewAndroidJNIImpl>(java_jni);
236 auto spawned_shell_holder =
238 initial_route, entrypoint_args, engineId);
240 if (spawned_shell_holder ==
nullptr || !spawned_shell_holder->IsValid()) {
241 FML_LOG(ERROR) <<
"Could not spawn Shell";
245 jobject javaLong = env->CallStaticObjectMethod(
247 reinterpret_cast<jlong
>(spawned_shell_holder.release()));
248 if (javaLong ==
nullptr) {
249 FML_LOG(ERROR) <<
"Could not create a Long instance";
266 auto window = fml::MakeRefCounted<AndroidNativeWindow>(
267 ANativeWindow_fromSurface(env, jsurface));
279 auto window = fml::MakeRefCounted<AndroidNativeWindow>(
280 ANativeWindow_fromSurface(env, jsurface));
304 jobject jAssetManager,
305 jobject jEntrypointArgs,
307 auto apk_asset_provider = std::make_unique<flutter::APKAssetProvider>(
317 libraryUrl, entrypoint_args, engineId);
324 if (cbInfo ==
nullptr) {
329 env->NewStringUTF(cbInfo->name.c_str()),
330 env->NewStringUTF(cbInfo->class_name.c_str()),
331 env->NewStringUTF(cbInfo->library_path.c_str()));
337 jfloat devicePixelRatio,
340 jint physicalPaddingTop,
341 jint physicalPaddingRight,
342 jint physicalPaddingBottom,
343 jint physicalPaddingLeft,
344 jint physicalViewInsetTop,
345 jint physicalViewInsetRight,
346 jint physicalViewInsetBottom,
347 jint physicalViewInsetLeft,
348 jint systemGestureInsetTop,
349 jint systemGestureInsetRight,
350 jint systemGestureInsetBottom,
351 jint systemGestureInsetLeft,
352 jint physicalTouchSlop,
353 jintArray javaDisplayFeaturesBounds,
354 jintArray javaDisplayFeaturesType,
355 jintArray javaDisplayFeaturesState,
356 jint physicalMinWidth,
357 jint physicalMaxWidth,
358 jint physicalMinHeight,
359 jint physicalMaxHeight,
360 jint physicalDisplayCornerRadiusTopLeft,
361 jint physicalDisplayCornerRadiusTopRight,
362 jint physicalDisplayCornerRadiusBottomRight,
363 jint physicalDisplayCornerRadiusBottomLeft) {
366 jsize rectSize = env->GetArrayLength(javaDisplayFeaturesBounds);
367 std::vector<int> boundsIntVector(rectSize);
368 env->GetIntArrayRegion(javaDisplayFeaturesBounds, 0, rectSize,
369 &boundsIntVector[0]);
370 std::vector<double> displayFeaturesBounds(boundsIntVector.begin(),
371 boundsIntVector.end());
372 jsize typeSize = env->GetArrayLength(javaDisplayFeaturesType);
373 std::vector<int> displayFeaturesType(typeSize);
374 env->GetIntArrayRegion(javaDisplayFeaturesType, 0, typeSize,
375 &displayFeaturesType[0]);
377 jsize stateSize = env->GetArrayLength(javaDisplayFeaturesState);
378 std::vector<int> displayFeaturesState(stateSize);
379 env->GetIntArrayRegion(javaDisplayFeaturesState, 0, stateSize,
380 &displayFeaturesState[0]);
383 static_cast<double>(devicePixelRatio),
384 static_cast<double>(physicalWidth),
385 static_cast<double>(physicalHeight),
386 static_cast<double>(physicalMinWidth),
387 static_cast<double>(physicalMaxWidth),
392 static_cast<double>(physicalPaddingTop),
393 static_cast<double>(physicalPaddingRight),
394 static_cast<double>(physicalPaddingBottom),
395 static_cast<double>(physicalPaddingLeft),
396 static_cast<double>(physicalViewInsetTop),
398 physicalViewInsetRight),
400 physicalViewInsetBottom),
401 static_cast<double>(physicalViewInsetLeft),
403 systemGestureInsetTop),
405 systemGestureInsetRight),
407 systemGestureInsetBottom),
409 systemGestureInsetLeft),
410 static_cast<double>(physicalTouchSlop),
411 displayFeaturesBounds,
413 displayFeaturesState,
416 physicalDisplayCornerRadiusTopLeft),
418 physicalDisplayCornerRadiusTopRight),
420 physicalDisplayCornerRadiusBottomRight),
422 physicalDisplayCornerRadiusBottomLeft),
431 jlong shell_holder) {
437 jlong shell_holder) {
441static jobject
GetBitmap(JNIEnv* env, jobject jcaller, jlong shell_holder) {
444 if (screenshot.data ==
nullptr) {
448 jstring argb = env->NewStringUTF(
"ARGB_8888");
449 if (argb ==
nullptr) {
453 jobject bitmap_config = env->CallStaticObjectMethod(
455 if (bitmap_config ==
nullptr) {
459 auto bitmap = env->CallStaticObjectMethod(
461 screenshot.frame_size.width, screenshot.frame_size.height, bitmap_config);
465 env->NewDirectByteBuffer(
const_cast<uint8_t*
>(screenshot.data->bytes()),
466 screenshot.data->size()));
504 jlong message_data) {
506 free(
reinterpret_cast<void*
>(message_data));
514 uint8_t*
data =
static_cast<uint8_t*
>(env->GetDirectBufferAddress(
buffer));
515 auto packet = std::make_unique<flutter::PointerDataPacket>(
data, position);
526 jint args_position) {
558 jobject surface_texture) {
569 jobject image_texture_entry,
570 jboolean reset_on_background) {
598static void ScheduleFrame(JNIEnv* env, jobject jcaller, jlong shell_holder) {
608 uint8_t* response_data =
609 static_cast<uint8_t*
>(env->GetDirectBufferAddress(
message));
611 auto mapping = std::make_unique<fml::MallocMapping>(
614 ->InvokePlatformMessageResponseCallback(responseId, std::move(mapping));
622 ->InvokePlatformMessageEmptyResponseCallback(responseId);
627 jlong shell_holder) {
634 return u_hasBinaryProperty(codePoint, UProperty::UCHAR_EMOJI);
640 return u_hasBinaryProperty(codePoint, UProperty::UCHAR_EMOJI_MODIFIER);
646 return u_hasBinaryProperty(codePoint, UProperty::UCHAR_EMOJI_MODIFIER_BASE);
652 return u_hasBinaryProperty(codePoint, UProperty::UCHAR_VARIATION_SELECTOR);
658 return u_hasBinaryProperty(codePoint, UProperty::UCHAR_REGIONAL_INDICATOR);
671 jboolean jTransient) {
674 static_cast<bool>(jTransient));
681 jobjectArray jSearchPaths) {
683 intptr_t loading_unit_id =
static_cast<intptr_t
>(jLoadingUnitId);
684 std::vector<std::string> search_paths =
689 void* handle =
nullptr;
690 while (handle ==
nullptr && !search_paths.empty()) {
691 std::string
path = search_paths.back();
692 handle = ::dlopen(
path.c_str(), RTLD_NOW);
693 search_paths.pop_back();
695 if (handle ==
nullptr) {
697 "No lib .so found for provided search paths.",
true);
704 std::unique_ptr<const fml::SymbolMapping> data_mapping =
705 std::make_unique<const fml::SymbolMapping>(
707 std::unique_ptr<const fml::SymbolMapping> instructions_mapping =
708 std::make_unique<const fml::SymbolMapping>(
712 loading_unit_id, std::move(data_mapping),
713 std::move(instructions_mapping));
719 jobject jAssetManager,
720 jstring jAssetBundlePath) {
721 auto asset_resolver = std::make_unique<flutter::APKAssetProvider>(
727 std::move(asset_resolver),
732 static const JNINativeMethod flutter_jni_methods[] = {
735 .name =
"nativeAttach",
736 .signature =
"(Lio/flutter/embedding/engine/FlutterJNI;)J",
737 .fnPtr =
reinterpret_cast<void*
>(&
AttachJNI),
740 .name =
"nativeDestroy",
742 .fnPtr =
reinterpret_cast<void*
>(&
DestroyJNI),
745 .name =
"nativeSpawn",
746 .signature =
"(JLjava/lang/String;Ljava/lang/String;Ljava/lang/"
747 "String;Ljava/util/List;J)Lio/flutter/"
748 "embedding/engine/FlutterJNI;",
749 .fnPtr =
reinterpret_cast<void*
>(&
SpawnJNI),
752 .name =
"nativeRunBundleAndSnapshotFromLibrary",
753 .signature =
"(JLjava/lang/String;Ljava/lang/String;"
754 "Ljava/lang/String;Landroid/content/res/"
755 "AssetManager;Ljava/util/List;J)V",
759 .name =
"nativeDispatchEmptyPlatformMessage",
760 .signature =
"(JLjava/lang/String;I)V",
764 .name =
"nativeCleanupMessageData",
769 .name =
"nativeDispatchPlatformMessage",
770 .signature =
"(JLjava/lang/String;Ljava/nio/ByteBuffer;II)V",
774 .name =
"nativeInvokePlatformMessageResponseCallback",
775 .signature =
"(JILjava/nio/ByteBuffer;I)V",
780 .name =
"nativeInvokePlatformMessageEmptyResponseCallback",
781 .signature =
"(JI)V",
782 .fnPtr =
reinterpret_cast<void*
>(
786 .name =
"nativeNotifyLowMemoryWarning",
793 .name =
"nativeGetBitmap",
794 .signature =
"(J)Landroid/graphics/Bitmap;",
795 .fnPtr =
reinterpret_cast<void*
>(&
GetBitmap),
798 .name =
"nativeSurfaceCreated",
799 .signature =
"(JLandroid/view/Surface;)V",
803 .name =
"nativeSurfaceWindowChanged",
804 .signature =
"(JLandroid/view/Surface;)V",
808 .name =
"nativeSurfaceChanged",
809 .signature =
"(JII)V",
813 .name =
"nativeSurfaceDestroyed",
818 .name =
"nativeSetViewportMetrics",
819 .signature =
"(JFIIIIIIIIIIIIIII[I[I[IIIIIIIII)V",
823 .name =
"nativeDispatchPointerDataPacket",
824 .signature =
"(JLjava/nio/ByteBuffer;I)V",
828 .name =
"nativeDispatchSemanticsAction",
829 .signature =
"(JIILjava/nio/ByteBuffer;I)V",
833 .name =
"nativeSetSemanticsEnabled",
834 .signature =
"(JZ)V",
838 .name =
"nativeSetAccessibilityFeatures",
839 .signature =
"(JI)V",
843 .name =
"nativeGetIsSoftwareRenderingEnabled",
848 .name =
"nativeRegisterTexture",
849 .signature =
"(JJLjava/lang/ref/"
854 .name =
"nativeRegisterImageTexture",
855 .signature =
"(JJLjava/lang/ref/"
860 .name =
"nativeMarkTextureFrameAvailable",
861 .signature =
"(JJ)V",
865 .name =
"nativeScheduleFrame",
870 .name =
"nativeUnregisterTexture",
871 .signature =
"(JJ)V",
876 .name =
"nativeLookupCallbackInformation",
877 .signature =
"(J)Lio/flutter/view/FlutterCallbackInformation;",
883 .name =
"nativeFlutterTextUtilsIsEmoji",
888 .name =
"nativeFlutterTextUtilsIsEmojiModifier",
893 .name =
"nativeFlutterTextUtilsIsEmojiModifierBase",
899 .name =
"nativeFlutterTextUtilsIsVariationSelector",
905 .name =
"nativeFlutterTextUtilsIsRegionalIndicator",
911 .name =
"nativeLoadDartDeferredLibrary",
912 .signature =
"(JI[Ljava/lang/String;)V",
916 .name =
"nativeUpdateJavaAssetManager",
918 "(JLandroid/content/res/AssetManager;Ljava/lang/String;)V",
922 .name =
"nativeDeferredComponentInstallFailure",
923 .signature =
"(ILjava/lang/String;Z)V",
927 .name =
"nativeUpdateDisplayMetrics",
932 .name =
"nativeIsSurfaceControlEnabled",
938 std::size(flutter_jni_methods)) != 0) {
939 FML_LOG(ERROR) <<
"Failed to RegisterNatives with FlutterJNI";
947 FML_LOG(ERROR) <<
"Could not locate FlutterJNI's nativeShellHolderId field";
955 FML_LOG(ERROR) <<
"Could not locate FlutterJNI's constructor";
960 "valueOf",
"(J)Ljava/lang/Long;");
962 FML_LOG(ERROR) <<
"Could not locate Long's constructor";
969 env, env->FindClass(
"io/flutter/embedding/engine/FlutterOverlaySurface"));
970 if (overlay_surface_class.is_null()) {
971 FML_LOG(ERROR) <<
"Could not locate FlutterOverlaySurface class";
975 env->GetMethodID(overlay_surface_class.
obj(),
"getId",
"()I");
977 FML_LOG(ERROR) <<
"Could not locate FlutterOverlaySurface#getId() method";
981 overlay_surface_class.
obj(),
"getSurface",
"()Landroid/view/Surface;");
984 <<
"Could not locate FlutterOverlaySurface#getSurface() method";
989 env, env->FindClass(
"android/graphics/Bitmap"));
991 FML_LOG(ERROR) <<
"Could not locate Bitmap Class";
997 "(IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;");
999 FML_LOG(ERROR) <<
"Could not locate Bitmap.createBitmap method";
1004 g_bitmap_class->obj(),
"copyPixelsFromBuffer",
"(Ljava/nio/Buffer;)V");
1006 FML_LOG(ERROR) <<
"Could not locate Bitmap.copyPixelsFromBuffer method";
1011 env, env->FindClass(
"android/graphics/Bitmap$Config"));
1013 FML_LOG(ERROR) <<
"Could not locate Bitmap.Config Class";
1019 "(Ljava/lang/String;)Landroid/graphics/Bitmap$Config;");
1021 FML_LOG(ERROR) <<
"Could not locate Bitmap.Config.valueOf method";
1029 if (env ==
nullptr) {
1030 FML_LOG(ERROR) <<
"No JNIEnv provided";
1035 env, env->FindClass(
"io/flutter/view/FlutterCallbackInformation"));
1037 FML_LOG(ERROR) <<
"Could not locate FlutterCallbackInformation class";
1043 "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
1045 FML_LOG(ERROR) <<
"Could not locate FlutterCallbackInformation constructor";
1050 env, env->FindClass(
"io/flutter/embedding/engine/FlutterJNI"));
1052 FML_LOG(ERROR) <<
"Failed to find FlutterJNI Class.";
1059 "io/flutter/embedding/engine/mutatorsstack/FlutterMutatorsStack"));
1061 FML_LOG(ERROR) <<
"Could not locate FlutterMutatorsStack";
1068 FML_LOG(ERROR) <<
"Could not locate FlutterMutatorsStack.init method";
1076 <<
"Could not locate FlutterMutatorsStack.pushTransform method";
1084 <<
"Could not locate FlutterMutatorsStack.pushClipRect method";
1092 <<
"Could not locate FlutterMutatorsStack.pushClipRRect method";
1100 <<
"Could not locate FlutterMutatorsStack.pushOpacity method";
1106 "(Landroid/graphics/Path;)V");
1109 <<
"Could not locate FlutterMutatorsStack.pushClipPath method";
1114 env, env->FindClass(
"java/lang/ref/WeakReference"));
1116 FML_LOG(ERROR) <<
"Could not locate WeakReference class";
1123 FML_LOG(ERROR) <<
"Could not locate WeakReference.get method";
1128 env, env->FindClass(
1129 "io/flutter/embedding/engine/renderer/SurfaceTextureWrapper"));
1131 FML_LOG(ERROR) <<
"Could not locate SurfaceTextureWrapper class";
1139 FML_LOG(ERROR) <<
"Could not locate attachToGlContext method";
1148 <<
"Could not locate SurfaceTextureWrapper.shouldUpdate method";
1156 FML_LOG(ERROR) <<
"Could not locate updateTexImage method";
1164 FML_LOG(ERROR) <<
"Could not locate getTransformMatrix method";
1172 FML_LOG(ERROR) <<
"Could not locate detachFromGlContext method";
1177 env, env->FindClass(
"io/flutter/view/TextureRegistry$ImageConsumer"));
1179 FML_LOG(ERROR) <<
"Could not locate TextureRegistry.ImageConsumer class";
1185 "acquireLatestImage",
"()Landroid/media/Image;");
1187 FML_LOG(ERROR) <<
"Could not locate acquireLatestImage on "
1188 "TextureRegistry.ImageConsumer class";
1193 env, env->FindClass(
"android/media/Image"));
1195 FML_LOG(ERROR) <<
"Could not locate Image class";
1204 "()Landroid/hardware/HardwareBuffer;");
1214 FML_LOG(ERROR) <<
"Could not locate close on Image class";
1221 env, env->FindClass(
"android/hardware/HardwareBuffer"));
1237 "([Ljava/lang/String;)[Ljava/lang/String;");
1240 FML_LOG(ERROR) <<
"Could not locate computePlatformResolvedLocale method";
1248 FML_LOG(ERROR) <<
"Could not locate requestDartDeferredLibrary method";
1253 env, env->FindClass(
"java/lang/Long"));
1255 FML_LOG(ERROR) <<
"Could not locate java.lang.Long class";
1261 env, env->FindClass(
"android/graphics/Path"));
1263 FML_LOG(ERROR) <<
"Could not locate android.graphics.Path class";
1269 FML_LOG(ERROR) <<
"Could not locate android.graphics.Path constructor";
1274 path_class->obj(),
"setFillType",
"(Landroid/graphics/Path$FillType;)V");
1277 <<
"Could not locate android.graphics.Path.setFillType method";
1283 FML_LOG(ERROR) <<
"Could not locate android.graphics.Path.moveTo method";
1288 FML_LOG(ERROR) <<
"Could not locate android.graphics.Path.lineTo method";
1292 env->GetMethodID(
path_class->obj(),
"quadTo",
"(FFFF)V");
1294 FML_LOG(ERROR) <<
"Could not locate android.graphics.Path.quadTo method";
1298 env->GetMethodID(
path_class->obj(),
"cubicTo",
"(FFFFFF)V");
1300 FML_LOG(ERROR) <<
"Could not locate android.graphics.Path.cubicTo method";
1307 env->GetMethodID(
path_class->obj(),
"conicTo",
"(FFFFF)V");
1314 FML_LOG(ERROR) <<
"Could not locate android.graphics.Path.close method";
1319 env, env->FindClass(
"android/graphics/Path$FillType"));
1321 FML_LOG(ERROR) <<
"Could not locate android.graphics.Path$FillType class";
1327 "Landroid/graphics/Path$FillType;");
1329 FML_LOG(ERROR) <<
"Could not locate Path.FillType.WINDING field";
1335 "Landroid/graphics/Path$FillType;");
1337 FML_LOG(ERROR) <<
"Could not locate Path.FillType.EVEN_ODD field";
1346 : java_object_(java_object) {}
1351 std::unique_ptr<flutter::PlatformMessage>
message,
1356 auto java_object = java_object_.
get(env);
1357 if (java_object.is_null()) {
1366 env, env->NewDirectByteBuffer(
1367 const_cast<uint8_t*
>(
message->data().GetMapping()),
1371 env->CallVoidMethod(java_object.obj(), g_handle_platform_message_method,
1372 java_channel.
obj(), message_array.
obj(), responseId,
1373 reinterpret_cast<jlong
>(mapping.
Release()));
1375 env->CallVoidMethod(java_object.obj(), g_handle_platform_message_method,
1376 java_channel.
obj(),
nullptr, responseId,
nullptr);
1383 std::string locale) {
1386 auto java_object = java_object_.
get(env);
1387 if (java_object.is_null()) {
1394 env->CallVoidMethod(java_object.obj(), g_set_application_locale_method,
1404 auto java_object = java_object_.
get(env);
1405 if (java_object.is_null()) {
1409 env->CallVoidMethod(java_object.obj(), g_set_semantics_tree_enabled_method,
1417 std::unique_ptr<fml::Mapping>
data) {
1422 auto java_object = java_object_.
get(env);
1423 if (java_object.is_null()) {
1428 if (
data ==
nullptr) {
1429 env->CallVoidMethod(java_object.obj(),
1430 g_handle_platform_message_response_method, responseId,
1435 env, env->NewDirectByteBuffer(
const_cast<uint8_t*
>(
data->GetMapping()),
1438 env->CallVoidMethod(java_object.obj(),
1439 g_handle_platform_message_response_method, responseId,
1448 int configuration_id)
const {
1451 auto java_object = java_object_.
get(env);
1452 if (java_object.is_null()) {
1456 const jfloat scaledSize = env->CallFloatMethod(
1457 java_object.obj(), g_get_scaled_font_size_method,
1458 static_cast<jfloat
>(
font_size),
static_cast<jint
>(configuration_id));
1460 return static_cast<double>(scaledSize);
1464 std::vector<uint8_t> buffer,
1465 std::vector<std::string> strings,
1466 std::vector<std::vector<uint8_t>> string_attribute_args) {
1469 auto java_object = java_object_.
get(env);
1470 if (java_object.is_null()) {
1475 env, env->NewDirectByteBuffer(
buffer.data(),
buffer.size()));
1481 env->CallVoidMethod(java_object.obj(), g_update_semantics_method,
1482 direct_buffer.
obj(), jstrings.
obj(),
1483 jstring_attribute_args.
obj());
1489 std::vector<uint8_t> actions_buffer,
1490 std::vector<std::string> strings) {
1493 auto java_object = java_object_.
get(env);
1494 if (java_object.is_null()) {
1500 env->NewDirectByteBuffer(actions_buffer.data(), actions_buffer.size()));
1505 env->CallVoidMethod(java_object.obj(),
1506 g_update_custom_accessibility_actions_method,
1507 direct_actions_buffer.
obj(), jstrings.
obj());
1515 auto java_object = java_object_.
get(env);
1516 if (java_object.is_null()) {
1520 env->CallVoidMethod(java_object.obj(), g_on_first_frame_method);
1528 auto java_object = java_object_.
get(env);
1529 if (java_object.is_null()) {
1533 env->CallVoidMethod(java_object.obj(), g_on_engine_restart_method);
1543 if (surface_texture.is_null()) {
1548 env, env->CallObjectMethod(surface_texture.obj(),
1551 if (surface_texture_local_ref.is_null()) {
1555 env->CallVoidMethod(surface_texture_local_ref.
obj(),
1565 if (surface_texture.is_null()) {
1570 env, env->CallObjectMethod(surface_texture.obj(),
1572 if (surface_texture_local_ref.is_null()) {
1576 jboolean shouldUpdate = env->CallBooleanMethod(
1581 return shouldUpdate;
1588 if (surface_texture.is_null()) {
1593 env, env->CallObjectMethod(surface_texture.obj(),
1595 if (surface_texture_local_ref.is_null()) {
1599 env->CallVoidMethod(surface_texture_local_ref.
obj(),
1609 if (surface_texture.is_null()) {
1614 env, env->CallObjectMethod(surface_texture.obj(),
1616 if (surface_texture_local_ref.is_null()) {
1621 env, env->NewFloatArray(16));
1623 env->CallVoidMethod(surface_texture_local_ref.
obj(),
1627 float* m = env->GetFloatArrayElements(transformMatrix.
obj(),
nullptr);
1629 static_assert(
sizeof(SkScalar) ==
sizeof(
float));
1630 const auto transform = SkM44::ColMajor(m);
1632 env->ReleaseFloatArrayElements(transformMatrix.
obj(), m, JNI_ABORT);
1641 if (surface_texture.is_null()) {
1646 env, env->CallObjectMethod(surface_texture.obj(),
1648 if (surface_texture_local_ref.is_null()) {
1652 env->CallVoidMethod(surface_texture_local_ref.
obj(),
1663 if (image_producer_texture_entry.is_null()) {
1671 env, env->CallObjectMethod(image_producer_texture_entry.obj(),
1674 if (image_producer_texture_entry_local_ref.is_null()) {
1680 env, env->CallObjectMethod(image_producer_texture_entry_local_ref.
obj(),
1693 if (
image.is_null()) {
1708 if (
image.is_null()) {
1719 if (hardware_buffer.is_null()) {
1736 auto java_object = java_object_.
get(env);
1737 if (java_object.is_null()) {
1744 std::vector<std::shared_ptr<Mutator>>::const_iterator iter =
1745 mutators_stack.
Begin();
1746 while (iter != mutators_stack.
End()) {
1747 switch ((*iter)->GetType()) {
1749 const DlMatrix& matrix = (*iter)->GetMatrix();
1751 matrix.
m[0], matrix.
m[4], matrix.
m[12],
1752 matrix.
m[1], matrix.
m[5], matrix.
m[13],
1753 matrix.
m[3], matrix.
m[7], matrix.
m[15],
1756 env, env->NewFloatArray(9));
1758 env->SetFloatArrayRegion(transformMatrix.
obj(), 0, 9, matrix_array);
1759 env->CallVoidMethod(mutatorsStack,
1761 transformMatrix.
obj());
1765 const DlRect& rect = (*iter)->GetRect();
1766 env->CallVoidMethod(mutatorsStack,
1768 static_cast<int>(rect.
GetLeft()),
1769 static_cast<int>(rect.
GetTop()),
1778 SkScalar radiis[8] = {
1785 env, env->NewFloatArray(8));
1786 env->SetFloatArrayRegion(radiisArray.
obj(), 0, 8, radiis);
1787 env->CallVoidMethod(mutatorsStack,
1789 static_cast<int>(rect.
GetLeft()),
1790 static_cast<int>(rect.
GetTop()),
1797 const DlRoundRect& rrect = (*iter)->GetRSEApproximation();
1800 SkScalar radiis[8] = {
1807 env, env->NewFloatArray(8));
1808 env->SetFloatArrayRegion(radiisArray.
obj(), 0, 8, radiis);
1809 env->CallVoidMethod(mutatorsStack,
1811 static_cast<int>(rect.
GetLeft()),
1812 static_cast<int>(rect.
GetTop()),
1832 env->CallVoidMethod(java_object.obj(), g_on_display_platform_view_method,
1847 auto java_object = java_object_.
get(env);
1848 if (java_object.is_null()) {
1852 env->CallVoidMethod(java_object.obj(), g_on_display_overlay_surface_method,
1861 auto java_object = java_object_.
get(env);
1862 if (java_object.is_null()) {
1866 env->CallVoidMethod(java_object.obj(), g_on_begin_frame_method);
1874 auto java_object = java_object_.
get(env);
1875 if (java_object.is_null()) {
1879 env->CallVoidMethod(java_object.obj(), g_on_end_frame_method);
1884std::unique_ptr<PlatformViewAndroidJNI::OverlayMetadata>
1888 auto java_object = java_object_.
get(env);
1889 if (java_object.is_null()) {
1894 env, env->CallObjectMethod(java_object.obj(),
1895 g_create_overlay_surface_method));
1898 if (overlay.is_null()) {
1899 return std::make_unique<PlatformViewAndroidJNI::OverlayMetadata>(0,
1906 jobject overlay_surface =
1909 auto overlay_window = fml::MakeRefCounted<AndroidNativeWindow>(
1910 ANativeWindow_fromSurface(env, overlay_surface));
1912 return std::make_unique<PlatformViewAndroidJNI::OverlayMetadata>(
1913 overlay_id, std::move(overlay_window));
1919 auto java_object = java_object_.
get(env);
1920 if (java_object.is_null()) {
1924 env->CallVoidMethod(java_object.obj(), g_destroy_overlay_surfaces_method);
1929std::unique_ptr<std::vector<std::string>>
1931 std::vector<std::string> supported_locales_data) {
1934 std::unique_ptr<std::vector<std::string>> out =
1935 std::make_unique<std::vector<std::string>>();
1937 auto java_object = java_object_.
get(env);
1938 if (java_object.is_null()) {
1943 jobjectArray result =
static_cast<jobjectArray
>(env->CallObjectMethod(
1945 j_locales_data.
obj()));
1949 int length = env->GetArrayLength(result);
1952 env,
static_cast<jstring
>(env->GetObjectArrayElement(result,
i))));
1960 auto java_object = java_object_.
get(env);
1961 if (java_object.is_null()) {
1966 env, env->GetObjectClass(java_object.obj()));
1967 if (clazz.is_null()) {
1971 jfieldID fid = env->GetStaticFieldID(clazz.
obj(),
"refreshRateFPS",
"F");
1972 return static_cast<double>(env->GetStaticFloatField(clazz.
obj(), fid));
1978 auto java_object = java_object_.
get(env);
1979 if (java_object.is_null()) {
1984 env, env->GetObjectClass(java_object.obj()));
1985 if (clazz.is_null()) {
1989 jfieldID fid = env->GetStaticFieldID(clazz.
obj(),
"displayWidth",
"F");
1990 return static_cast<double>(env->GetStaticFloatField(clazz.
obj(), fid));
1996 auto java_object = java_object_.
get(env);
1997 if (java_object.is_null()) {
2002 env, env->GetObjectClass(java_object.obj()));
2003 if (clazz.is_null()) {
2007 jfieldID fid = env->GetStaticFieldID(clazz.
obj(),
"displayHeight",
"F");
2008 return static_cast<double>(env->GetStaticFloatField(clazz.
obj(), fid));
2014 auto java_object = java_object_.
get(env);
2015 if (java_object.is_null()) {
2020 env, env->GetObjectClass(java_object.obj()));
2021 if (clazz.is_null()) {
2025 jfieldID fid = env->GetStaticFieldID(clazz.
obj(),
"displayDensity",
"F");
2026 return static_cast<double>(env->GetStaticFloatField(clazz.
obj(), fid));
2030 int loading_unit_id) {
2033 auto java_object = java_object_.
get(env);
2034 if (java_object.is_null()) {
2050 auto java_object = java_object_.
get(env);
2051 if (java_object.is_null()) {
2057 env->CallObjectMethod(java_object.obj(), g_create_transaction_method));
2058 if (transaction.is_null()) {
2064 env, transaction.
obj());
2070 auto java_object = java_object_.
get(env);
2071 if (java_object.is_null()) {
2075 env->CallVoidMethod(java_object.obj(), g_swap_transaction_method);
2083 auto java_object = java_object_.
get(env);
2084 if (java_object.is_null()) {
2088 env->CallVoidMethod(java_object.obj(), g_apply_transaction_method);
2093std::unique_ptr<PlatformViewAndroidJNI::OverlayMetadata>
2097 auto java_object = java_object_.
get(env);
2098 if (java_object.is_null()) {
2103 env, env->CallObjectMethod(java_object.obj(),
2104 g_create_overlay_surface2_method));
2107 if (overlay.is_null()) {
2108 return std::make_unique<PlatformViewAndroidJNI::OverlayMetadata>(0,
2115 jobject overlay_surface =
2118 auto overlay_window = fml::MakeRefCounted<AndroidNativeWindow>(
2119 ANativeWindow_fromSurface(env, overlay_surface));
2121 return std::make_unique<PlatformViewAndroidJNI::OverlayMetadata>(
2122 overlay_id, std::move(overlay_window));
2128 auto java_object = java_object_.
get(env);
2129 if (java_object.is_null()) {
2133 env->CallVoidMethod(java_object.obj(), g_destroy_overlay_surface2_method);
2141 explicit AndroidPathReceiver(JNIEnv* env)
2146 jfieldID fill_type_field_id;
2148 case DlPathFillType::kOdd:
2151 case DlPathFillType::kNonZero:
2165 fill_type_field_id));
2171 fill_type_enum.
obj());
2183 cp.x, cp.y,
p2.x,
p2.y);
2197 cp1.x, cp1.y, cp2.x, cp2.y,
p2.x,
p2.y);
2199 void Close()
override {
2203 jobject TakePath()
const {
return android_path_; }
2207 jobject android_path_;
2221 auto java_object = java_object_.
get(env);
2222 if (java_object.is_null()) {
2229 std::vector<std::shared_ptr<Mutator>>::const_iterator iter =
2230 mutators_stack.
Begin();
2231 while (iter != mutators_stack.
End()) {
2232 switch ((*iter)->GetType()) {
2234 const DlMatrix& matrix = (*iter)->GetMatrix();
2236 matrix.
m[0], matrix.
m[4], matrix.
m[12],
2237 matrix.
m[1], matrix.
m[5], matrix.
m[13],
2238 matrix.
m[3], matrix.
m[7], matrix.
m[15],
2241 env, env->NewFloatArray(9));
2243 env->SetFloatArrayRegion(transformMatrix.
obj(), 0, 9, matrix_array);
2244 env->CallVoidMethod(mutatorsStack,
2246 transformMatrix.
obj());
2250 const DlRect& rect = (*iter)->GetRect();
2251 env->CallVoidMethod(mutatorsStack,
2253 static_cast<int>(rect.
GetLeft()),
2254 static_cast<int>(rect.
GetTop()),
2263 SkScalar radiis[8] = {
2270 env, env->NewFloatArray(8));
2271 env->SetFloatArrayRegion(radiisArray.
obj(), 0, 8, radiis);
2272 env->CallVoidMethod(mutatorsStack,
2274 static_cast<int>(rect.
GetLeft()),
2275 static_cast<int>(rect.
GetTop()),
2282 const DlRoundRect& rrect = (*iter)->GetRSEApproximation();
2285 SkScalar radiis[8] = {
2292 env, env->NewFloatArray(8));
2293 env->SetFloatArrayRegion(radiisArray.
obj(), 0, 8, radiis);
2294 env->CallVoidMethod(mutatorsStack,
2296 static_cast<int>(rect.
GetLeft()),
2297 static_cast<int>(rect.
GetTop()),
2304 float opacity = (*iter)->GetAlphaFloat();
2310 auto& dlPath = (*iter)->GetPath();
2320 AndroidPathReceiver receiver(env);
2321 receiver.SetFillType(dlPath.GetFillType());
2326 dlPath.Dispatch(receiver);
2328 env->CallVoidMethod(mutatorsStack,
2330 receiver.TakePath());
2345 env->CallVoidMethod(java_object.obj(), g_on_display_platform_view2_method,
2354 auto java_object = java_object_.
get(env);
2355 if (java_object.is_null()) {
2359 env->CallVoidMethod(java_object.obj(), g_hide_platform_view2_method,
view_id);
2365 auto java_object = java_object_.
get(env);
2366 if (java_object.is_null()) {
2370 env->CallVoidMethod(java_object.obj(), g_on_end_frame2_method);
2378 auto java_object = java_object_.
get(env);
2379 if (java_object.is_null()) {
2383 env->CallVoidMethod(java_object.obj(), g_show_overlay_surface2_method);
2390 auto java_object = java_object_.
get(env);
2391 if (java_object.is_null()) {
2395 env->CallVoidMethod(java_object.obj(), g_hide_overlay_surface2_method);
2403 auto java_object = java_object_.
get(env);
2404 if (java_object.is_null()) {
2408 env->CallVoidMethod(java_object.obj(), g_maybe_resize_surface_view,
width,
static std::unique_ptr< DartCallbackRepresentation > GetCallbackInformation(int64_t handle)
static const char * kIsolateDataSymbol
static const char * kIsolateInstructionsSymbol
const flutter::Settings & GetSettings() const
static FlutterMain & Get()
ImageLifecycle
Whether the last image should be reset when the context is destroyed.
const std::vector< std::shared_ptr< Mutator > >::const_iterator End() const
const std::vector< std::shared_ptr< Mutator > >::const_iterator Begin() const
A Mapping like NonOwnedMapping, but uses Free as its release proc.
static MallocMapping Copy(const T *begin, const T *end)
static fml::RefPtr< NativeLibrary > CreateWithHandle(Handle handle, bool close_handle_when_done)
ScopedJavaLocalRef< jobject > get(JNIEnv *env) const
Collection of functions to receive path segments from the underlying path representation via the DlPa...
FlutterVulkanImage * image
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
G_BEGIN_DECLS FlutterViewId view_id
#define FML_LOG(severity)
#define FML_CHECK(condition)
#define FML_DCHECK(condition)
std::shared_ptr< SkBitmap > bitmap
static jmethodID g_hardware_buffer_close_method
impeller::Scalar DlScalar
static void RunBundleAndSnapshotFromLibrary(JNIEnv *env, jobject jcaller, jlong shell_holder, jstring jBundlePath, jstring jEntrypoint, jstring jLibraryUrl, jobject jAssetManager, jobject jEntrypointArgs, jlong engineId)
static jmethodID g_mutators_stack_init_method
constexpr int64_t kFlutterImplicitViewId
static jfieldID g_jni_shell_holder_field
static void InvokePlatformMessageResponseCallback(JNIEnv *env, jobject jcaller, jlong shell_holder, jint responseId, jobject message, jint position)
static jmethodID g_request_dart_deferred_library_method
static jboolean GetIsSoftwareRendering(JNIEnv *env, jobject jcaller)
static bool IsSurfaceControlEnabled(JNIEnv *env, jobject jcaller, jlong shell_holder)
static void DispatchPointerDataPacket(JNIEnv *env, jobject jcaller, jlong shell_holder, jobject buffer, jint position)
bool RegisterApi(JNIEnv *env)
static jmethodID g_mutators_stack_push_clippath_method
static jboolean FlutterTextUtilsIsEmojiModifier(JNIEnv *env, jobject obj, jint codePoint)
static fml::jni::ScopedJavaGlobalRef< jclass > * path_class
static fml::jni::ScopedJavaGlobalRef< jclass > * g_java_long_class
static void LoadLoadingUnitFailure(intptr_t loading_unit_id, const std::string &message, bool transient)
static void InvokePlatformMessageEmptyResponseCallback(JNIEnv *env, jobject jcaller, jlong shell_holder, jint responseId)
impeller::ISize32 DlISize
static jmethodID g_acquire_latest_image_method
static jmethodID g_mutators_stack_push_transform_method
static fml::jni::ScopedJavaGlobalRef< jclass > * g_bitmap_class
std::nullptr_t JavaLocalRef
static void SurfaceDestroyed(JNIEnv *env, jobject jcaller, jlong shell_holder)
static jmethodID path_line_to_method
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
static jmethodID path_quad_to_method
static jmethodID g_long_constructor
static void DestroyJNI(JNIEnv *env, jobject jcaller, jlong shell_holder)
static void DispatchSemanticsAction(JNIEnv *env, jobject jcaller, jlong shell_holder, jint id, jint action, jobject args, jint args_position)
static jmethodID g_jni_constructor
static void MarkTextureFrameAvailable(JNIEnv *env, jobject jcaller, jlong shell_holder, jlong texture_id)
static jmethodID g_attach_to_gl_context_method
static jfieldID g_path_fill_type_even_odd_field
static void SetSemanticsEnabled(JNIEnv *env, jobject jcaller, jlong shell_holder, jboolean enabled)
static void DeferredComponentInstallFailure(JNIEnv *env, jobject obj, jint jLoadingUnitId, jstring jError, jboolean jTransient)
static jobject SpawnJNI(JNIEnv *env, jobject jcaller, jlong shell_holder, jstring jEntrypoint, jstring jLibraryUrl, jstring jInitialRoute, jobject jEntrypointArgs, jlong engineId)
@ kBackdropClipRSuperellipse
static jfieldID g_path_fill_type_winding_field
static fml::jni::ScopedJavaGlobalRef< jclass > * g_texture_wrapper_class
static void LoadDartDeferredLibrary(JNIEnv *env, jobject obj, jlong shell_holder, jint jLoadingUnitId, jobjectArray jSearchPaths)
static jmethodID g_java_weak_reference_get_method
static void NotifyLowMemoryWarning(JNIEnv *env, jobject obj, jlong shell_holder)
static jboolean FlutterTextUtilsIsVariationSelector(JNIEnv *env, jobject obj, jint codePoint)
static jmethodID g_image_get_hardware_buffer_method
static void CleanupMessageData(JNIEnv *env, jobject jcaller, jlong message_data)
static jmethodID g_mutators_stack_push_cliprect_method
static jmethodID g_overlay_surface_surface_method
static void SetViewportMetrics(JNIEnv *env, jobject jcaller, jlong shell_holder, jfloat devicePixelRatio, jint physicalWidth, jint physicalHeight, jint physicalPaddingTop, jint physicalPaddingRight, jint physicalPaddingBottom, jint physicalPaddingLeft, jint physicalViewInsetTop, jint physicalViewInsetRight, jint physicalViewInsetBottom, jint physicalViewInsetLeft, jint systemGestureInsetTop, jint systemGestureInsetRight, jint systemGestureInsetBottom, jint systemGestureInsetLeft, jint physicalTouchSlop, jintArray javaDisplayFeaturesBounds, jintArray javaDisplayFeaturesType, jintArray javaDisplayFeaturesState, jint physicalMinWidth, jint physicalMaxWidth, jint physicalMinHeight, jint physicalMaxHeight, jint physicalDisplayCornerRadiusTopLeft, jint physicalDisplayCornerRadiusTopRight, jint physicalDisplayCornerRadiusBottomRight, jint physicalDisplayCornerRadiusBottomLeft)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
static void DispatchPlatformMessage(JNIEnv *env, jobject jcaller, jlong shell_holder, jstring channel, jobject message, jint position, jint responseId)
static jmethodID g_overlay_surface_id_method
static jmethodID g_mutators_stack_push_cliprrect_method
static jmethodID g_get_transform_matrix_method
static jmethodID path_cubic_to_method
static jmethodID g_compute_platform_resolved_locale_method
static void SurfaceWindowChanged(JNIEnv *env, jobject jcaller, jlong shell_holder, jobject jsurface)
static jmethodID g_bitmap_copy_pixels_from_buffer_method
impeller::FillType DlPathFillType
static void RegisterImageTexture(JNIEnv *env, jobject jcaller, jlong shell_holder, jlong texture_id, jobject image_texture_entry, jboolean reset_on_background)
static fml::jni::ScopedJavaGlobalRef< jclass > * g_flutter_jni_class
static fml::jni::ScopedJavaGlobalRef< jclass > * g_bitmap_config_class
static jmethodID g_surface_texture_wrapper_should_update
static fml::jni::ScopedJavaGlobalRef< jclass > * g_image_class
static void SurfaceCreated(JNIEnv *env, jobject jcaller, jlong shell_holder, jobject jsurface)
static jmethodID g_flutter_callback_info_constructor
static jmethodID path_set_fill_type_method
static void DispatchEmptyPlatformMessage(JNIEnv *env, jobject jcaller, jlong shell_holder, jstring channel, jint responseId)
static fml::jni::ScopedJavaGlobalRef< jclass > * g_path_fill_type_class
static void ScheduleFrame(JNIEnv *env, jobject jcaller, jlong shell_holder)
static jmethodID path_move_to_method
static jlong AttachJNI(JNIEnv *env, jclass clazz, jobject flutterJNI)
static void SetAccessibilityFeatures(JNIEnv *env, jobject jcaller, jlong shell_holder, jint flags)
static jmethodID g_update_tex_image_method
static fml::jni::ScopedJavaGlobalRef< jclass > * g_java_weak_reference_class
static jmethodID g_image_close_method
static void UpdateDisplayMetrics(JNIEnv *env, jobject jcaller, jlong shell_holder)
static jmethodID g_mutators_stack_push_opacity_method
static void SurfaceChanged(JNIEnv *env, jobject jcaller, jlong shell_holder, jint width, jint height)
static jmethodID g_bitmap_config_value_of
static fml::jni::ScopedJavaGlobalRef< jclass > * g_image_consumer_texture_registry_interface
static void UpdateJavaAssetManager(JNIEnv *env, jobject obj, jlong shell_holder, jobject jAssetManager, jstring jAssetBundlePath)
static jobject GetBitmap(JNIEnv *env, jobject jcaller, jlong shell_holder)
static jmethodID path_constructor
static jmethodID g_bitmap_create_bitmap_method
static void UnregisterTexture(JNIEnv *env, jobject jcaller, jlong shell_holder, jlong texture_id)
static fml::jni::ScopedJavaGlobalRef< jclass > * g_flutter_callback_info_class
static fml::jni::ScopedJavaGlobalRef< jclass > * g_mutators_stack_class
static jmethodID path_close_method
static jboolean FlutterTextUtilsIsEmojiModifierBase(JNIEnv *env, jobject obj, jint codePoint)
static jobject LookupCallbackInformation(JNIEnv *env, jobject, jlong handle)
static jboolean FlutterTextUtilsIsRegionalIndicator(JNIEnv *env, jobject obj, jint codePoint)
static jmethodID g_detach_from_gl_context_method
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set profile Make the profiler discard new samples once the profiler sample buffer is full When this flag is not the profiler sample buffer is used as a ring buffer
static jmethodID path_conic_to_method
static fml::jni::ScopedJavaGlobalRef< jclass > * g_hardware_buffer_class
static jboolean FlutterTextUtilsIsEmoji(JNIEnv *env, jobject obj, jint codePoint)
static void RegisterTexture(JNIEnv *env, jobject jcaller, jlong shell_holder, jlong texture_id, jobject surface_texture)
static constexpr double kUnknownDisplayRefreshRate
To be used when the display refresh rate is unknown.
JNIEnv * AttachCurrentThread()
ScopedJavaLocalRef< jobjectArray > VectorToBufferArray(JNIEnv *env, const std::vector< std::vector< uint8_t > > &vector)
std::string JavaStringToString(JNIEnv *env, jstring str)
bool ClearException(JNIEnv *env, bool silent)
bool CheckException(JNIEnv *env)
ScopedJavaLocalRef< jobjectArray > VectorToStringArray(JNIEnv *env, const std::vector< std::string > &vector)
std::vector< std::string > StringListToVector(JNIEnv *env, jobject list)
std::vector< std::string > StringArrayToVector(JNIEnv *env, jobjectArray array)
ScopedJavaLocalRef< jstring > StringToJavaString(JNIEnv *env, const std::string &u8_string)
const ProcTable & GetProcTable()
void MoveTo(PathBuilder *builder, Scalar x, Scalar y)
void LineTo(PathBuilder *builder, Scalar x, Scalar y)
void CubicTo(PathBuilder *builder, Scalar x1, Scalar y1, Scalar x2, Scalar y2, Scalar x3, Scalar y3)
void Close(PathBuilder *builder)
impeller::ShaderType type
bool enable_software_rendering
A 4x4 matrix using column-major storage.
constexpr const RoundingRadii & GetRadii() const
constexpr const Rect & GetBounds() const
constexpr auto GetBottom() const
constexpr auto GetTop() const
constexpr auto GetLeft() const
constexpr auto GetRight() const