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]);
384 static_cast<double>(devicePixelRatio),
385 static_cast<double>(physicalWidth),
386 static_cast<double>(physicalHeight),
387 static_cast<double>(physicalMinWidth),
388 static_cast<double>(physicalMaxWidth),
393 static_cast<double>(physicalPaddingTop),
394 static_cast<double>(physicalPaddingRight),
395 static_cast<double>(physicalPaddingBottom),
396 static_cast<double>(physicalPaddingLeft),
397 static_cast<double>(physicalViewInsetTop),
399 physicalViewInsetRight),
401 physicalViewInsetBottom),
402 static_cast<double>(physicalViewInsetLeft),
404 systemGestureInsetTop),
406 systemGestureInsetRight),
408 systemGestureInsetBottom),
410 systemGestureInsetLeft),
411 static_cast<double>(physicalTouchSlop),
412 displayFeaturesBounds,
414 displayFeaturesState,
417 physicalDisplayCornerRadiusTopLeft),
419 physicalDisplayCornerRadiusTopRight),
421 physicalDisplayCornerRadiusBottomRight),
423 physicalDisplayCornerRadiusBottomLeft),
432 jlong shell_holder) {
438 jlong shell_holder) {
442static jobject
GetBitmap(JNIEnv* env, jobject jcaller, jlong shell_holder) {
445 if (screenshot.data ==
nullptr) {
449 jstring argb = env->NewStringUTF(
"ARGB_8888");
450 if (argb ==
nullptr) {
454 jobject bitmap_config = env->CallStaticObjectMethod(
456 if (bitmap_config ==
nullptr) {
460 auto bitmap = env->CallStaticObjectMethod(
462 screenshot.frame_size.width, screenshot.frame_size.height, bitmap_config);
466 env->NewDirectByteBuffer(
const_cast<uint8_t*
>(screenshot.data->bytes()),
467 screenshot.data->size()));
505 jlong message_data) {
507 free(
reinterpret_cast<void*
>(message_data));
515 uint8_t*
data =
static_cast<uint8_t*
>(env->GetDirectBufferAddress(
buffer));
516 auto packet = std::make_unique<flutter::PointerDataPacket>(
data, position);
527 jint args_position) {
559 jobject surface_texture) {
570 jobject image_texture_entry,
571 jboolean reset_on_background) {
599static void ScheduleFrame(JNIEnv* env, jobject jcaller, jlong shell_holder) {
609 uint8_t* response_data =
610 static_cast<uint8_t*
>(env->GetDirectBufferAddress(
message));
612 auto mapping = std::make_unique<fml::MallocMapping>(
615 ->InvokePlatformMessageResponseCallback(responseId, std::move(mapping));
623 ->InvokePlatformMessageEmptyResponseCallback(responseId);
628 jlong shell_holder) {
635 return u_hasBinaryProperty(codePoint, UProperty::UCHAR_EMOJI);
641 return u_hasBinaryProperty(codePoint, UProperty::UCHAR_EMOJI_MODIFIER);
647 return u_hasBinaryProperty(codePoint, UProperty::UCHAR_EMOJI_MODIFIER_BASE);
653 return u_hasBinaryProperty(codePoint, UProperty::UCHAR_VARIATION_SELECTOR);
659 return u_hasBinaryProperty(codePoint, UProperty::UCHAR_REGIONAL_INDICATOR);
672 jboolean jTransient) {
675 static_cast<bool>(jTransient));
682 jobjectArray jSearchPaths) {
684 intptr_t loading_unit_id =
static_cast<intptr_t
>(jLoadingUnitId);
685 std::vector<std::string> search_paths =
690 void* handle =
nullptr;
691 while (handle ==
nullptr && !search_paths.empty()) {
692 std::string
path = search_paths.back();
693 handle = ::dlopen(
path.c_str(), RTLD_NOW);
694 search_paths.pop_back();
696 if (handle ==
nullptr) {
698 "No lib .so found for provided search paths.",
true);
705 std::unique_ptr<const fml::SymbolMapping> data_mapping =
706 std::make_unique<const fml::SymbolMapping>(
708 std::unique_ptr<const fml::SymbolMapping> instructions_mapping =
709 std::make_unique<const fml::SymbolMapping>(
713 loading_unit_id, std::move(data_mapping),
714 std::move(instructions_mapping));
720 jobject jAssetManager,
721 jstring jAssetBundlePath) {
722 auto asset_resolver = std::make_unique<flutter::APKAssetProvider>(
728 std::move(asset_resolver),
733 static const JNINativeMethod flutter_jni_methods[] = {
736 .name =
"nativeAttach",
737 .signature =
"(Lio/flutter/embedding/engine/FlutterJNI;)J",
738 .fnPtr =
reinterpret_cast<void*
>(&
AttachJNI),
741 .name =
"nativeDestroy",
743 .fnPtr =
reinterpret_cast<void*
>(&
DestroyJNI),
746 .name =
"nativeSpawn",
747 .signature =
"(JLjava/lang/String;Ljava/lang/String;Ljava/lang/"
748 "String;Ljava/util/List;J)Lio/flutter/"
749 "embedding/engine/FlutterJNI;",
750 .fnPtr =
reinterpret_cast<void*
>(&
SpawnJNI),
753 .name =
"nativeRunBundleAndSnapshotFromLibrary",
754 .signature =
"(JLjava/lang/String;Ljava/lang/String;"
755 "Ljava/lang/String;Landroid/content/res/"
756 "AssetManager;Ljava/util/List;J)V",
760 .name =
"nativeDispatchEmptyPlatformMessage",
761 .signature =
"(JLjava/lang/String;I)V",
765 .name =
"nativeCleanupMessageData",
770 .name =
"nativeDispatchPlatformMessage",
771 .signature =
"(JLjava/lang/String;Ljava/nio/ByteBuffer;II)V",
775 .name =
"nativeInvokePlatformMessageResponseCallback",
776 .signature =
"(JILjava/nio/ByteBuffer;I)V",
781 .name =
"nativeInvokePlatformMessageEmptyResponseCallback",
782 .signature =
"(JI)V",
783 .fnPtr =
reinterpret_cast<void*
>(
787 .name =
"nativeNotifyLowMemoryWarning",
794 .name =
"nativeGetBitmap",
795 .signature =
"(J)Landroid/graphics/Bitmap;",
796 .fnPtr =
reinterpret_cast<void*
>(&
GetBitmap),
799 .name =
"nativeSurfaceCreated",
800 .signature =
"(JLandroid/view/Surface;)V",
804 .name =
"nativeSurfaceWindowChanged",
805 .signature =
"(JLandroid/view/Surface;)V",
809 .name =
"nativeSurfaceChanged",
810 .signature =
"(JII)V",
814 .name =
"nativeSurfaceDestroyed",
819 .name =
"nativeSetViewportMetrics",
820 .signature =
"(JFIIIIIIIIIIIIIII[I[I[IIIIIIIII)V",
824 .name =
"nativeDispatchPointerDataPacket",
825 .signature =
"(JLjava/nio/ByteBuffer;I)V",
829 .name =
"nativeDispatchSemanticsAction",
830 .signature =
"(JIILjava/nio/ByteBuffer;I)V",
834 .name =
"nativeSetSemanticsEnabled",
835 .signature =
"(JZ)V",
839 .name =
"nativeSetAccessibilityFeatures",
840 .signature =
"(JI)V",
844 .name =
"nativeGetIsSoftwareRenderingEnabled",
849 .name =
"nativeRegisterTexture",
850 .signature =
"(JJLjava/lang/ref/"
855 .name =
"nativeRegisterImageTexture",
856 .signature =
"(JJLjava/lang/ref/"
861 .name =
"nativeMarkTextureFrameAvailable",
862 .signature =
"(JJ)V",
866 .name =
"nativeScheduleFrame",
871 .name =
"nativeUnregisterTexture",
872 .signature =
"(JJ)V",
877 .name =
"nativeLookupCallbackInformation",
878 .signature =
"(J)Lio/flutter/view/FlutterCallbackInformation;",
884 .name =
"nativeFlutterTextUtilsIsEmoji",
889 .name =
"nativeFlutterTextUtilsIsEmojiModifier",
894 .name =
"nativeFlutterTextUtilsIsEmojiModifierBase",
900 .name =
"nativeFlutterTextUtilsIsVariationSelector",
906 .name =
"nativeFlutterTextUtilsIsRegionalIndicator",
912 .name =
"nativeLoadDartDeferredLibrary",
913 .signature =
"(JI[Ljava/lang/String;)V",
917 .name =
"nativeUpdateJavaAssetManager",
919 "(JLandroid/content/res/AssetManager;Ljava/lang/String;)V",
923 .name =
"nativeDeferredComponentInstallFailure",
924 .signature =
"(ILjava/lang/String;Z)V",
928 .name =
"nativeUpdateDisplayMetrics",
933 .name =
"nativeIsSurfaceControlEnabled",
939 std::size(flutter_jni_methods)) != 0) {
940 FML_LOG(ERROR) <<
"Failed to RegisterNatives with FlutterJNI";
948 FML_LOG(ERROR) <<
"Could not locate FlutterJNI's nativeShellHolderId field";
956 FML_LOG(ERROR) <<
"Could not locate FlutterJNI's constructor";
961 "valueOf",
"(J)Ljava/lang/Long;");
963 FML_LOG(ERROR) <<
"Could not locate Long's constructor";
970 env, env->FindClass(
"io/flutter/embedding/engine/FlutterOverlaySurface"));
971 if (overlay_surface_class.is_null()) {
972 FML_LOG(ERROR) <<
"Could not locate FlutterOverlaySurface class";
976 env->GetMethodID(overlay_surface_class.
obj(),
"getId",
"()I");
978 FML_LOG(ERROR) <<
"Could not locate FlutterOverlaySurface#getId() method";
982 overlay_surface_class.
obj(),
"getSurface",
"()Landroid/view/Surface;");
985 <<
"Could not locate FlutterOverlaySurface#getSurface() method";
990 env, env->FindClass(
"android/graphics/Bitmap"));
992 FML_LOG(ERROR) <<
"Could not locate Bitmap Class";
998 "(IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;");
1000 FML_LOG(ERROR) <<
"Could not locate Bitmap.createBitmap method";
1005 g_bitmap_class->obj(),
"copyPixelsFromBuffer",
"(Ljava/nio/Buffer;)V");
1007 FML_LOG(ERROR) <<
"Could not locate Bitmap.copyPixelsFromBuffer method";
1012 env, env->FindClass(
"android/graphics/Bitmap$Config"));
1014 FML_LOG(ERROR) <<
"Could not locate Bitmap.Config Class";
1020 "(Ljava/lang/String;)Landroid/graphics/Bitmap$Config;");
1022 FML_LOG(ERROR) <<
"Could not locate Bitmap.Config.valueOf method";
1030 if (env ==
nullptr) {
1031 FML_LOG(ERROR) <<
"No JNIEnv provided";
1036 env, env->FindClass(
"io/flutter/view/FlutterCallbackInformation"));
1038 FML_LOG(ERROR) <<
"Could not locate FlutterCallbackInformation class";
1044 "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
1046 FML_LOG(ERROR) <<
"Could not locate FlutterCallbackInformation constructor";
1051 env, env->FindClass(
"io/flutter/embedding/engine/FlutterJNI"));
1053 FML_LOG(ERROR) <<
"Failed to find FlutterJNI Class.";
1060 "io/flutter/embedding/engine/mutatorsstack/FlutterMutatorsStack"));
1062 FML_LOG(ERROR) <<
"Could not locate FlutterMutatorsStack";
1069 FML_LOG(ERROR) <<
"Could not locate FlutterMutatorsStack.init method";
1077 <<
"Could not locate FlutterMutatorsStack.pushTransform method";
1085 <<
"Could not locate FlutterMutatorsStack.pushClipRect method";
1093 <<
"Could not locate FlutterMutatorsStack.pushClipRRect method";
1101 <<
"Could not locate FlutterMutatorsStack.pushOpacity method";
1107 "(Landroid/graphics/Path;)V");
1110 <<
"Could not locate FlutterMutatorsStack.pushClipPath method";
1115 env, env->FindClass(
"java/lang/ref/WeakReference"));
1117 FML_LOG(ERROR) <<
"Could not locate WeakReference class";
1124 FML_LOG(ERROR) <<
"Could not locate WeakReference.get method";
1129 env, env->FindClass(
1130 "io/flutter/embedding/engine/renderer/SurfaceTextureWrapper"));
1132 FML_LOG(ERROR) <<
"Could not locate SurfaceTextureWrapper class";
1140 FML_LOG(ERROR) <<
"Could not locate attachToGlContext method";
1149 <<
"Could not locate SurfaceTextureWrapper.shouldUpdate method";
1157 FML_LOG(ERROR) <<
"Could not locate updateTexImage method";
1165 FML_LOG(ERROR) <<
"Could not locate getTransformMatrix method";
1173 FML_LOG(ERROR) <<
"Could not locate detachFromGlContext method";
1178 env, env->FindClass(
"io/flutter/view/TextureRegistry$ImageConsumer"));
1180 FML_LOG(ERROR) <<
"Could not locate TextureRegistry.ImageConsumer class";
1186 "acquireLatestImage",
"()Landroid/media/Image;");
1188 FML_LOG(ERROR) <<
"Could not locate acquireLatestImage on "
1189 "TextureRegistry.ImageConsumer class";
1194 env, env->FindClass(
"android/media/Image"));
1196 FML_LOG(ERROR) <<
"Could not locate Image class";
1205 "()Landroid/hardware/HardwareBuffer;");
1215 FML_LOG(ERROR) <<
"Could not locate close on Image class";
1222 env, env->FindClass(
"android/hardware/HardwareBuffer"));
1238 "([Ljava/lang/String;)[Ljava/lang/String;");
1241 FML_LOG(ERROR) <<
"Could not locate computePlatformResolvedLocale method";
1249 FML_LOG(ERROR) <<
"Could not locate requestDartDeferredLibrary method";
1254 env, env->FindClass(
"java/lang/Long"));
1256 FML_LOG(ERROR) <<
"Could not locate java.lang.Long class";
1262 env, env->FindClass(
"android/graphics/Path"));
1264 FML_LOG(ERROR) <<
"Could not locate android.graphics.Path class";
1270 FML_LOG(ERROR) <<
"Could not locate android.graphics.Path constructor";
1275 path_class->obj(),
"setFillType",
"(Landroid/graphics/Path$FillType;)V");
1278 <<
"Could not locate android.graphics.Path.setFillType method";
1284 FML_LOG(ERROR) <<
"Could not locate android.graphics.Path.moveTo method";
1289 FML_LOG(ERROR) <<
"Could not locate android.graphics.Path.lineTo method";
1293 env->GetMethodID(
path_class->obj(),
"quadTo",
"(FFFF)V");
1295 FML_LOG(ERROR) <<
"Could not locate android.graphics.Path.quadTo method";
1299 env->GetMethodID(
path_class->obj(),
"cubicTo",
"(FFFFFF)V");
1301 FML_LOG(ERROR) <<
"Could not locate android.graphics.Path.cubicTo method";
1308 env->GetMethodID(
path_class->obj(),
"conicTo",
"(FFFFF)V");
1315 FML_LOG(ERROR) <<
"Could not locate android.graphics.Path.close method";
1320 env, env->FindClass(
"android/graphics/Path$FillType"));
1322 FML_LOG(ERROR) <<
"Could not locate android.graphics.Path$FillType class";
1328 "Landroid/graphics/Path$FillType;");
1330 FML_LOG(ERROR) <<
"Could not locate Path.FillType.WINDING field";
1336 "Landroid/graphics/Path$FillType;");
1338 FML_LOG(ERROR) <<
"Could not locate Path.FillType.EVEN_ODD field";
1347 : java_object_(java_object) {}
1352 std::unique_ptr<flutter::PlatformMessage>
message,
1357 auto java_object = java_object_.
get(env);
1358 if (java_object.is_null()) {
1367 env, env->NewDirectByteBuffer(
1368 const_cast<uint8_t*
>(
message->data().GetMapping()),
1372 env->CallVoidMethod(java_object.obj(), g_handle_platform_message_method,
1373 java_channel.
obj(), message_array.
obj(), responseId,
1374 reinterpret_cast<jlong
>(mapping.
Release()));
1376 env->CallVoidMethod(java_object.obj(), g_handle_platform_message_method,
1377 java_channel.
obj(),
nullptr, responseId,
nullptr);
1384 std::string locale) {
1387 auto java_object = java_object_.
get(env);
1388 if (java_object.is_null()) {
1395 env->CallVoidMethod(java_object.obj(), g_set_application_locale_method,
1405 auto java_object = java_object_.
get(env);
1406 if (java_object.is_null()) {
1410 env->CallVoidMethod(java_object.obj(), g_set_semantics_tree_enabled_method,
1418 std::unique_ptr<fml::Mapping>
data) {
1423 auto java_object = java_object_.
get(env);
1424 if (java_object.is_null()) {
1429 if (
data ==
nullptr) {
1430 env->CallVoidMethod(java_object.obj(),
1431 g_handle_platform_message_response_method, responseId,
1436 env, env->NewDirectByteBuffer(
const_cast<uint8_t*
>(
data->GetMapping()),
1439 env->CallVoidMethod(java_object.obj(),
1440 g_handle_platform_message_response_method, responseId,
1449 int configuration_id)
const {
1452 auto java_object = java_object_.
get(env);
1453 if (java_object.is_null()) {
1457 const jfloat scaledSize = env->CallFloatMethod(
1458 java_object.obj(), g_get_scaled_font_size_method,
1459 static_cast<jfloat
>(
font_size),
static_cast<jint
>(configuration_id));
1461 return static_cast<double>(scaledSize);
1465 std::vector<uint8_t> buffer,
1466 std::vector<std::string> strings,
1467 std::vector<std::vector<uint8_t>> string_attribute_args) {
1470 auto java_object = java_object_.
get(env);
1471 if (java_object.is_null()) {
1476 env, env->NewDirectByteBuffer(
buffer.data(),
buffer.size()));
1482 env->CallVoidMethod(java_object.obj(), g_update_semantics_method,
1483 direct_buffer.
obj(), jstrings.
obj(),
1484 jstring_attribute_args.
obj());
1490 std::vector<uint8_t> actions_buffer,
1491 std::vector<std::string> strings) {
1494 auto java_object = java_object_.
get(env);
1495 if (java_object.is_null()) {
1501 env->NewDirectByteBuffer(actions_buffer.data(), actions_buffer.size()));
1506 env->CallVoidMethod(java_object.obj(),
1507 g_update_custom_accessibility_actions_method,
1508 direct_actions_buffer.
obj(), jstrings.
obj());
1516 auto java_object = java_object_.
get(env);
1517 if (java_object.is_null()) {
1521 env->CallVoidMethod(java_object.obj(), g_on_first_frame_method);
1529 auto java_object = java_object_.
get(env);
1530 if (java_object.is_null()) {
1534 env->CallVoidMethod(java_object.obj(), g_on_engine_restart_method);
1544 if (surface_texture.is_null()) {
1549 env, env->CallObjectMethod(surface_texture.obj(),
1552 if (surface_texture_local_ref.is_null()) {
1556 env->CallVoidMethod(surface_texture_local_ref.
obj(),
1566 if (surface_texture.is_null()) {
1571 env, env->CallObjectMethod(surface_texture.obj(),
1573 if (surface_texture_local_ref.is_null()) {
1577 jboolean shouldUpdate = env->CallBooleanMethod(
1582 return shouldUpdate;
1589 if (surface_texture.is_null()) {
1594 env, env->CallObjectMethod(surface_texture.obj(),
1596 if (surface_texture_local_ref.is_null()) {
1600 env->CallVoidMethod(surface_texture_local_ref.
obj(),
1610 if (surface_texture.is_null()) {
1615 env, env->CallObjectMethod(surface_texture.obj(),
1617 if (surface_texture_local_ref.is_null()) {
1622 env, env->NewFloatArray(16));
1624 env->CallVoidMethod(surface_texture_local_ref.
obj(),
1628 float* m = env->GetFloatArrayElements(transformMatrix.
obj(),
nullptr);
1630 static_assert(
sizeof(SkScalar) ==
sizeof(
float));
1631 const auto transform = SkM44::ColMajor(m);
1633 env->ReleaseFloatArrayElements(transformMatrix.
obj(), m, JNI_ABORT);
1642 if (surface_texture.is_null()) {
1647 env, env->CallObjectMethod(surface_texture.obj(),
1649 if (surface_texture_local_ref.is_null()) {
1653 env->CallVoidMethod(surface_texture_local_ref.
obj(),
1664 if (image_producer_texture_entry.is_null()) {
1672 env, env->CallObjectMethod(image_producer_texture_entry.obj(),
1675 if (image_producer_texture_entry_local_ref.is_null()) {
1681 env, env->CallObjectMethod(image_producer_texture_entry_local_ref.
obj(),
1694 if (
image.is_null()) {
1707 if (
image.is_null()) {
1718 if (hardware_buffer.is_null()) {
1735 auto java_object = java_object_.
get(env);
1736 if (java_object.is_null()) {
1743 std::vector<std::shared_ptr<Mutator>>::const_iterator iter =
1744 mutators_stack.
Begin();
1745 while (iter != mutators_stack.
End()) {
1746 switch ((*iter)->GetType()) {
1748 const DlMatrix& matrix = (*iter)->GetMatrix();
1750 matrix.
m[0], matrix.
m[4], matrix.
m[12],
1751 matrix.
m[1], matrix.
m[5], matrix.
m[13],
1752 matrix.
m[3], matrix.
m[7], matrix.
m[15],
1755 env, env->NewFloatArray(9));
1757 env->SetFloatArrayRegion(transformMatrix.
obj(), 0, 9, matrix_array);
1758 env->CallVoidMethod(mutatorsStack,
1760 transformMatrix.
obj());
1764 const DlRect& rect = (*iter)->GetRect();
1765 env->CallVoidMethod(mutatorsStack,
1767 static_cast<int>(rect.
GetLeft()),
1768 static_cast<int>(rect.
GetTop()),
1777 SkScalar radiis[8] = {
1784 env, env->NewFloatArray(8));
1785 env->SetFloatArrayRegion(radiisArray.
obj(), 0, 8, radiis);
1786 env->CallVoidMethod(mutatorsStack,
1788 static_cast<int>(rect.
GetLeft()),
1789 static_cast<int>(rect.
GetTop()),
1796 const DlRoundRect& rrect = (*iter)->GetRSEApproximation();
1799 SkScalar radiis[8] = {
1806 env, env->NewFloatArray(8));
1807 env->SetFloatArrayRegion(radiisArray.
obj(), 0, 8, radiis);
1808 env->CallVoidMethod(mutatorsStack,
1810 static_cast<int>(rect.
GetLeft()),
1811 static_cast<int>(rect.
GetTop()),
1831 env->CallVoidMethod(java_object.obj(), g_on_display_platform_view_method,
1846 auto java_object = java_object_.
get(env);
1847 if (java_object.is_null()) {
1851 env->CallVoidMethod(java_object.obj(), g_on_display_overlay_surface_method,
1860 auto java_object = java_object_.
get(env);
1861 if (java_object.is_null()) {
1865 env->CallVoidMethod(java_object.obj(), g_on_begin_frame_method);
1873 auto java_object = java_object_.
get(env);
1874 if (java_object.is_null()) {
1878 env->CallVoidMethod(java_object.obj(), g_on_end_frame_method);
1883std::unique_ptr<PlatformViewAndroidJNI::OverlayMetadata>
1887 auto java_object = java_object_.
get(env);
1888 if (java_object.is_null()) {
1893 env, env->CallObjectMethod(java_object.obj(),
1894 g_create_overlay_surface_method));
1897 if (overlay.is_null()) {
1898 return std::make_unique<PlatformViewAndroidJNI::OverlayMetadata>(0,
1905 jobject overlay_surface =
1908 auto overlay_window = fml::MakeRefCounted<AndroidNativeWindow>(
1909 ANativeWindow_fromSurface(env, overlay_surface));
1911 return std::make_unique<PlatformViewAndroidJNI::OverlayMetadata>(
1912 overlay_id, std::move(overlay_window));
1918 auto java_object = java_object_.
get(env);
1919 if (java_object.is_null()) {
1923 env->CallVoidMethod(java_object.obj(), g_destroy_overlay_surfaces_method);
1928std::unique_ptr<std::vector<std::string>>
1930 std::vector<std::string> supported_locales_data) {
1933 std::unique_ptr<std::vector<std::string>> out =
1934 std::make_unique<std::vector<std::string>>();
1936 auto java_object = java_object_.
get(env);
1937 if (java_object.is_null()) {
1942 jobjectArray result =
static_cast<jobjectArray
>(env->CallObjectMethod(
1944 j_locales_data.
obj()));
1948 int length = env->GetArrayLength(result);
1951 env,
static_cast<jstring
>(env->GetObjectArrayElement(result,
i))));
1959 auto java_object = java_object_.
get(env);
1960 if (java_object.is_null()) {
1965 env, env->GetObjectClass(java_object.obj()));
1966 if (clazz.is_null()) {
1970 jfieldID fid = env->GetStaticFieldID(clazz.
obj(),
"refreshRateFPS",
"F");
1971 return static_cast<double>(env->GetStaticFloatField(clazz.
obj(), fid));
1977 auto java_object = java_object_.
get(env);
1978 if (java_object.is_null()) {
1983 env, env->GetObjectClass(java_object.obj()));
1984 if (clazz.is_null()) {
1988 jfieldID fid = env->GetStaticFieldID(clazz.
obj(),
"displayWidth",
"F");
1989 return static_cast<double>(env->GetStaticFloatField(clazz.
obj(), fid));
1995 auto java_object = java_object_.
get(env);
1996 if (java_object.is_null()) {
2001 env, env->GetObjectClass(java_object.obj()));
2002 if (clazz.is_null()) {
2006 jfieldID fid = env->GetStaticFieldID(clazz.
obj(),
"displayHeight",
"F");
2007 return static_cast<double>(env->GetStaticFloatField(clazz.
obj(), fid));
2013 auto java_object = java_object_.
get(env);
2014 if (java_object.is_null()) {
2019 env, env->GetObjectClass(java_object.obj()));
2020 if (clazz.is_null()) {
2024 jfieldID fid = env->GetStaticFieldID(clazz.
obj(),
"displayDensity",
"F");
2025 return static_cast<double>(env->GetStaticFloatField(clazz.
obj(), fid));
2029 int loading_unit_id) {
2032 auto java_object = java_object_.
get(env);
2033 if (java_object.is_null()) {
2049 auto java_object = java_object_.
get(env);
2050 if (java_object.is_null()) {
2056 env->CallObjectMethod(java_object.obj(), g_create_transaction_method));
2057 if (transaction.is_null()) {
2063 env, transaction.
obj());
2069 auto java_object = java_object_.
get(env);
2070 if (java_object.is_null()) {
2074 env->CallVoidMethod(java_object.obj(), g_swap_transaction_method);
2082 auto java_object = java_object_.
get(env);
2083 if (java_object.is_null()) {
2087 env->CallVoidMethod(java_object.obj(), g_apply_transaction_method);
2092std::unique_ptr<PlatformViewAndroidJNI::OverlayMetadata>
2096 auto java_object = java_object_.
get(env);
2097 if (java_object.is_null()) {
2102 env, env->CallObjectMethod(java_object.obj(),
2103 g_create_overlay_surface2_method));
2106 if (overlay.is_null()) {
2107 return std::make_unique<PlatformViewAndroidJNI::OverlayMetadata>(0,
2114 jobject overlay_surface =
2117 auto overlay_window = fml::MakeRefCounted<AndroidNativeWindow>(
2118 ANativeWindow_fromSurface(env, overlay_surface));
2120 return std::make_unique<PlatformViewAndroidJNI::OverlayMetadata>(
2121 overlay_id, std::move(overlay_window));
2127 auto java_object = java_object_.
get(env);
2128 if (java_object.is_null()) {
2132 env->CallVoidMethod(java_object.obj(), g_destroy_overlay_surface2_method);
2140 explicit AndroidPathReceiver(JNIEnv* env)
2145 jfieldID fill_type_field_id;
2147 case DlPathFillType::kOdd:
2150 case DlPathFillType::kNonZero:
2164 fill_type_field_id));
2170 fill_type_enum.
obj());
2182 cp.x, cp.y,
p2.x,
p2.y);
2196 cp1.x, cp1.y, cp2.x, cp2.y,
p2.x,
p2.y);
2198 void Close()
override {
2202 jobject TakePath()
const {
return android_path_; }
2206 jobject android_path_;
2220 auto java_object = java_object_.
get(env);
2221 if (java_object.is_null()) {
2228 std::vector<std::shared_ptr<Mutator>>::const_iterator iter =
2229 mutators_stack.
Begin();
2230 while (iter != mutators_stack.
End()) {
2231 switch ((*iter)->GetType()) {
2233 const DlMatrix& matrix = (*iter)->GetMatrix();
2235 matrix.
m[0], matrix.
m[4], matrix.
m[12],
2236 matrix.
m[1], matrix.
m[5], matrix.
m[13],
2237 matrix.
m[3], matrix.
m[7], matrix.
m[15],
2240 env, env->NewFloatArray(9));
2242 env->SetFloatArrayRegion(transformMatrix.
obj(), 0, 9, matrix_array);
2243 env->CallVoidMethod(mutatorsStack,
2245 transformMatrix.
obj());
2249 const DlRect& rect = (*iter)->GetRect();
2250 env->CallVoidMethod(mutatorsStack,
2252 static_cast<int>(rect.
GetLeft()),
2253 static_cast<int>(rect.
GetTop()),
2262 SkScalar radiis[8] = {
2269 env, env->NewFloatArray(8));
2270 env->SetFloatArrayRegion(radiisArray.
obj(), 0, 8, radiis);
2271 env->CallVoidMethod(mutatorsStack,
2273 static_cast<int>(rect.
GetLeft()),
2274 static_cast<int>(rect.
GetTop()),
2281 const DlRoundRect& rrect = (*iter)->GetRSEApproximation();
2284 SkScalar radiis[8] = {
2291 env, env->NewFloatArray(8));
2292 env->SetFloatArrayRegion(radiisArray.
obj(), 0, 8, radiis);
2293 env->CallVoidMethod(mutatorsStack,
2295 static_cast<int>(rect.
GetLeft()),
2296 static_cast<int>(rect.
GetTop()),
2303 float opacity = (*iter)->GetAlphaFloat();
2309 auto& dlPath = (*iter)->GetPath();
2319 AndroidPathReceiver receiver(env);
2320 receiver.SetFillType(dlPath.GetFillType());
2325 dlPath.Dispatch(receiver);
2327 env->CallVoidMethod(mutatorsStack,
2329 receiver.TakePath());
2344 env->CallVoidMethod(java_object.obj(), g_on_display_platform_view2_method,
2353 auto java_object = java_object_.
get(env);
2354 if (java_object.is_null()) {
2358 env->CallVoidMethod(java_object.obj(), g_hide_platform_view2_method,
view_id);
2364 auto java_object = java_object_.
get(env);
2365 if (java_object.is_null()) {
2369 env->CallVoidMethod(java_object.obj(), g_on_end_frame2_method);
2377 auto java_object = java_object_.
get(env);
2378 if (java_object.is_null()) {
2382 env->CallVoidMethod(java_object.obj(), g_show_overlay_surface2_method);
2389 auto java_object = java_object_.
get(env);
2390 if (java_object.is_null()) {
2394 env->CallVoidMethod(java_object.obj(), g_hide_overlay_surface2_method);
2402 auto java_object = java_object_.
get(env);
2403 if (java_object.is_null()) {
2407 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)
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