Concrete implementation of PlatformViewAndroidJNI that is compiled with the Android toolchain.
More...
#include <platform_view_android_jni_impl.h>
Public Member Functions | |
| PlatformViewAndroidJNIImpl (const fml::jni::JavaObjectWeakGlobalRef &java_object) | |
| ~PlatformViewAndroidJNIImpl () override | |
| void | FlutterViewHandlePlatformMessage (std::unique_ptr< flutter::PlatformMessage > message, int responseId) override |
| Sends a platform message. The message may be empty. | |
| void | FlutterViewHandlePlatformMessageResponse (int responseId, std::unique_ptr< fml::Mapping > data) override |
Responds to a platform message. The data may be a nullptr. | |
| void | FlutterViewUpdateSemantics (std::vector< uint8_t > buffer, std::vector< std::string > strings, std::vector< std::vector< uint8_t > > string_attribute_args) override |
| Sends semantics tree updates. | |
| void | FlutterViewSetApplicationLocale (std::string locale) override |
| Set application locale to a given language. | |
| void | FlutterViewUpdateCustomAccessibilityActions (std::vector< uint8_t > actions_buffer, std::vector< std::string > strings) override |
| Sends new custom accessibility events. | |
| void | FlutterViewOnFirstFrame () override |
| Indicates that FlutterView should start painting pixels. | |
| void | FlutterViewOnPreEngineRestart () override |
| Indicates that a hot restart is about to happen. | |
| void | SurfaceTextureAttachToGLContext (JavaLocalRef surface_texture, int textureId) override |
| Attach the SurfaceTexture to the OpenGL ES context that is current on the calling thread. | |
| bool | SurfaceTextureShouldUpdate (JavaLocalRef surface_texture) override |
| Returns true if surface_texture should be updated. | |
| void | SurfaceTextureUpdateTexImage (JavaLocalRef surface_texture) override |
| Updates the texture image to the most recent frame from the image stream. | |
| SkM44 | SurfaceTextureGetTransformMatrix (JavaLocalRef surface_texture) override |
Gets the transform matrix from the SurfaceTexture. Then, it updates the transform matrix, so it fill the canvas and preserve the aspect ratio. | |
| void | SurfaceTextureDetachFromGLContext (JavaLocalRef surface_texture) override |
| Detaches a SurfaceTexture from the OpenGL ES context. | |
| JavaLocalRef | ImageProducerTextureEntryAcquireLatestImage (JavaLocalRef image_texture_entry) override |
| Acquire the latest image available. | |
| JavaLocalRef | ImageGetHardwareBuffer (JavaLocalRef image) override |
| Grab the HardwareBuffer from image. | |
| void | ImageClose (JavaLocalRef image) override |
| Call close on image. | |
| void | HardwareBufferClose (JavaLocalRef hardware_buffer) override |
| Call close on hardware_buffer. | |
| void | FlutterViewOnDisplayPlatformView (int view_id, int x, int y, int width, int height, int viewWidth, int viewHeight, MutatorsStack mutators_stack) override |
| Positions and sizes a platform view if using hybrid composition. | |
| void | FlutterViewDisplayOverlaySurface (int surface_id, int x, int y, int width, int height) override |
| Positions and sizes an overlay surface in hybrid composition. | |
| void | FlutterViewBeginFrame () override |
| Initiates a frame if using hybrid composition. | |
| void | FlutterViewEndFrame () override |
| Indicates that the current frame ended. It's used to clean up state. | |
| std::unique_ptr< PlatformViewAndroidJNI::OverlayMetadata > | FlutterViewCreateOverlaySurface () override |
| Instantiates an overlay surface in hybrid composition and provides the necessary metadata to operate the surface in C. | |
| void | FlutterViewDestroyOverlaySurfaces () override |
| Destroys the overlay surfaces. | |
| std::unique_ptr< std::vector< std::string > > | FlutterViewComputePlatformResolvedLocale (std::vector< std::string > supported_locales_data) override |
| Computes the locale Android would select. | |
| double | GetDisplayRefreshRate () override |
| double | GetDisplayWidth () override |
| double | GetDisplayHeight () override |
| double | GetDisplayDensity () override |
| bool | RequestDartDeferredLibrary (int loading_unit_id) override |
| double | FlutterViewGetScaledFontSize (double unscaled_font_size, int configuration_id) const override |
| ASurfaceTransaction * | createTransaction () override |
| void | swapTransaction () override |
| void | applyTransaction () override |
| std::unique_ptr< PlatformViewAndroidJNI::OverlayMetadata > | createOverlaySurface2 () override |
| void | destroyOverlaySurface2 () override |
| void | onDisplayPlatformView2 (int32_t view_id, int32_t x, int32_t y, int32_t width, int32_t height, int32_t viewWidth, int32_t viewHeight, MutatorsStack mutators_stack) override |
| void | hidePlatformView2 (int32_t view_id) override |
| void | showOverlaySurface2 () override |
| void | hideOverlaySurface2 () override |
| void | onEndFrame2 () override |
Public Member Functions inherited from flutter::PlatformViewAndroidJNI | |
| virtual | ~PlatformViewAndroidJNI () |
Concrete implementation of PlatformViewAndroidJNI that is compiled with the Android toolchain.
Definition at line 17 of file platform_view_android_jni_impl.h.
|
explicit |
Definition at line 1326 of file platform_view_android_jni_impl.cc.
|
overridedefault |
|
overridevirtual |
Implements flutter::PlatformViewAndroidJNI.
Definition at line 2041 of file platform_view_android_jni_impl.cc.
References fml::jni::AttachCurrentThread(), fml::jni::CheckException(), FML_CHECK, and fml::jni::JavaObjectWeakGlobalRef::get().
|
overridevirtual |
Implements flutter::PlatformViewAndroidJNI.
Definition at line 2055 of file platform_view_android_jni_impl.cc.
References fml::jni::AttachCurrentThread(), fml::jni::CheckException(), FML_CHECK, flutter::g_overlay_surface_id_method, flutter::g_overlay_surface_surface_method, fml::jni::JavaObjectWeakGlobalRef::get(), and fml::jni::JavaRef< T >::obj().
|
overridevirtual |
Implements flutter::PlatformViewAndroidJNI.
Definition at line 2008 of file platform_view_android_jni_impl.cc.
References fml::jni::AttachCurrentThread(), fml::jni::CheckException(), FML_CHECK, fml::jni::JavaObjectWeakGlobalRef::get(), impeller::android::GetProcTable(), and fml::jni::JavaRef< T >::obj().
|
overridevirtual |
Implements flutter::PlatformViewAndroidJNI.
Definition at line 2086 of file platform_view_android_jni_impl.cc.
References fml::jni::AttachCurrentThread(), fml::jni::CheckException(), FML_CHECK, and fml::jni::JavaObjectWeakGlobalRef::get().
|
overridevirtual |
Initiates a frame if using hybrid composition.
Implements flutter::PlatformViewAndroidJNI.
Definition at line 1819 of file platform_view_android_jni_impl.cc.
References fml::jni::AttachCurrentThread(), fml::jni::CheckException(), FML_CHECK, and fml::jni::JavaObjectWeakGlobalRef::get().
|
overridevirtual |
Computes the locale Android would select.
Implements flutter::PlatformViewAndroidJNI.
Definition at line 1891 of file platform_view_android_jni_impl.cc.
References fml::jni::AttachCurrentThread(), fml::jni::CheckException(), FML_CHECK, flutter::g_compute_platform_resolved_locale_method, fml::jni::JavaObjectWeakGlobalRef::get(), i, fml::jni::JavaStringToString(), length, fml::jni::JavaRef< T >::obj(), and fml::jni::VectorToStringArray().
|
overridevirtual |
Instantiates an overlay surface in hybrid composition and provides the necessary metadata to operate the surface in C.
Implements flutter::PlatformViewAndroidJNI.
Definition at line 1846 of file platform_view_android_jni_impl.cc.
References fml::jni::AttachCurrentThread(), fml::jni::CheckException(), FML_CHECK, flutter::g_overlay_surface_id_method, flutter::g_overlay_surface_surface_method, fml::jni::JavaObjectWeakGlobalRef::get(), and fml::jni::JavaRef< T >::obj().
|
overridevirtual |
Destroys the overlay surfaces.
Implements flutter::PlatformViewAndroidJNI.
Definition at line 1877 of file platform_view_android_jni_impl.cc.
References fml::jni::AttachCurrentThread(), fml::jni::CheckException(), FML_CHECK, and fml::jni::JavaObjectWeakGlobalRef::get().
|
overridevirtual |
Positions and sizes an overlay surface in hybrid composition.
Implements flutter::PlatformViewAndroidJNI.
Definition at line 1800 of file platform_view_android_jni_impl.cc.
References fml::jni::AttachCurrentThread(), fml::jni::CheckException(), FML_CHECK, fml::jni::JavaObjectWeakGlobalRef::get(), height, width, x, and y.
|
overridevirtual |
Indicates that the current frame ended. It's used to clean up state.
Implements flutter::PlatformViewAndroidJNI.
Definition at line 1832 of file platform_view_android_jni_impl.cc.
References fml::jni::AttachCurrentThread(), fml::jni::CheckException(), FML_CHECK, and fml::jni::JavaObjectWeakGlobalRef::get().
|
overridevirtual |
Implements flutter::PlatformViewAndroidJNI.
Definition at line 1413 of file platform_view_android_jni_impl.cc.
References fml::jni::AttachCurrentThread(), fml::jni::CheckException(), FML_CHECK, font_size, and fml::jni::JavaObjectWeakGlobalRef::get().
|
overridevirtual |
Sends a platform message. The message may be empty.
Implements flutter::PlatformViewAndroidJNI.
Definition at line 1332 of file platform_view_android_jni_impl.cc.
References fml::jni::AttachCurrentThread(), fml::jni::CheckException(), FML_CHECK, fml::jni::JavaObjectWeakGlobalRef::get(), message, fml::jni::JavaRef< T >::obj(), fml::MallocMapping::Release(), and fml::jni::StringToJavaString().
|
overridevirtual |
Responds to a platform message. The data may be a nullptr.
Implements flutter::PlatformViewAndroidJNI.
Definition at line 1382 of file platform_view_android_jni_impl.cc.
References fml::jni::AttachCurrentThread(), fml::jni::CheckException(), flutter::data, FML_CHECK, fml::jni::JavaObjectWeakGlobalRef::get(), and fml::jni::JavaRef< T >::obj().
|
overridevirtual |
Positions and sizes a platform view if using hybrid composition.
Implements flutter::PlatformViewAndroidJNI.
Definition at line 1691 of file platform_view_android_jni_impl.cc.
References fml::jni::AttachCurrentThread(), flutter::MutatorsStack::Begin(), impeller::RoundingRadii::bottom_left, impeller::RoundingRadii::bottom_right, fml::jni::CheckException(), flutter::MutatorsStack::End(), FML_CHECK, flutter::g_mutators_stack_class, flutter::g_mutators_stack_init_method, flutter::g_mutators_stack_push_cliprect_method, flutter::g_mutators_stack_push_cliprrect_method, flutter::g_mutators_stack_push_transform_method, fml::jni::JavaObjectWeakGlobalRef::get(), impeller::TRect< T >::GetBottom(), impeller::RoundRect::GetBounds(), impeller::TRect< T >::GetLeft(), impeller::RoundRect::GetRadii(), impeller::TRect< T >::GetRight(), impeller::TRect< T >::GetTop(), impeller::TSize< T >::height, height, flutter::kBackdropFilter, flutter::kClipPath, flutter::kClipRect, flutter::kClipRRect, flutter::kClipRSE, flutter::kOpacity, flutter::kTransform, impeller::Matrix::m, fml::jni::JavaRef< T >::obj(), impeller::RoundingRadii::top_left, impeller::RoundingRadii::top_right, view_id, impeller::TSize< T >::width, width, x, and y.
|
overridevirtual |
Indicates that FlutterView should start painting pixels.
Implements flutter::PlatformViewAndroidJNI.
Definition at line 1479 of file platform_view_android_jni_impl.cc.
References fml::jni::AttachCurrentThread(), fml::jni::CheckException(), FML_CHECK, and fml::jni::JavaObjectWeakGlobalRef::get().
|
overridevirtual |
Indicates that a hot restart is about to happen.
Implements flutter::PlatformViewAndroidJNI.
Definition at line 1492 of file platform_view_android_jni_impl.cc.
References fml::jni::AttachCurrentThread(), fml::jni::CheckException(), FML_CHECK, and fml::jni::JavaObjectWeakGlobalRef::get().
|
overridevirtual |
Set application locale to a given language.
Implements flutter::PlatformViewAndroidJNI.
Definition at line 1364 of file platform_view_android_jni_impl.cc.
References fml::jni::AttachCurrentThread(), fml::jni::CheckException(), FML_CHECK, fml::jni::JavaObjectWeakGlobalRef::get(), fml::jni::JavaRef< T >::obj(), and fml::jni::StringToJavaString().
|
overridevirtual |
Sends new custom accessibility events.
Implements flutter::PlatformViewAndroidJNI.
Definition at line 1455 of file platform_view_android_jni_impl.cc.
References fml::jni::AttachCurrentThread(), fml::jni::CheckException(), FML_CHECK, fml::jni::JavaObjectWeakGlobalRef::get(), fml::jni::JavaRef< T >::obj(), and fml::jni::VectorToStringArray().
|
overridevirtual |
Sends semantics tree updates.
Implements flutter::PlatformViewAndroidJNI.
Definition at line 1430 of file platform_view_android_jni_impl.cc.
References fml::jni::AttachCurrentThread(), flutter::buffer, fml::jni::CheckException(), FML_CHECK, fml::jni::JavaObjectWeakGlobalRef::get(), fml::jni::JavaRef< T >::obj(), fml::jni::VectorToBufferArray(), and fml::jni::VectorToStringArray().
|
overridevirtual |
Implements flutter::PlatformViewAndroidJNI.
Definition at line 1972 of file platform_view_android_jni_impl.cc.
References fml::jni::AttachCurrentThread(), fml::jni::JavaObjectWeakGlobalRef::get(), and fml::jni::JavaRef< T >::obj().
|
overridevirtual |
Implements flutter::PlatformViewAndroidJNI.
Definition at line 1954 of file platform_view_android_jni_impl.cc.
References fml::jni::AttachCurrentThread(), fml::jni::JavaObjectWeakGlobalRef::get(), and fml::jni::JavaRef< T >::obj().
|
overridevirtual |
Implements flutter::PlatformViewAndroidJNI.
Definition at line 1918 of file platform_view_android_jni_impl.cc.
References fml::jni::AttachCurrentThread(), fml::jni::JavaObjectWeakGlobalRef::get(), flutter::kUnknownDisplayRefreshRate, and fml::jni::JavaRef< T >::obj().
|
overridevirtual |
Implements flutter::PlatformViewAndroidJNI.
Definition at line 1936 of file platform_view_android_jni_impl.cc.
References fml::jni::AttachCurrentThread(), fml::jni::JavaObjectWeakGlobalRef::get(), and fml::jni::JavaRef< T >::obj().
|
overridevirtual |
Call close on hardware_buffer.
Implements flutter::PlatformViewAndroidJNI.
Definition at line 1680 of file platform_view_android_jni_impl.cc.
References fml::jni::AttachCurrentThread(), fml::jni::CheckException(), FML_CHECK, and flutter::g_hardware_buffer_close_method.
|
overridevirtual |
Implements flutter::PlatformViewAndroidJNI.
Definition at line 2344 of file platform_view_android_jni_impl.cc.
References fml::jni::AttachCurrentThread(), fml::jni::CheckException(), FML_CHECK, and fml::jni::JavaObjectWeakGlobalRef::get().
|
overridevirtual |
Implements flutter::PlatformViewAndroidJNI.
Definition at line 2309 of file platform_view_android_jni_impl.cc.
References fml::jni::AttachCurrentThread(), fml::jni::JavaObjectWeakGlobalRef::get(), and view_id.
|
overridevirtual |
Call close on image.
Implements flutter::PlatformViewAndroidJNI.
Definition at line 1671 of file platform_view_android_jni_impl.cc.
References fml::jni::AttachCurrentThread(), fml::jni::CheckException(), FML_CHECK, flutter::g_image_close_method, and image.
|
overridevirtual |
Grab the HardwareBuffer from image.
Implements flutter::PlatformViewAndroidJNI.
Definition at line 1656 of file platform_view_android_jni_impl.cc.
References fml::jni::AttachCurrentThread(), fml::jni::CheckException(), FML_CHECK, flutter::g_image_get_hardware_buffer_method, and image.
|
overridevirtual |
Acquire the latest image available.
Implements flutter::PlatformViewAndroidJNI.
Definition at line 1626 of file platform_view_android_jni_impl.cc.
References fml::jni::AttachCurrentThread(), fml::jni::CheckException(), flutter::g_acquire_latest_image_method, flutter::g_java_weak_reference_get_method, and fml::jni::JavaRef< T >::obj().
|
overridevirtual |
Implements flutter::PlatformViewAndroidJNI.
Definition at line 2172 of file platform_view_android_jni_impl.cc.
References fml::jni::AttachCurrentThread(), flutter::MutatorsStack::Begin(), impeller::RoundingRadii::bottom_left, impeller::RoundingRadii::bottom_right, fml::jni::CheckException(), flutter::MutatorsStack::End(), FML_CHECK, FML_DCHECK, flutter::g_mutators_stack_class, flutter::g_mutators_stack_init_method, flutter::g_mutators_stack_push_clippath_method, flutter::g_mutators_stack_push_cliprect_method, flutter::g_mutators_stack_push_cliprrect_method, flutter::g_mutators_stack_push_opacity_method, flutter::g_mutators_stack_push_transform_method, fml::jni::JavaObjectWeakGlobalRef::get(), impeller::TRect< T >::GetBottom(), impeller::RoundRect::GetBounds(), impeller::TRect< T >::GetLeft(), impeller::RoundRect::GetRadii(), impeller::TRect< T >::GetRight(), impeller::TRect< T >::GetTop(), impeller::TSize< T >::height, height, flutter::kBackdropFilter, flutter::kClipPath, flutter::kClipRect, flutter::kClipRRect, flutter::kClipRSE, flutter::kOpacity, flutter::kTransform, impeller::Matrix::m, fml::jni::JavaRef< T >::obj(), impeller::RoundingRadii::top_left, impeller::RoundingRadii::top_right, view_id, impeller::TSize< T >::width, width, x, and y.
|
overridevirtual |
Implements flutter::PlatformViewAndroidJNI.
Definition at line 2319 of file platform_view_android_jni_impl.cc.
References fml::jni::AttachCurrentThread(), fml::jni::CheckException(), FML_CHECK, and fml::jni::JavaObjectWeakGlobalRef::get().
|
overridevirtual |
Implements flutter::PlatformViewAndroidJNI.
Definition at line 1990 of file platform_view_android_jni_impl.cc.
References fml::jni::AttachCurrentThread(), fml::jni::CheckException(), FML_CHECK, flutter::g_request_dart_deferred_library_method, and fml::jni::JavaObjectWeakGlobalRef::get().
|
overridevirtual |
Implements flutter::PlatformViewAndroidJNI.
Definition at line 2332 of file platform_view_android_jni_impl.cc.
References fml::jni::AttachCurrentThread(), fml::jni::CheckException(), FML_CHECK, and fml::jni::JavaObjectWeakGlobalRef::get().
|
overridevirtual |
Attach the SurfaceTexture to the OpenGL ES context that is current on the calling thread.
Implements flutter::PlatformViewAndroidJNI.
Definition at line 1505 of file platform_view_android_jni_impl.cc.
References fml::jni::AttachCurrentThread(), fml::jni::CheckException(), FML_CHECK, flutter::g_attach_to_gl_context_method, flutter::g_java_weak_reference_get_method, and fml::jni::JavaRef< T >::obj().
|
overridevirtual |
Detaches a SurfaceTexture from the OpenGL ES context.
Implements flutter::PlatformViewAndroidJNI.
Definition at line 1604 of file platform_view_android_jni_impl.cc.
References fml::jni::AttachCurrentThread(), fml::jni::CheckException(), FML_CHECK, flutter::g_detach_from_gl_context_method, flutter::g_java_weak_reference_get_method, and fml::jni::JavaRef< T >::obj().
|
overridevirtual |
Gets the transform matrix from the SurfaceTexture. Then, it updates the transform matrix, so it fill the canvas and preserve the aspect ratio.
Implements flutter::PlatformViewAndroidJNI.
Definition at line 1572 of file platform_view_android_jni_impl.cc.
References fml::jni::AttachCurrentThread(), fml::jni::CheckException(), FML_CHECK, flutter::g_get_transform_matrix_method, flutter::g_java_weak_reference_get_method, fml::jni::JavaRef< T >::obj(), and transform.
|
overridevirtual |
Returns true if surface_texture should be updated.
Implements flutter::PlatformViewAndroidJNI.
Definition at line 1528 of file platform_view_android_jni_impl.cc.
References fml::jni::AttachCurrentThread(), fml::jni::CheckException(), FML_CHECK, flutter::g_java_weak_reference_get_method, flutter::g_surface_texture_wrapper_should_update, and fml::jni::JavaRef< T >::obj().
|
overridevirtual |
Updates the texture image to the most recent frame from the image stream.
Implements flutter::PlatformViewAndroidJNI.
Definition at line 1551 of file platform_view_android_jni_impl.cc.
References fml::jni::AttachCurrentThread(), fml::jni::CheckException(), FML_CHECK, flutter::g_java_weak_reference_get_method, flutter::g_update_tex_image_method, and fml::jni::JavaRef< T >::obj().
|
overridevirtual |
Implements flutter::PlatformViewAndroidJNI.
Definition at line 2028 of file platform_view_android_jni_impl.cc.
References fml::jni::AttachCurrentThread(), fml::jni::CheckException(), FML_CHECK, and fml::jni::JavaObjectWeakGlobalRef::get().