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);
369 env->GetIntArrayRegion(javaDisplayFeaturesBounds, 0, rectSize,
370 &boundsIntVector[0]);
372 std::vector<double> displayFeaturesBounds(boundsIntVector.begin(),
373 boundsIntVector.end());
374 jsize typeSize = env->GetArrayLength(javaDisplayFeaturesType);
375 std::vector<int> displayFeaturesType(typeSize);
377 env->GetIntArrayRegion(javaDisplayFeaturesType, 0, typeSize,
378 &displayFeaturesType[0]);
381 jsize stateSize = env->GetArrayLength(javaDisplayFeaturesState);
382 std::vector<int> displayFeaturesState(stateSize);
384 env->GetIntArrayRegion(javaDisplayFeaturesState, 0, stateSize,
385 &displayFeaturesState[0]);
389 static_cast<double>(devicePixelRatio),
390 static_cast<double>(physicalWidth),
391 static_cast<double>(physicalHeight),
392 static_cast<double>(physicalMinWidth),
393 static_cast<double>(physicalMaxWidth),
398 static_cast<double>(physicalPaddingTop),
399 static_cast<double>(physicalPaddingRight),
400 static_cast<double>(physicalPaddingBottom),
401 static_cast<double>(physicalPaddingLeft),
402 static_cast<double>(physicalViewInsetTop),
404 physicalViewInsetRight),
406 physicalViewInsetBottom),
407 static_cast<double>(physicalViewInsetLeft),
409 systemGestureInsetTop),
411 systemGestureInsetRight),
413 systemGestureInsetBottom),
415 systemGestureInsetLeft),
416 static_cast<double>(physicalTouchSlop),
417 displayFeaturesBounds,
419 displayFeaturesState,
422 physicalDisplayCornerRadiusTopLeft),
424 physicalDisplayCornerRadiusTopRight),
426 physicalDisplayCornerRadiusBottomRight),
428 physicalDisplayCornerRadiusBottomLeft),
437 jlong shell_holder) {
443 jlong shell_holder) {
447static jobject
GetBitmap(JNIEnv* env, jobject jcaller, jlong shell_holder) {
450 if (screenshot.data ==
nullptr) {
454 jstring argb = env->NewStringUTF(
"ARGB_8888");
455 if (argb ==
nullptr) {
459 jobject bitmap_config = env->CallStaticObjectMethod(
461 if (bitmap_config ==
nullptr) {
465 auto bitmap = env->CallStaticObjectMethod(
467 screenshot.frame_size.width, screenshot.frame_size.height, bitmap_config);
471 env->NewDirectByteBuffer(
const_cast<uint8_t*
>(screenshot.data->bytes()),
472 screenshot.data->size()));
510 jlong message_data) {
512 free(
reinterpret_cast<void*
>(message_data));
520 uint8_t*
data =
static_cast<uint8_t*
>(env->GetDirectBufferAddress(
buffer));
521 auto packet = std::make_unique<flutter::PointerDataPacket>(
data, position);
532 jint args_position) {
564 jobject surface_texture) {
575 jobject image_texture_entry,
576 jboolean reset_on_background) {
604static void ScheduleFrame(JNIEnv* env, jobject jcaller, jlong shell_holder) {
614 uint8_t* response_data =
615 static_cast<uint8_t*
>(env->GetDirectBufferAddress(
message));
617 auto mapping = std::make_unique<fml::MallocMapping>(
620 ->InvokePlatformMessageResponseCallback(responseId, std::move(mapping));
628 ->InvokePlatformMessageEmptyResponseCallback(responseId);
633 jlong shell_holder) {
640 return u_hasBinaryProperty(codePoint, UProperty::UCHAR_EMOJI);
646 return u_hasBinaryProperty(codePoint, UProperty::UCHAR_EMOJI_MODIFIER);
652 return u_hasBinaryProperty(codePoint, UProperty::UCHAR_EMOJI_MODIFIER_BASE);
658 return u_hasBinaryProperty(codePoint, UProperty::UCHAR_VARIATION_SELECTOR);
664 return u_hasBinaryProperty(codePoint, UProperty::UCHAR_REGIONAL_INDICATOR);
677 jboolean jTransient) {
680 static_cast<bool>(jTransient));
687 jobjectArray jSearchPaths) {
689 intptr_t loading_unit_id =
static_cast<intptr_t
>(jLoadingUnitId);
690 std::vector<std::string> search_paths =
695 void* handle =
nullptr;
696 while (handle ==
nullptr && !search_paths.empty()) {
697 std::string
path = search_paths.back();
698 handle = ::dlopen(
path.c_str(), RTLD_NOW);
699 search_paths.pop_back();
701 if (handle ==
nullptr) {
703 "No lib .so found for provided search paths.",
true);
710 std::unique_ptr<const fml::SymbolMapping> data_mapping =
711 std::make_unique<const fml::SymbolMapping>(
713 std::unique_ptr<const fml::SymbolMapping> instructions_mapping =
714 std::make_unique<const fml::SymbolMapping>(
718 loading_unit_id, std::move(data_mapping),
719 std::move(instructions_mapping));
725 jobject jAssetManager,
726 jstring jAssetBundlePath) {
727 auto asset_resolver = std::make_unique<flutter::APKAssetProvider>(
733 std::move(asset_resolver),
738 static const JNINativeMethod flutter_jni_methods[] = {
741 .name =
"nativeAttach",
742 .signature =
"(Lio/flutter/embedding/engine/FlutterJNI;)J",
743 .fnPtr =
reinterpret_cast<void*
>(&
AttachJNI),
746 .name =
"nativeDestroy",
748 .fnPtr =
reinterpret_cast<void*
>(&
DestroyJNI),
751 .name =
"nativeSpawn",
752 .signature =
"(JLjava/lang/String;Ljava/lang/String;Ljava/lang/"
753 "String;Ljava/util/List;J)Lio/flutter/"
754 "embedding/engine/FlutterJNI;",
755 .fnPtr =
reinterpret_cast<void*
>(&
SpawnJNI),
758 .name =
"nativeRunBundleAndSnapshotFromLibrary",
759 .signature =
"(JLjava/lang/String;Ljava/lang/String;"
760 "Ljava/lang/String;Landroid/content/res/"
761 "AssetManager;Ljava/util/List;J)V",
765 .name =
"nativeDispatchEmptyPlatformMessage",
766 .signature =
"(JLjava/lang/String;I)V",
770 .name =
"nativeCleanupMessageData",
775 .name =
"nativeDispatchPlatformMessage",
776 .signature =
"(JLjava/lang/String;Ljava/nio/ByteBuffer;II)V",
780 .name =
"nativeInvokePlatformMessageResponseCallback",
781 .signature =
"(JILjava/nio/ByteBuffer;I)V",
786 .name =
"nativeInvokePlatformMessageEmptyResponseCallback",
787 .signature =
"(JI)V",
788 .fnPtr =
reinterpret_cast<void*
>(
792 .name =
"nativeNotifyLowMemoryWarning",
799 .name =
"nativeGetBitmap",
800 .signature =
"(J)Landroid/graphics/Bitmap;",
801 .fnPtr =
reinterpret_cast<void*
>(&
GetBitmap),
804 .name =
"nativeSurfaceCreated",
805 .signature =
"(JLandroid/view/Surface;)V",
809 .name =
"nativeSurfaceWindowChanged",
810 .signature =
"(JLandroid/view/Surface;)V",
814 .name =
"nativeSurfaceChanged",
815 .signature =
"(JII)V",
819 .name =
"nativeSurfaceDestroyed",
824 .name =
"nativeSetViewportMetrics",
825 .signature =
"(JFIIIIIIIIIIIIIII[I[I[IIIIIIIII)V",
829 .name =
"nativeDispatchPointerDataPacket",
830 .signature =
"(JLjava/nio/ByteBuffer;I)V",
834 .name =
"nativeDispatchSemanticsAction",
835 .signature =
"(JIILjava/nio/ByteBuffer;I)V",
839 .name =
"nativeSetSemanticsEnabled",
840 .signature =
"(JZ)V",
844 .name =
"nativeSetAccessibilityFeatures",
845 .signature =
"(JI)V",
849 .name =
"nativeGetIsSoftwareRenderingEnabled",
854 .name =
"nativeRegisterTexture",
855 .signature =
"(JJLjava/lang/ref/"
860 .name =
"nativeRegisterImageTexture",
861 .signature =
"(JJLjava/lang/ref/"
866 .name =
"nativeMarkTextureFrameAvailable",
867 .signature =
"(JJ)V",
871 .name =
"nativeScheduleFrame",
876 .name =
"nativeUnregisterTexture",
877 .signature =
"(JJ)V",
882 .name =
"nativeLookupCallbackInformation",
883 .signature =
"(J)Lio/flutter/view/FlutterCallbackInformation;",
889 .name =
"nativeFlutterTextUtilsIsEmoji",
894 .name =
"nativeFlutterTextUtilsIsEmojiModifier",
899 .name =
"nativeFlutterTextUtilsIsEmojiModifierBase",
905 .name =
"nativeFlutterTextUtilsIsVariationSelector",
911 .name =
"nativeFlutterTextUtilsIsRegionalIndicator",
917 .name =
"nativeLoadDartDeferredLibrary",
918 .signature =
"(JI[Ljava/lang/String;)V",
922 .name =
"nativeUpdateJavaAssetManager",
924 "(JLandroid/content/res/AssetManager;Ljava/lang/String;)V",
928 .name =
"nativeDeferredComponentInstallFailure",
929 .signature =
"(ILjava/lang/String;Z)V",
933 .name =
"nativeUpdateDisplayMetrics",
938 .name =
"nativeIsSurfaceControlEnabled",
944 std::size(flutter_jni_methods)) != 0) {
945 FML_LOG(ERROR) <<
"Failed to RegisterNatives with FlutterJNI";
953 FML_LOG(ERROR) <<
"Could not locate FlutterJNI's nativeShellHolderId field";
961 FML_LOG(ERROR) <<
"Could not locate FlutterJNI's constructor";
966 "valueOf",
"(J)Ljava/lang/Long;");
968 FML_LOG(ERROR) <<
"Could not locate Long's constructor";
975 env, env->FindClass(
"io/flutter/embedding/engine/FlutterOverlaySurface"));
976 if (overlay_surface_class.is_null()) {
977 FML_LOG(ERROR) <<
"Could not locate FlutterOverlaySurface class";
981 env->GetMethodID(overlay_surface_class.
obj(),
"getId",
"()I");
983 FML_LOG(ERROR) <<
"Could not locate FlutterOverlaySurface#getId() method";
987 overlay_surface_class.
obj(),
"getSurface",
"()Landroid/view/Surface;");
990 <<
"Could not locate FlutterOverlaySurface#getSurface() method";
995 env, env->FindClass(
"android/graphics/Bitmap"));
997 FML_LOG(ERROR) <<
"Could not locate Bitmap Class";
1003 "(IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;");
1005 FML_LOG(ERROR) <<
"Could not locate Bitmap.createBitmap method";
1010 g_bitmap_class->obj(),
"copyPixelsFromBuffer",
"(Ljava/nio/Buffer;)V");
1012 FML_LOG(ERROR) <<
"Could not locate Bitmap.copyPixelsFromBuffer method";
1017 env, env->FindClass(
"android/graphics/Bitmap$Config"));
1019 FML_LOG(ERROR) <<
"Could not locate Bitmap.Config Class";
1025 "(Ljava/lang/String;)Landroid/graphics/Bitmap$Config;");
1027 FML_LOG(ERROR) <<
"Could not locate Bitmap.Config.valueOf method";
1035 if (env ==
nullptr) {
1036 FML_LOG(ERROR) <<
"No JNIEnv provided";
1041 env, env->FindClass(
"io/flutter/view/FlutterCallbackInformation"));
1043 FML_LOG(ERROR) <<
"Could not locate FlutterCallbackInformation class";
1049 "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
1051 FML_LOG(ERROR) <<
"Could not locate FlutterCallbackInformation constructor";
1056 env, env->FindClass(
"io/flutter/embedding/engine/FlutterJNI"));
1058 FML_LOG(ERROR) <<
"Failed to find FlutterJNI Class.";
1065 "io/flutter/embedding/engine/mutatorsstack/FlutterMutatorsStack"));
1067 FML_LOG(ERROR) <<
"Could not locate FlutterMutatorsStack";
1074 FML_LOG(ERROR) <<
"Could not locate FlutterMutatorsStack.init method";
1082 <<
"Could not locate FlutterMutatorsStack.pushTransform method";
1090 <<
"Could not locate FlutterMutatorsStack.pushClipRect method";
1098 <<
"Could not locate FlutterMutatorsStack.pushClipRRect method";
1106 <<
"Could not locate FlutterMutatorsStack.pushOpacity method";
1112 "(Landroid/graphics/Path;)V");
1115 <<
"Could not locate FlutterMutatorsStack.pushClipPath method";
1120 env, env->FindClass(
"java/lang/ref/WeakReference"));
1122 FML_LOG(ERROR) <<
"Could not locate WeakReference class";
1129 FML_LOG(ERROR) <<
"Could not locate WeakReference.get method";
1134 env, env->FindClass(
1135 "io/flutter/embedding/engine/renderer/SurfaceTextureWrapper"));
1137 FML_LOG(ERROR) <<
"Could not locate SurfaceTextureWrapper class";
1145 FML_LOG(ERROR) <<
"Could not locate attachToGlContext method";
1154 <<
"Could not locate SurfaceTextureWrapper.shouldUpdate method";
1162 FML_LOG(ERROR) <<
"Could not locate updateTexImage method";
1170 FML_LOG(ERROR) <<
"Could not locate getTransformMatrix method";
1178 FML_LOG(ERROR) <<
"Could not locate detachFromGlContext method";
1183 env, env->FindClass(
"io/flutter/view/TextureRegistry$ImageConsumer"));
1185 FML_LOG(ERROR) <<
"Could not locate TextureRegistry.ImageConsumer class";
1191 "acquireLatestImage",
"()Landroid/media/Image;");
1193 FML_LOG(ERROR) <<
"Could not locate acquireLatestImage on "
1194 "TextureRegistry.ImageConsumer class";
1199 env, env->FindClass(
"android/media/Image"));
1201 FML_LOG(ERROR) <<
"Could not locate Image class";
1210 "()Landroid/hardware/HardwareBuffer;");
1220 FML_LOG(ERROR) <<
"Could not locate close on Image class";
1227 env, env->FindClass(
"android/hardware/HardwareBuffer"));
1243 "([Ljava/lang/String;)[Ljava/lang/String;");
1246 FML_LOG(ERROR) <<
"Could not locate computePlatformResolvedLocale method";
1254 FML_LOG(ERROR) <<
"Could not locate requestDartDeferredLibrary method";
1259 env, env->FindClass(
"java/lang/Long"));
1261 FML_LOG(ERROR) <<
"Could not locate java.lang.Long class";
1267 env, env->FindClass(
"android/graphics/Path"));
1269 FML_LOG(ERROR) <<
"Could not locate android.graphics.Path class";
1275 FML_LOG(ERROR) <<
"Could not locate android.graphics.Path constructor";
1280 path_class->obj(),
"setFillType",
"(Landroid/graphics/Path$FillType;)V");
1283 <<
"Could not locate android.graphics.Path.setFillType method";
1289 FML_LOG(ERROR) <<
"Could not locate android.graphics.Path.moveTo method";
1294 FML_LOG(ERROR) <<
"Could not locate android.graphics.Path.lineTo method";
1298 env->GetMethodID(
path_class->obj(),
"quadTo",
"(FFFF)V");
1300 FML_LOG(ERROR) <<
"Could not locate android.graphics.Path.quadTo method";
1304 env->GetMethodID(
path_class->obj(),
"cubicTo",
"(FFFFFF)V");
1306 FML_LOG(ERROR) <<
"Could not locate android.graphics.Path.cubicTo method";
1313 env->GetMethodID(
path_class->obj(),
"conicTo",
"(FFFFF)V");
1320 FML_LOG(ERROR) <<
"Could not locate android.graphics.Path.close method";
1325 env, env->FindClass(
"android/graphics/Path$FillType"));
1327 FML_LOG(ERROR) <<
"Could not locate android.graphics.Path$FillType class";
1333 "Landroid/graphics/Path$FillType;");
1335 FML_LOG(ERROR) <<
"Could not locate Path.FillType.WINDING field";
1341 "Landroid/graphics/Path$FillType;");
1343 FML_LOG(ERROR) <<
"Could not locate Path.FillType.EVEN_ODD field";
1352 : java_object_(java_object) {}
1357 std::unique_ptr<flutter::PlatformMessage>
message,
1362 auto java_object = java_object_.
get(env);
1363 if (java_object.is_null()) {
1372 env, env->NewDirectByteBuffer(
1373 const_cast<uint8_t*
>(
message->data().GetMapping()),
1377 env->CallVoidMethod(java_object.obj(), g_handle_platform_message_method,
1378 java_channel.
obj(), message_array.
obj(), responseId,
1379 reinterpret_cast<jlong
>(mapping.
Release()));
1381 env->CallVoidMethod(java_object.obj(), g_handle_platform_message_method,
1382 java_channel.
obj(),
nullptr, responseId,
nullptr);
1389 std::string locale) {
1392 auto java_object = java_object_.
get(env);
1393 if (java_object.is_null()) {
1400 env->CallVoidMethod(java_object.obj(), g_set_application_locale_method,
1410 auto java_object = java_object_.
get(env);
1411 if (java_object.is_null()) {
1415 env->CallVoidMethod(java_object.obj(), g_set_semantics_tree_enabled_method,
1423 std::unique_ptr<fml::Mapping>
data) {
1428 auto java_object = java_object_.
get(env);
1429 if (java_object.is_null()) {
1434 if (
data ==
nullptr) {
1435 env->CallVoidMethod(java_object.obj(),
1436 g_handle_platform_message_response_method, responseId,
1441 env, env->NewDirectByteBuffer(
const_cast<uint8_t*
>(
data->GetMapping()),
1444 env->CallVoidMethod(java_object.obj(),
1445 g_handle_platform_message_response_method, responseId,
1454 int configuration_id)
const {
1457 auto java_object = java_object_.
get(env);
1458 if (java_object.is_null()) {
1462 const jfloat scaledSize = env->CallFloatMethod(
1463 java_object.obj(), g_get_scaled_font_size_method,
1464 static_cast<jfloat
>(
font_size),
static_cast<jint
>(configuration_id));
1466 return static_cast<double>(scaledSize);
1470 std::vector<uint8_t> buffer,
1471 std::vector<std::string> strings,
1472 std::vector<std::vector<uint8_t>> string_attribute_args) {
1475 auto java_object = java_object_.
get(env);
1476 if (java_object.is_null()) {
1481 env, env->NewDirectByteBuffer(
buffer.data(),
buffer.size()));
1487 env->CallVoidMethod(java_object.obj(), g_update_semantics_method,
1488 direct_buffer.
obj(), jstrings.
obj(),
1489 jstring_attribute_args.
obj());
1495 std::vector<uint8_t> actions_buffer,
1496 std::vector<std::string> strings) {
1499 auto java_object = java_object_.
get(env);
1500 if (java_object.is_null()) {
1506 env->NewDirectByteBuffer(actions_buffer.data(), actions_buffer.size()));
1511 env->CallVoidMethod(java_object.obj(),
1512 g_update_custom_accessibility_actions_method,
1513 direct_actions_buffer.
obj(), jstrings.
obj());
1521 auto java_object = java_object_.
get(env);
1522 if (java_object.is_null()) {
1526 env->CallVoidMethod(java_object.obj(), g_on_first_frame_method);
1534 auto java_object = java_object_.
get(env);
1535 if (java_object.is_null()) {
1539 env->CallVoidMethod(java_object.obj(), g_on_engine_restart_method);
1549 if (surface_texture.is_null()) {
1554 env, env->CallObjectMethod(surface_texture.obj(),
1557 if (surface_texture_local_ref.is_null()) {
1561 env->CallVoidMethod(surface_texture_local_ref.
obj(),
1571 if (surface_texture.is_null()) {
1576 env, env->CallObjectMethod(surface_texture.obj(),
1578 if (surface_texture_local_ref.is_null()) {
1582 jboolean shouldUpdate = env->CallBooleanMethod(
1587 return shouldUpdate;
1594 if (surface_texture.is_null()) {
1599 env, env->CallObjectMethod(surface_texture.obj(),
1601 if (surface_texture_local_ref.is_null()) {
1605 env->CallVoidMethod(surface_texture_local_ref.
obj(),
1615 if (surface_texture.is_null()) {
1620 env, env->CallObjectMethod(surface_texture.obj(),
1622 if (surface_texture_local_ref.is_null()) {
1627 env, env->NewFloatArray(16));
1629 env->CallVoidMethod(surface_texture_local_ref.
obj(),
1633 float* m = env->GetFloatArrayElements(transformMatrix.
obj(),
nullptr);
1635 static_assert(
sizeof(SkScalar) ==
sizeof(
float));
1636 const auto transform = SkM44::ColMajor(m);
1638 env->ReleaseFloatArrayElements(transformMatrix.
obj(), m, JNI_ABORT);
1647 if (surface_texture.is_null()) {
1652 env, env->CallObjectMethod(surface_texture.obj(),
1654 if (surface_texture_local_ref.is_null()) {
1658 env->CallVoidMethod(surface_texture_local_ref.
obj(),
1669 if (image_producer_texture_entry.is_null()) {
1677 env, env->CallObjectMethod(image_producer_texture_entry.obj(),
1680 if (image_producer_texture_entry_local_ref.is_null()) {
1686 env, env->CallObjectMethod(image_producer_texture_entry_local_ref.
obj(),
1699 if (
image.is_null()) {
1714 if (
image.is_null()) {
1725 if (hardware_buffer.is_null()) {
1742 auto java_object = java_object_.
get(env);
1743 if (java_object.is_null()) {
1750 std::vector<std::shared_ptr<Mutator>>::const_iterator iter =
1751 mutators_stack.
Begin();
1752 while (iter != mutators_stack.
End()) {
1753 switch ((*iter)->GetType()) {
1755 const DlMatrix& matrix = (*iter)->GetMatrix();
1757 matrix.
m[0], matrix.
m[4], matrix.
m[12],
1758 matrix.
m[1], matrix.
m[5], matrix.
m[13],
1759 matrix.
m[3], matrix.
m[7], matrix.
m[15],
1762 env, env->NewFloatArray(9));
1764 env->SetFloatArrayRegion(transformMatrix.
obj(), 0, 9, matrix_array);
1765 env->CallVoidMethod(mutatorsStack,
1767 transformMatrix.
obj());
1771 const DlRect& rect = (*iter)->GetRect();
1772 env->CallVoidMethod(mutatorsStack,
1774 static_cast<int>(rect.
GetLeft()),
1775 static_cast<int>(rect.
GetTop()),
1784 SkScalar radiis[8] = {
1791 env, env->NewFloatArray(8));
1792 env->SetFloatArrayRegion(radiisArray.
obj(), 0, 8, radiis);
1793 env->CallVoidMethod(mutatorsStack,
1795 static_cast<int>(rect.
GetLeft()),
1796 static_cast<int>(rect.
GetTop()),
1803 const DlRoundRect& rrect = (*iter)->GetRSEApproximation();
1806 SkScalar radiis[8] = {
1813 env, env->NewFloatArray(8));
1814 env->SetFloatArrayRegion(radiisArray.
obj(), 0, 8, radiis);
1815 env->CallVoidMethod(mutatorsStack,
1817 static_cast<int>(rect.
GetLeft()),
1818 static_cast<int>(rect.
GetTop()),
1838 env->CallVoidMethod(java_object.obj(), g_on_display_platform_view_method,
1853 auto java_object = java_object_.
get(env);
1854 if (java_object.is_null()) {
1858 env->CallVoidMethod(java_object.obj(), g_on_display_overlay_surface_method,
1867 auto java_object = java_object_.
get(env);
1868 if (java_object.is_null()) {
1872 env->CallVoidMethod(java_object.obj(), g_on_begin_frame_method);
1880 auto java_object = java_object_.
get(env);
1881 if (java_object.is_null()) {
1885 env->CallVoidMethod(java_object.obj(), g_on_end_frame_method);
1890std::unique_ptr<PlatformViewAndroidJNI::OverlayMetadata>
1894 auto java_object = java_object_.
get(env);
1895 if (java_object.is_null()) {
1900 env, env->CallObjectMethod(java_object.obj(),
1901 g_create_overlay_surface_method));
1904 if (overlay.is_null()) {
1905 return std::make_unique<PlatformViewAndroidJNI::OverlayMetadata>(0,
1912 jobject overlay_surface =
1915 auto overlay_window = fml::MakeRefCounted<AndroidNativeWindow>(
1916 ANativeWindow_fromSurface(env, overlay_surface));
1918 return std::make_unique<PlatformViewAndroidJNI::OverlayMetadata>(
1919 overlay_id, std::move(overlay_window));
1925 auto java_object = java_object_.
get(env);
1926 if (java_object.is_null()) {
1930 env->CallVoidMethod(java_object.obj(), g_destroy_overlay_surfaces_method);
1935std::unique_ptr<std::vector<std::string>>
1937 std::vector<std::string> supported_locales_data) {
1940 std::unique_ptr<std::vector<std::string>> out =
1941 std::make_unique<std::vector<std::string>>();
1943 auto java_object = java_object_.
get(env);
1944 if (java_object.is_null()) {
1949 jobjectArray result =
static_cast<jobjectArray
>(env->CallObjectMethod(
1951 j_locales_data.
obj()));
1955 int length = env->GetArrayLength(result);
1958 env,
static_cast<jstring
>(env->GetObjectArrayElement(result,
i))));
1966 auto java_object = java_object_.
get(env);
1967 if (java_object.is_null()) {
1972 env, env->GetObjectClass(java_object.obj()));
1973 if (clazz.is_null()) {
1977 jfieldID fid = env->GetStaticFieldID(clazz.
obj(),
"refreshRateFPS",
"F");
1978 return static_cast<double>(env->GetStaticFloatField(clazz.
obj(), fid));
1984 auto java_object = java_object_.
get(env);
1985 if (java_object.is_null()) {
1990 env, env->GetObjectClass(java_object.obj()));
1991 if (clazz.is_null()) {
1995 jfieldID fid = env->GetStaticFieldID(clazz.
obj(),
"displayWidth",
"F");
1996 return static_cast<double>(env->GetStaticFloatField(clazz.
obj(), fid));
2002 auto java_object = java_object_.
get(env);
2003 if (java_object.is_null()) {
2008 env, env->GetObjectClass(java_object.obj()));
2009 if (clazz.is_null()) {
2013 jfieldID fid = env->GetStaticFieldID(clazz.
obj(),
"displayHeight",
"F");
2014 return static_cast<double>(env->GetStaticFloatField(clazz.
obj(), fid));
2020 auto java_object = java_object_.
get(env);
2021 if (java_object.is_null()) {
2026 env, env->GetObjectClass(java_object.obj()));
2027 if (clazz.is_null()) {
2031 jfieldID fid = env->GetStaticFieldID(clazz.
obj(),
"displayDensity",
"F");
2032 return static_cast<double>(env->GetStaticFloatField(clazz.
obj(), fid));
2036 int loading_unit_id) {
2039 auto java_object = java_object_.
get(env);
2040 if (java_object.is_null()) {
2056 auto java_object = java_object_.
get(env);
2057 if (java_object.is_null()) {
2063 env->CallObjectMethod(java_object.obj(), g_create_transaction_method));
2064 if (transaction.is_null()) {
2070 env, transaction.
obj());
2076 auto java_object = java_object_.
get(env);
2077 if (java_object.is_null()) {
2081 env->CallVoidMethod(java_object.obj(), g_swap_transaction_method);
2089 auto java_object = java_object_.
get(env);
2090 if (java_object.is_null()) {
2094 env->CallVoidMethod(java_object.obj(), g_apply_transaction_method);
2099std::unique_ptr<PlatformViewAndroidJNI::OverlayMetadata>
2103 auto java_object = java_object_.
get(env);
2104 if (java_object.is_null()) {
2109 env, env->CallObjectMethod(java_object.obj(),
2110 g_create_overlay_surface2_method));
2113 if (overlay.is_null()) {
2114 return std::make_unique<PlatformViewAndroidJNI::OverlayMetadata>(0,
2121 jobject overlay_surface =
2124 auto overlay_window = fml::MakeRefCounted<AndroidNativeWindow>(
2125 ANativeWindow_fromSurface(env, overlay_surface));
2127 return std::make_unique<PlatformViewAndroidJNI::OverlayMetadata>(
2128 overlay_id, std::move(overlay_window));
2134 auto java_object = java_object_.
get(env);
2135 if (java_object.is_null()) {
2139 env->CallVoidMethod(java_object.obj(), g_destroy_overlay_surface2_method);
2147 explicit AndroidPathReceiver(JNIEnv* env)
2152 jfieldID fill_type_field_id;
2154 case DlPathFillType::kOdd:
2157 case DlPathFillType::kNonZero:
2171 fill_type_field_id));
2177 fill_type_enum.
obj());
2189 cp.x, cp.y,
p2.x,
p2.y);
2203 cp1.x, cp1.y, cp2.x, cp2.y,
p2.x,
p2.y);
2205 void Close()
override {
2209 jobject TakePath()
const {
return android_path_; }
2213 jobject android_path_;
2227 auto java_object = java_object_.
get(env);
2228 if (java_object.is_null()) {
2235 std::vector<std::shared_ptr<Mutator>>::const_iterator iter =
2236 mutators_stack.
Begin();
2237 while (iter != mutators_stack.
End()) {
2238 switch ((*iter)->GetType()) {
2240 const DlMatrix& matrix = (*iter)->GetMatrix();
2242 matrix.
m[0], matrix.
m[4], matrix.
m[12],
2243 matrix.
m[1], matrix.
m[5], matrix.
m[13],
2244 matrix.
m[3], matrix.
m[7], matrix.
m[15],
2247 env, env->NewFloatArray(9));
2249 env->SetFloatArrayRegion(transformMatrix.
obj(), 0, 9, matrix_array);
2250 env->CallVoidMethod(mutatorsStack,
2252 transformMatrix.
obj());
2256 const DlRect& rect = (*iter)->GetRect();
2257 env->CallVoidMethod(mutatorsStack,
2259 static_cast<int>(rect.
GetLeft()),
2260 static_cast<int>(rect.
GetTop()),
2269 SkScalar radiis[8] = {
2276 env, env->NewFloatArray(8));
2277 env->SetFloatArrayRegion(radiisArray.
obj(), 0, 8, radiis);
2278 env->CallVoidMethod(mutatorsStack,
2280 static_cast<int>(rect.
GetLeft()),
2281 static_cast<int>(rect.
GetTop()),
2288 const DlRoundRect& rrect = (*iter)->GetRSEApproximation();
2291 SkScalar radiis[8] = {
2298 env, env->NewFloatArray(8));
2299 env->SetFloatArrayRegion(radiisArray.
obj(), 0, 8, radiis);
2300 env->CallVoidMethod(mutatorsStack,
2302 static_cast<int>(rect.
GetLeft()),
2303 static_cast<int>(rect.
GetTop()),
2310 float opacity = (*iter)->GetAlphaFloat();
2316 auto& dlPath = (*iter)->GetPath();
2326 AndroidPathReceiver receiver(env);
2327 receiver.SetFillType(dlPath.GetFillType());
2332 dlPath.Dispatch(receiver);
2334 env->CallVoidMethod(mutatorsStack,
2336 receiver.TakePath());
2351 env->CallVoidMethod(java_object.obj(), g_on_display_platform_view2_method,
2360 auto java_object = java_object_.
get(env);
2361 if (java_object.is_null()) {
2365 env->CallVoidMethod(java_object.obj(), g_hide_platform_view2_method,
view_id);
2371 auto java_object = java_object_.
get(env);
2372 if (java_object.is_null()) {
2376 env->CallVoidMethod(java_object.obj(), g_on_end_frame2_method);
2384 auto java_object = java_object_.
get(env);
2385 if (java_object.is_null()) {
2389 env->CallVoidMethod(java_object.obj(), g_show_overlay_surface2_method);
2396 auto java_object = java_object_.
get(env);
2397 if (java_object.is_null()) {
2401 env->CallVoidMethod(java_object.obj(), g_hide_overlay_surface2_method);
2409 auto java_object = java_object_.
get(env);
2410 if (java_object.is_null()) {
2414 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