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_on_display_platform_view_method, onDisplayPlatformView, \
75 "(IIIIIIILio/flutter/embedding/engine/mutatorsstack/" \
76 "FlutterMutatorsStack;)V") \
77 V(g_on_begin_frame_method, onBeginFrame, "()V") \
78 V(g_on_end_frame_method, onEndFrame, "()V") \
79 V(g_on_display_overlay_surface_method, onDisplayOverlaySurface, "(IIIII)V") \
80 V(g_create_transaction_method, createTransaction, \
81 "()Landroid/view/SurfaceControl$Transaction;") \
82 V(g_swap_transaction_method, swapTransactions, "()V") \
83 V(g_apply_transaction_method, applyTransactions, "()V") \
84 V(g_create_overlay_surface2_method, createOverlaySurface2, \
85 "()Lio/flutter/embedding/engine/FlutterOverlaySurface;") \
86 V(g_destroy_overlay_surface2_method, destroyOverlaySurface2, "()V") \
87 V(g_on_display_platform_view2_method, onDisplayPlatformView2, \
88 "(IIIIIIILio/flutter/embedding/engine/mutatorsstack/" \
89 "FlutterMutatorsStack;)V") \
90 V(g_hide_platform_view2_method, hidePlatformView2, "(I)V") \
91 V(g_on_end_frame2_method, endFrame2, "()V") \
92 V(g_show_overlay_surface2_method, showOverlaySurface2, "()V") \
93 V(g_hide_overlay_surface2_method, hideOverlaySurface2, "()V") \
94 V(g_get_scaled_font_size_method, getScaledFontSize, "(FI)F") \
95 V(g_update_custom_accessibility_actions_method, \
96 updateCustomAccessibilityActions, \
97 "(Ljava/nio/ByteBuffer;[Ljava/lang/String;)V") \
98 V(g_on_first_frame_method, onFirstFrame, "()V") \
99 V(g_on_engine_restart_method, onPreEngineRestart, "()V") \
100 V(g_create_overlay_surface_method, createOverlaySurface, \
101 "()Lio/flutter/embedding/engine/FlutterOverlaySurface;") \
102 V(g_destroy_overlay_surfaces_method, destroyOverlaySurfaces, "()V")
106#define FLUTTER_DECLARE_JNI(global_field, jni_name, jni_arg) \
107 static jmethodID global_field = nullptr;
109#define FLUTTER_BIND_JNI(global_field, jni_name, jni_arg) \
111 env->GetMethodID(g_flutter_jni_class->obj(), #jni_name, jni_arg); \
112 if (global_field == nullptr) { \
113 FML_LOG(ERROR) << "Could not locate " << #jni_name << " method."; \
184static jlong
AttachJNI(JNIEnv* env, jclass clazz, jobject flutterJNI) {
186 std::shared_ptr<PlatformViewAndroidJNI> jni_facade =
187 std::make_shared<PlatformViewAndroidJNIImpl>(java_object);
188 auto shell_holder = std::make_unique<AndroidShellHolder>(
191 if (shell_holder->IsValid()) {
192 return reinterpret_cast<jlong
>(shell_holder.release());
198static void DestroyJNI(JNIEnv* env, jobject jcaller, jlong shell_holder) {
217 jstring jInitialRoute,
218 jobject jEntrypointArgs,
221 if (jni ==
nullptr) {
222 FML_LOG(ERROR) <<
"Could not create a FlutterJNI instance";
227 std::shared_ptr<PlatformViewAndroidJNI> jni_facade =
228 std::make_shared<PlatformViewAndroidJNIImpl>(java_jni);
235 auto spawned_shell_holder =
237 initial_route, entrypoint_args, engineId);
239 if (spawned_shell_holder ==
nullptr || !spawned_shell_holder->IsValid()) {
240 FML_LOG(ERROR) <<
"Could not spawn Shell";
244 jobject javaLong = env->CallStaticObjectMethod(
246 reinterpret_cast<jlong
>(spawned_shell_holder.release()));
247 if (javaLong ==
nullptr) {
248 FML_LOG(ERROR) <<
"Could not create a Long instance";
265 auto window = fml::MakeRefCounted<AndroidNativeWindow>(
266 ANativeWindow_fromSurface(env, jsurface));
278 auto window = fml::MakeRefCounted<AndroidNativeWindow>(
279 ANativeWindow_fromSurface(env, jsurface));
303 jobject jAssetManager,
304 jobject jEntrypointArgs,
306 auto apk_asset_provider = std::make_unique<flutter::APKAssetProvider>(
316 libraryUrl, entrypoint_args, engineId);
323 if (cbInfo ==
nullptr) {
328 env->NewStringUTF(cbInfo->name.c_str()),
329 env->NewStringUTF(cbInfo->class_name.c_str()),
330 env->NewStringUTF(cbInfo->library_path.c_str()));
336 jfloat devicePixelRatio,
339 jint physicalPaddingTop,
340 jint physicalPaddingRight,
341 jint physicalPaddingBottom,
342 jint physicalPaddingLeft,
343 jint physicalViewInsetTop,
344 jint physicalViewInsetRight,
345 jint physicalViewInsetBottom,
346 jint physicalViewInsetLeft,
347 jint systemGestureInsetTop,
348 jint systemGestureInsetRight,
349 jint systemGestureInsetBottom,
350 jint systemGestureInsetLeft,
351 jint physicalTouchSlop,
352 jintArray javaDisplayFeaturesBounds,
353 jintArray javaDisplayFeaturesType,
354 jintArray javaDisplayFeaturesState) {
357 jsize rectSize = env->GetArrayLength(javaDisplayFeaturesBounds);
358 std::vector<int> boundsIntVector(rectSize);
359 env->GetIntArrayRegion(javaDisplayFeaturesBounds, 0, rectSize,
360 &boundsIntVector[0]);
361 std::vector<double> displayFeaturesBounds(boundsIntVector.begin(),
362 boundsIntVector.end());
363 jsize typeSize = env->GetArrayLength(javaDisplayFeaturesType);
364 std::vector<int> displayFeaturesType(typeSize);
365 env->GetIntArrayRegion(javaDisplayFeaturesType, 0, typeSize,
366 &displayFeaturesType[0]);
368 jsize stateSize = env->GetArrayLength(javaDisplayFeaturesState);
369 std::vector<int> displayFeaturesState(stateSize);
370 env->GetIntArrayRegion(javaDisplayFeaturesState, 0, stateSize,
371 &displayFeaturesState[0]);
375 static_cast<double>(devicePixelRatio),
376 static_cast<double>(physicalWidth),
377 static_cast<double>(physicalHeight),
378 static_cast<double>(physicalWidth),
379 static_cast<double>(physicalWidth),
380 static_cast<double>(physicalHeight),
381 static_cast<double>(physicalHeight),
382 static_cast<double>(physicalPaddingTop),
383 static_cast<double>(physicalPaddingRight),
384 static_cast<double>(physicalPaddingBottom),
385 static_cast<double>(physicalPaddingLeft),
386 static_cast<double>(physicalViewInsetTop),
388 physicalViewInsetRight),
390 physicalViewInsetBottom),
391 static_cast<double>(physicalViewInsetLeft),
393 systemGestureInsetTop),
395 systemGestureInsetRight),
397 systemGestureInsetBottom),
399 systemGestureInsetLeft),
400 static_cast<double>(physicalTouchSlop),
401 displayFeaturesBounds,
403 displayFeaturesState,
413 jlong shell_holder) {
419 jlong shell_holder) {
423static jobject
GetBitmap(JNIEnv* env, jobject jcaller, jlong shell_holder) {
426 if (screenshot.data ==
nullptr) {
430 jstring argb = env->NewStringUTF(
"ARGB_8888");
431 if (argb ==
nullptr) {
435 jobject bitmap_config = env->CallStaticObjectMethod(
437 if (bitmap_config ==
nullptr) {
441 auto bitmap = env->CallStaticObjectMethod(
443 screenshot.frame_size.width, screenshot.frame_size.height, bitmap_config);
447 env->NewDirectByteBuffer(
const_cast<uint8_t*
>(screenshot.data->bytes()),
448 screenshot.data->size()));
486 jlong message_data) {
488 free(
reinterpret_cast<void*
>(message_data));
496 uint8_t*
data =
static_cast<uint8_t*
>(env->GetDirectBufferAddress(
buffer));
497 auto packet = std::make_unique<flutter::PointerDataPacket>(
data, position);
508 jint args_position) {
540 jobject surface_texture) {
551 jobject image_texture_entry,
552 jboolean reset_on_background) {
580static void ScheduleFrame(JNIEnv* env, jobject jcaller, jlong shell_holder) {
590 uint8_t* response_data =
591 static_cast<uint8_t*
>(env->GetDirectBufferAddress(
message));
593 auto mapping = std::make_unique<fml::MallocMapping>(
596 ->InvokePlatformMessageResponseCallback(responseId, std::move(mapping));
604 ->InvokePlatformMessageEmptyResponseCallback(responseId);
609 jlong shell_holder) {
616 return u_hasBinaryProperty(codePoint, UProperty::UCHAR_EMOJI);
622 return u_hasBinaryProperty(codePoint, UProperty::UCHAR_EMOJI_MODIFIER);
628 return u_hasBinaryProperty(codePoint, UProperty::UCHAR_EMOJI_MODIFIER_BASE);
634 return u_hasBinaryProperty(codePoint, UProperty::UCHAR_VARIATION_SELECTOR);
640 return u_hasBinaryProperty(codePoint, UProperty::UCHAR_REGIONAL_INDICATOR);
653 jboolean jTransient) {
656 static_cast<bool>(jTransient));
663 jobjectArray jSearchPaths) {
665 intptr_t loading_unit_id =
static_cast<intptr_t
>(jLoadingUnitId);
666 std::vector<std::string> search_paths =
671 void* handle =
nullptr;
672 while (handle ==
nullptr && !search_paths.empty()) {
673 std::string
path = search_paths.back();
674 handle = ::dlopen(
path.c_str(), RTLD_NOW);
675 search_paths.pop_back();
677 if (handle ==
nullptr) {
679 "No lib .so found for provided search paths.",
true);
686 std::unique_ptr<const fml::SymbolMapping> data_mapping =
687 std::make_unique<const fml::SymbolMapping>(
689 std::unique_ptr<const fml::SymbolMapping> instructions_mapping =
690 std::make_unique<const fml::SymbolMapping>(
694 loading_unit_id, std::move(data_mapping),
695 std::move(instructions_mapping));
701 jobject jAssetManager,
702 jstring jAssetBundlePath) {
703 auto asset_resolver = std::make_unique<flutter::APKAssetProvider>(
709 std::move(asset_resolver),
714 static const JNINativeMethod flutter_jni_methods[] = {
717 .name =
"nativeAttach",
718 .signature =
"(Lio/flutter/embedding/engine/FlutterJNI;)J",
719 .fnPtr =
reinterpret_cast<void*
>(&
AttachJNI),
722 .name =
"nativeDestroy",
724 .fnPtr =
reinterpret_cast<void*
>(&
DestroyJNI),
727 .name =
"nativeSpawn",
728 .signature =
"(JLjava/lang/String;Ljava/lang/String;Ljava/lang/"
729 "String;Ljava/util/List;J)Lio/flutter/"
730 "embedding/engine/FlutterJNI;",
731 .fnPtr =
reinterpret_cast<void*
>(&
SpawnJNI),
734 .name =
"nativeRunBundleAndSnapshotFromLibrary",
735 .signature =
"(JLjava/lang/String;Ljava/lang/String;"
736 "Ljava/lang/String;Landroid/content/res/"
737 "AssetManager;Ljava/util/List;J)V",
741 .name =
"nativeDispatchEmptyPlatformMessage",
742 .signature =
"(JLjava/lang/String;I)V",
746 .name =
"nativeCleanupMessageData",
751 .name =
"nativeDispatchPlatformMessage",
752 .signature =
"(JLjava/lang/String;Ljava/nio/ByteBuffer;II)V",
756 .name =
"nativeInvokePlatformMessageResponseCallback",
757 .signature =
"(JILjava/nio/ByteBuffer;I)V",
762 .name =
"nativeInvokePlatformMessageEmptyResponseCallback",
763 .signature =
"(JI)V",
764 .fnPtr =
reinterpret_cast<void*
>(
768 .name =
"nativeNotifyLowMemoryWarning",
775 .name =
"nativeGetBitmap",
776 .signature =
"(J)Landroid/graphics/Bitmap;",
777 .fnPtr =
reinterpret_cast<void*
>(&
GetBitmap),
780 .name =
"nativeSurfaceCreated",
781 .signature =
"(JLandroid/view/Surface;)V",
785 .name =
"nativeSurfaceWindowChanged",
786 .signature =
"(JLandroid/view/Surface;)V",
790 .name =
"nativeSurfaceChanged",
791 .signature =
"(JII)V",
795 .name =
"nativeSurfaceDestroyed",
800 .name =
"nativeSetViewportMetrics",
801 .signature =
"(JFIIIIIIIIIIIIIII[I[I[I)V",
805 .name =
"nativeDispatchPointerDataPacket",
806 .signature =
"(JLjava/nio/ByteBuffer;I)V",
810 .name =
"nativeDispatchSemanticsAction",
811 .signature =
"(JIILjava/nio/ByteBuffer;I)V",
815 .name =
"nativeSetSemanticsEnabled",
816 .signature =
"(JZ)V",
820 .name =
"nativeSetAccessibilityFeatures",
821 .signature =
"(JI)V",
825 .name =
"nativeGetIsSoftwareRenderingEnabled",
830 .name =
"nativeRegisterTexture",
831 .signature =
"(JJLjava/lang/ref/"
836 .name =
"nativeRegisterImageTexture",
837 .signature =
"(JJLjava/lang/ref/"
842 .name =
"nativeMarkTextureFrameAvailable",
843 .signature =
"(JJ)V",
847 .name =
"nativeScheduleFrame",
852 .name =
"nativeUnregisterTexture",
853 .signature =
"(JJ)V",
858 .name =
"nativeLookupCallbackInformation",
859 .signature =
"(J)Lio/flutter/view/FlutterCallbackInformation;",
865 .name =
"nativeFlutterTextUtilsIsEmoji",
870 .name =
"nativeFlutterTextUtilsIsEmojiModifier",
875 .name =
"nativeFlutterTextUtilsIsEmojiModifierBase",
881 .name =
"nativeFlutterTextUtilsIsVariationSelector",
887 .name =
"nativeFlutterTextUtilsIsRegionalIndicator",
893 .name =
"nativeLoadDartDeferredLibrary",
894 .signature =
"(JI[Ljava/lang/String;)V",
898 .name =
"nativeUpdateJavaAssetManager",
900 "(JLandroid/content/res/AssetManager;Ljava/lang/String;)V",
904 .name =
"nativeDeferredComponentInstallFailure",
905 .signature =
"(ILjava/lang/String;Z)V",
909 .name =
"nativeUpdateDisplayMetrics",
914 .name =
"nativeIsSurfaceControlEnabled",
920 std::size(flutter_jni_methods)) != 0) {
921 FML_LOG(ERROR) <<
"Failed to RegisterNatives with FlutterJNI";
929 FML_LOG(ERROR) <<
"Could not locate FlutterJNI's nativeShellHolderId field";
937 FML_LOG(ERROR) <<
"Could not locate FlutterJNI's constructor";
942 "valueOf",
"(J)Ljava/lang/Long;");
944 FML_LOG(ERROR) <<
"Could not locate Long's constructor";
951 env, env->FindClass(
"io/flutter/embedding/engine/FlutterOverlaySurface"));
952 if (overlay_surface_class.is_null()) {
953 FML_LOG(ERROR) <<
"Could not locate FlutterOverlaySurface class";
957 env->GetMethodID(overlay_surface_class.
obj(),
"getId",
"()I");
959 FML_LOG(ERROR) <<
"Could not locate FlutterOverlaySurface#getId() method";
963 overlay_surface_class.
obj(),
"getSurface",
"()Landroid/view/Surface;");
966 <<
"Could not locate FlutterOverlaySurface#getSurface() method";
971 env, env->FindClass(
"android/graphics/Bitmap"));
973 FML_LOG(ERROR) <<
"Could not locate Bitmap Class";
979 "(IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;");
981 FML_LOG(ERROR) <<
"Could not locate Bitmap.createBitmap method";
986 g_bitmap_class->obj(),
"copyPixelsFromBuffer",
"(Ljava/nio/Buffer;)V");
988 FML_LOG(ERROR) <<
"Could not locate Bitmap.copyPixelsFromBuffer method";
993 env, env->FindClass(
"android/graphics/Bitmap$Config"));
995 FML_LOG(ERROR) <<
"Could not locate Bitmap.Config Class";
1001 "(Ljava/lang/String;)Landroid/graphics/Bitmap$Config;");
1003 FML_LOG(ERROR) <<
"Could not locate Bitmap.Config.valueOf method";
1011 if (env ==
nullptr) {
1012 FML_LOG(ERROR) <<
"No JNIEnv provided";
1017 env, env->FindClass(
"io/flutter/view/FlutterCallbackInformation"));
1019 FML_LOG(ERROR) <<
"Could not locate FlutterCallbackInformation class";
1025 "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
1027 FML_LOG(ERROR) <<
"Could not locate FlutterCallbackInformation constructor";
1032 env, env->FindClass(
"io/flutter/embedding/engine/FlutterJNI"));
1034 FML_LOG(ERROR) <<
"Failed to find FlutterJNI Class.";
1041 "io/flutter/embedding/engine/mutatorsstack/FlutterMutatorsStack"));
1043 FML_LOG(ERROR) <<
"Could not locate FlutterMutatorsStack";
1050 FML_LOG(ERROR) <<
"Could not locate FlutterMutatorsStack.init method";
1058 <<
"Could not locate FlutterMutatorsStack.pushTransform method";
1066 <<
"Could not locate FlutterMutatorsStack.pushClipRect method";
1074 <<
"Could not locate FlutterMutatorsStack.pushClipRRect method";
1082 <<
"Could not locate FlutterMutatorsStack.pushOpacity method";
1088 "(Landroid/graphics/Path;)V");
1091 <<
"Could not locate FlutterMutatorsStack.pushClipPath method";
1096 env, env->FindClass(
"java/lang/ref/WeakReference"));
1098 FML_LOG(ERROR) <<
"Could not locate WeakReference class";
1105 FML_LOG(ERROR) <<
"Could not locate WeakReference.get method";
1110 env, env->FindClass(
1111 "io/flutter/embedding/engine/renderer/SurfaceTextureWrapper"));
1113 FML_LOG(ERROR) <<
"Could not locate SurfaceTextureWrapper class";
1121 FML_LOG(ERROR) <<
"Could not locate attachToGlContext method";
1130 <<
"Could not locate SurfaceTextureWrapper.shouldUpdate method";
1138 FML_LOG(ERROR) <<
"Could not locate updateTexImage method";
1146 FML_LOG(ERROR) <<
"Could not locate getTransformMatrix method";
1154 FML_LOG(ERROR) <<
"Could not locate detachFromGlContext method";
1159 env, env->FindClass(
"io/flutter/view/TextureRegistry$ImageConsumer"));
1161 FML_LOG(ERROR) <<
"Could not locate TextureRegistry.ImageConsumer class";
1167 "acquireLatestImage",
"()Landroid/media/Image;");
1169 FML_LOG(ERROR) <<
"Could not locate acquireLatestImage on "
1170 "TextureRegistry.ImageConsumer class";
1175 env, env->FindClass(
"android/media/Image"));
1177 FML_LOG(ERROR) <<
"Could not locate Image class";
1186 "()Landroid/hardware/HardwareBuffer;");
1196 FML_LOG(ERROR) <<
"Could not locate close on Image class";
1203 env, env->FindClass(
"android/hardware/HardwareBuffer"));
1219 "([Ljava/lang/String;)[Ljava/lang/String;");
1222 FML_LOG(ERROR) <<
"Could not locate computePlatformResolvedLocale method";
1230 FML_LOG(ERROR) <<
"Could not locate requestDartDeferredLibrary method";
1235 env, env->FindClass(
"java/lang/Long"));
1237 FML_LOG(ERROR) <<
"Could not locate java.lang.Long class";
1243 env, env->FindClass(
"android/graphics/Path"));
1245 FML_LOG(ERROR) <<
"Could not locate android.graphics.Path class";
1251 FML_LOG(ERROR) <<
"Could not locate android.graphics.Path constructor";
1256 path_class->obj(),
"setFillType",
"(Landroid/graphics/Path$FillType;)V");
1259 <<
"Could not locate android.graphics.Path.setFillType method";
1265 FML_LOG(ERROR) <<
"Could not locate android.graphics.Path.moveTo method";
1270 FML_LOG(ERROR) <<
"Could not locate android.graphics.Path.lineTo method";
1274 env->GetMethodID(
path_class->obj(),
"quadTo",
"(FFFF)V");
1276 FML_LOG(ERROR) <<
"Could not locate android.graphics.Path.quadTo method";
1280 env->GetMethodID(
path_class->obj(),
"cubicTo",
"(FFFFFF)V");
1282 FML_LOG(ERROR) <<
"Could not locate android.graphics.Path.cubicTo method";
1289 env->GetMethodID(
path_class->obj(),
"conicTo",
"(FFFFF)V");
1296 FML_LOG(ERROR) <<
"Could not locate android.graphics.Path.close method";
1301 env, env->FindClass(
"android/graphics/Path$FillType"));
1303 FML_LOG(ERROR) <<
"Could not locate android.graphics.Path$FillType class";
1309 "Landroid/graphics/Path$FillType;");
1311 FML_LOG(ERROR) <<
"Could not locate Path.FillType.WINDING field";
1317 "Landroid/graphics/Path$FillType;");
1319 FML_LOG(ERROR) <<
"Could not locate Path.FillType.EVEN_ODD field";
1328 : java_object_(java_object) {}
1333 std::unique_ptr<flutter::PlatformMessage>
message,
1338 auto java_object = java_object_.
get(env);
1339 if (java_object.is_null()) {
1348 env, env->NewDirectByteBuffer(
1349 const_cast<uint8_t*
>(
message->data().GetMapping()),
1353 env->CallVoidMethod(java_object.obj(), g_handle_platform_message_method,
1354 java_channel.
obj(), message_array.
obj(), responseId,
1355 reinterpret_cast<jlong
>(mapping.
Release()));
1357 env->CallVoidMethod(java_object.obj(), g_handle_platform_message_method,
1358 java_channel.
obj(),
nullptr, responseId,
nullptr);
1365 std::string locale) {
1368 auto java_object = java_object_.
get(env);
1369 if (java_object.is_null()) {
1376 env->CallVoidMethod(java_object.obj(), g_set_application_locale_method,
1384 std::unique_ptr<fml::Mapping>
data) {
1389 auto java_object = java_object_.
get(env);
1390 if (java_object.is_null()) {
1395 if (
data ==
nullptr) {
1396 env->CallVoidMethod(java_object.obj(),
1397 g_handle_platform_message_response_method, responseId,
1402 env, env->NewDirectByteBuffer(
const_cast<uint8_t*
>(
data->GetMapping()),
1405 env->CallVoidMethod(java_object.obj(),
1406 g_handle_platform_message_response_method, responseId,
1415 int configuration_id)
const {
1418 auto java_object = java_object_.
get(env);
1419 if (java_object.is_null()) {
1423 const jfloat scaledSize = env->CallFloatMethod(
1424 java_object.obj(), g_get_scaled_font_size_method,
1425 static_cast<jfloat
>(
font_size),
static_cast<jint
>(configuration_id));
1427 return static_cast<double>(scaledSize);
1431 std::vector<uint8_t> buffer,
1432 std::vector<std::string> strings,
1433 std::vector<std::vector<uint8_t>> string_attribute_args) {
1436 auto java_object = java_object_.
get(env);
1437 if (java_object.is_null()) {
1442 env, env->NewDirectByteBuffer(
buffer.data(),
buffer.size()));
1448 env->CallVoidMethod(java_object.obj(), g_update_semantics_method,
1449 direct_buffer.
obj(), jstrings.
obj(),
1450 jstring_attribute_args.
obj());
1456 std::vector<uint8_t> actions_buffer,
1457 std::vector<std::string> strings) {
1460 auto java_object = java_object_.
get(env);
1461 if (java_object.is_null()) {
1467 env->NewDirectByteBuffer(actions_buffer.data(), actions_buffer.size()));
1472 env->CallVoidMethod(java_object.obj(),
1473 g_update_custom_accessibility_actions_method,
1474 direct_actions_buffer.
obj(), jstrings.
obj());
1482 auto java_object = java_object_.
get(env);
1483 if (java_object.is_null()) {
1487 env->CallVoidMethod(java_object.obj(), g_on_first_frame_method);
1495 auto java_object = java_object_.
get(env);
1496 if (java_object.is_null()) {
1500 env->CallVoidMethod(java_object.obj(), g_on_engine_restart_method);
1510 if (surface_texture.is_null()) {
1515 env, env->CallObjectMethod(surface_texture.obj(),
1518 if (surface_texture_local_ref.is_null()) {
1522 env->CallVoidMethod(surface_texture_local_ref.
obj(),
1532 if (surface_texture.is_null()) {
1537 env, env->CallObjectMethod(surface_texture.obj(),
1539 if (surface_texture_local_ref.is_null()) {
1543 jboolean shouldUpdate = env->CallBooleanMethod(
1548 return shouldUpdate;
1555 if (surface_texture.is_null()) {
1560 env, env->CallObjectMethod(surface_texture.obj(),
1562 if (surface_texture_local_ref.is_null()) {
1566 env->CallVoidMethod(surface_texture_local_ref.
obj(),
1576 if (surface_texture.is_null()) {
1581 env, env->CallObjectMethod(surface_texture.obj(),
1583 if (surface_texture_local_ref.is_null()) {
1588 env, env->NewFloatArray(16));
1590 env->CallVoidMethod(surface_texture_local_ref.
obj(),
1594 float* m = env->GetFloatArrayElements(transformMatrix.
obj(),
nullptr);
1596 static_assert(
sizeof(SkScalar) ==
sizeof(
float));
1597 const auto transform = SkM44::ColMajor(m);
1599 env->ReleaseFloatArrayElements(transformMatrix.
obj(), m, JNI_ABORT);
1608 if (surface_texture.is_null()) {
1613 env, env->CallObjectMethod(surface_texture.obj(),
1615 if (surface_texture_local_ref.is_null()) {
1619 env->CallVoidMethod(surface_texture_local_ref.
obj(),
1630 if (image_producer_texture_entry.is_null()) {
1638 env, env->CallObjectMethod(image_producer_texture_entry.obj(),
1641 if (image_producer_texture_entry_local_ref.is_null()) {
1647 env, env->CallObjectMethod(image_producer_texture_entry_local_ref.
obj(),
1660 if (
image.is_null()) {
1673 if (
image.is_null()) {
1684 if (hardware_buffer.is_null()) {
1701 auto java_object = java_object_.
get(env);
1702 if (java_object.is_null()) {
1709 std::vector<std::shared_ptr<Mutator>>::const_iterator iter =
1710 mutators_stack.
Begin();
1711 while (iter != mutators_stack.
End()) {
1712 switch ((*iter)->GetType()) {
1714 const DlMatrix& matrix = (*iter)->GetMatrix();
1716 matrix.
m[0], matrix.
m[4], matrix.
m[12],
1717 matrix.
m[1], matrix.
m[5], matrix.
m[13],
1718 matrix.
m[3], matrix.
m[7], matrix.
m[15],
1721 env, env->NewFloatArray(9));
1723 env->SetFloatArrayRegion(transformMatrix.
obj(), 0, 9, matrix_array);
1724 env->CallVoidMethod(mutatorsStack,
1726 transformMatrix.
obj());
1730 const DlRect& rect = (*iter)->GetRect();
1731 env->CallVoidMethod(mutatorsStack,
1733 static_cast<int>(rect.
GetLeft()),
1734 static_cast<int>(rect.
GetTop()),
1743 SkScalar radiis[8] = {
1750 env, env->NewFloatArray(8));
1751 env->SetFloatArrayRegion(radiisArray.
obj(), 0, 8, radiis);
1752 env->CallVoidMethod(mutatorsStack,
1754 static_cast<int>(rect.
GetLeft()),
1755 static_cast<int>(rect.
GetTop()),
1762 const DlRoundRect& rrect = (*iter)->GetRSEApproximation();
1765 SkScalar radiis[8] = {
1772 env, env->NewFloatArray(8));
1773 env->SetFloatArrayRegion(radiisArray.
obj(), 0, 8, radiis);
1774 env->CallVoidMethod(mutatorsStack,
1776 static_cast<int>(rect.
GetLeft()),
1777 static_cast<int>(rect.
GetTop()),
1793 env->CallVoidMethod(java_object.obj(), g_on_display_platform_view_method,
1808 auto java_object = java_object_.
get(env);
1809 if (java_object.is_null()) {
1813 env->CallVoidMethod(java_object.obj(), g_on_display_overlay_surface_method,
1822 auto java_object = java_object_.
get(env);
1823 if (java_object.is_null()) {
1827 env->CallVoidMethod(java_object.obj(), g_on_begin_frame_method);
1835 auto java_object = java_object_.
get(env);
1836 if (java_object.is_null()) {
1840 env->CallVoidMethod(java_object.obj(), g_on_end_frame_method);
1845std::unique_ptr<PlatformViewAndroidJNI::OverlayMetadata>
1849 auto java_object = java_object_.
get(env);
1850 if (java_object.is_null()) {
1855 env, env->CallObjectMethod(java_object.obj(),
1856 g_create_overlay_surface_method));
1859 if (overlay.is_null()) {
1860 return std::make_unique<PlatformViewAndroidJNI::OverlayMetadata>(0,
1867 jobject overlay_surface =
1870 auto overlay_window = fml::MakeRefCounted<AndroidNativeWindow>(
1871 ANativeWindow_fromSurface(env, overlay_surface));
1873 return std::make_unique<PlatformViewAndroidJNI::OverlayMetadata>(
1874 overlay_id, std::move(overlay_window));
1880 auto java_object = java_object_.
get(env);
1881 if (java_object.is_null()) {
1885 env->CallVoidMethod(java_object.obj(), g_destroy_overlay_surfaces_method);
1890std::unique_ptr<std::vector<std::string>>
1892 std::vector<std::string> supported_locales_data) {
1895 std::unique_ptr<std::vector<std::string>> out =
1896 std::make_unique<std::vector<std::string>>();
1898 auto java_object = java_object_.
get(env);
1899 if (java_object.is_null()) {
1904 jobjectArray result =
static_cast<jobjectArray
>(env->CallObjectMethod(
1906 j_locales_data.
obj()));
1910 int length = env->GetArrayLength(result);
1913 env,
static_cast<jstring
>(env->GetObjectArrayElement(result,
i))));
1921 auto java_object = java_object_.
get(env);
1922 if (java_object.is_null()) {
1927 env, env->GetObjectClass(java_object.obj()));
1928 if (clazz.is_null()) {
1932 jfieldID fid = env->GetStaticFieldID(clazz.
obj(),
"refreshRateFPS",
"F");
1933 return static_cast<double>(env->GetStaticFloatField(clazz.
obj(), fid));
1939 auto java_object = java_object_.
get(env);
1940 if (java_object.is_null()) {
1945 env, env->GetObjectClass(java_object.obj()));
1946 if (clazz.is_null()) {
1950 jfieldID fid = env->GetStaticFieldID(clazz.
obj(),
"displayWidth",
"F");
1951 return static_cast<double>(env->GetStaticFloatField(clazz.
obj(), fid));
1957 auto java_object = java_object_.
get(env);
1958 if (java_object.is_null()) {
1963 env, env->GetObjectClass(java_object.obj()));
1964 if (clazz.is_null()) {
1968 jfieldID fid = env->GetStaticFieldID(clazz.
obj(),
"displayHeight",
"F");
1969 return static_cast<double>(env->GetStaticFloatField(clazz.
obj(), fid));
1975 auto java_object = java_object_.
get(env);
1976 if (java_object.is_null()) {
1981 env, env->GetObjectClass(java_object.obj()));
1982 if (clazz.is_null()) {
1986 jfieldID fid = env->GetStaticFieldID(clazz.
obj(),
"displayDensity",
"F");
1987 return static_cast<double>(env->GetStaticFloatField(clazz.
obj(), fid));
1991 int loading_unit_id) {
1994 auto java_object = java_object_.
get(env);
1995 if (java_object.is_null()) {
2011 auto java_object = java_object_.
get(env);
2012 if (java_object.is_null()) {
2018 env->CallObjectMethod(java_object.obj(), g_create_transaction_method));
2019 if (transaction.is_null()) {
2025 env, transaction.
obj());
2031 auto java_object = java_object_.
get(env);
2032 if (java_object.is_null()) {
2036 env->CallVoidMethod(java_object.obj(), g_swap_transaction_method);
2044 auto java_object = java_object_.
get(env);
2045 if (java_object.is_null()) {
2049 env->CallVoidMethod(java_object.obj(), g_apply_transaction_method);
2054std::unique_ptr<PlatformViewAndroidJNI::OverlayMetadata>
2058 auto java_object = java_object_.
get(env);
2059 if (java_object.is_null()) {
2064 env, env->CallObjectMethod(java_object.obj(),
2065 g_create_overlay_surface2_method));
2068 if (overlay.is_null()) {
2069 return std::make_unique<PlatformViewAndroidJNI::OverlayMetadata>(0,
2076 jobject overlay_surface =
2079 auto overlay_window = fml::MakeRefCounted<AndroidNativeWindow>(
2080 ANativeWindow_fromSurface(env, overlay_surface));
2082 return std::make_unique<PlatformViewAndroidJNI::OverlayMetadata>(
2083 overlay_id, std::move(overlay_window));
2089 auto java_object = java_object_.
get(env);
2090 if (java_object.is_null()) {
2094 env->CallVoidMethod(java_object.obj(), g_destroy_overlay_surface2_method);
2102 explicit AndroidPathReceiver(JNIEnv* env)
2107 jfieldID fill_type_field_id;
2109 case DlPathFillType::kOdd:
2112 case DlPathFillType::kNonZero:
2126 fill_type_field_id));
2132 fill_type_enum.
obj());
2136 void MoveTo(
const DlPoint& p2,
bool will_be_closed)
override {
2144 cp.x, cp.y, p2.x, p2.y);
2151 cp.x, cp.y, p2.x, p2.y, weight);
2158 cp1.x, cp1.y, cp2.x, cp2.y, p2.x, p2.y);
2160 void Close()
override {
2164 jobject TakePath()
const {
return android_path_; }
2168 jobject android_path_;
2182 auto java_object = java_object_.
get(env);
2183 if (java_object.is_null()) {
2190 std::vector<std::shared_ptr<Mutator>>::const_iterator iter =
2191 mutators_stack.
Begin();
2192 while (iter != mutators_stack.
End()) {
2193 switch ((*iter)->GetType()) {
2195 const DlMatrix& matrix = (*iter)->GetMatrix();
2197 matrix.
m[0], matrix.
m[4], matrix.
m[12],
2198 matrix.
m[1], matrix.
m[5], matrix.
m[13],
2199 matrix.
m[3], matrix.
m[7], matrix.
m[15],
2202 env, env->NewFloatArray(9));
2204 env->SetFloatArrayRegion(transformMatrix.
obj(), 0, 9, matrix_array);
2205 env->CallVoidMethod(mutatorsStack,
2207 transformMatrix.
obj());
2211 const DlRect& rect = (*iter)->GetRect();
2212 env->CallVoidMethod(mutatorsStack,
2214 static_cast<int>(rect.
GetLeft()),
2215 static_cast<int>(rect.
GetTop()),
2224 SkScalar radiis[8] = {
2231 env, env->NewFloatArray(8));
2232 env->SetFloatArrayRegion(radiisArray.
obj(), 0, 8, radiis);
2233 env->CallVoidMethod(mutatorsStack,
2235 static_cast<int>(rect.
GetLeft()),
2236 static_cast<int>(rect.
GetTop()),
2243 const DlRoundRect& rrect = (*iter)->GetRSEApproximation();
2246 SkScalar radiis[8] = {
2253 env, env->NewFloatArray(8));
2254 env->SetFloatArrayRegion(radiisArray.
obj(), 0, 8, radiis);
2255 env->CallVoidMethod(mutatorsStack,
2257 static_cast<int>(rect.
GetLeft()),
2258 static_cast<int>(rect.
GetTop()),
2265 float opacity = (*iter)->GetAlphaFloat();
2271 auto& dlPath = (*iter)->GetPath();
2281 AndroidPathReceiver receiver(env);
2282 receiver.SetFillType(dlPath.GetFillType());
2287 dlPath.Dispatch(receiver);
2289 env->CallVoidMethod(mutatorsStack,
2291 receiver.TakePath());
2302 env->CallVoidMethod(java_object.obj(), g_on_display_platform_view2_method,
2311 auto java_object = java_object_.
get(env);
2312 if (java_object.is_null()) {
2316 env->CallVoidMethod(java_object.obj(), g_hide_platform_view2_method,
view_id);
2322 auto java_object = java_object_.
get(env);
2323 if (java_object.is_null()) {
2327 env->CallVoidMethod(java_object.obj(), g_on_end_frame2_method);
2335 auto java_object = java_object_.
get(env);
2336 if (java_object.is_null()) {
2340 env->CallVoidMethod(java_object.obj(), g_show_overlay_surface2_method);
2347 auto java_object = java_object_.
get(env);
2348 if (java_object.is_null()) {
2352 env->CallVoidMethod(java_object.obj(), g_hide_overlay_surface2_method);
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 GBytes * message
G_BEGIN_DECLS FlutterViewId view_id
#define FML_LOG(severity)
#define FML_CHECK(condition)
#define FML_DCHECK(condition)
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)
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
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 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)
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