Flutter Engine
flutter::PlatformViewAndroid Class Referencefinal

#include <platform_view_android.h>

Inheritance diagram for flutter::PlatformViewAndroid:
flutter::PlatformView

Public Member Functions

 PlatformViewAndroid (PlatformView::Delegate &delegate, flutter::TaskRunners task_runners, std::shared_ptr< PlatformViewAndroidJNI > jni_facade)
 
 PlatformViewAndroid (PlatformView::Delegate &delegate, flutter::TaskRunners task_runners, std::shared_ptr< PlatformViewAndroidJNI > jni_facade, bool use_software_rendering)
 
 ~PlatformViewAndroid () override
 
void NotifyCreated (fml::RefPtr< AndroidNativeWindow > native_window)
 
void NotifySurfaceWindowChanged (fml::RefPtr< AndroidNativeWindow > native_window)
 
void NotifyChanged (const SkISize &size)
 
void NotifyDestroyed () override
 Used by embedders to notify the shell that the platform view has been destroyed. This notification used to collect the rendering surface and all associated resources. Frame scheduling is also suspended. More...
 
void DispatchPlatformMessage (JNIEnv *env, std::string name, jobject message_data, jint message_position, jint response_id)
 
void DispatchEmptyPlatformMessage (JNIEnv *env, std::string name, jint response_id)
 
void InvokePlatformMessageResponseCallback (JNIEnv *env, jint response_id, jobject java_response_data, jint java_response_position)
 
void InvokePlatformMessageEmptyResponseCallback (JNIEnv *env, jint response_id)
 
void DispatchSemanticsAction (JNIEnv *env, jint id, jint action, jobject args, jint args_position)
 
void RegisterExternalTexture (int64_t texture_id, const fml::jni::JavaObjectWeakGlobalRef &surface_texture)
 
- Public Member Functions inherited from flutter::PlatformView
 PlatformView (Delegate &delegate, TaskRunners task_runners)
 Creates a platform view with the specified delegate and task runner. The base class by itself does not do much but is suitable for use in test environments where full platform integration may not be necessary. The platform view may only be created, accessed and destroyed on the platform task runner. More...
 
virtual ~PlatformView ()
 Destroys the platform view. The platform view is owned by the shell and will be destroyed by the same on the platform tasks runner. More...
 
void DispatchPlatformMessage (fml::RefPtr< PlatformMessage > message)
 Used by embedders to dispatch a platform message to a running root isolate hosted by the engine. If an isolate is not running, the message is dropped. If there is no one on the other side listening on the channel, the message is dropped. When a platform message is dropped, any response handles associated with that message will be dropped as well. All users of platform messages must assume that message may not be delivered and/or their response handles may not be invoked. Platform messages are not buffered. More...
 
void DispatchSemanticsAction (int32_t id, SemanticsAction action, std::vector< uint8_t > args)
 Used by embedders to dispatch an accessibility action to a running isolate hosted by the engine. More...
 
virtual void SetSemanticsEnabled (bool enabled)
 Used by embedder to notify the running isolate hosted by the engine on the UI thread that the accessibility tree needs to be generated. More...
 
virtual void SetAccessibilityFeatures (int32_t flags)
 Used by the embedder to specify the features to enable in the accessibility tree generated by the isolate. This information is forwarded to the root isolate hosted by the engine on the UI thread. More...
 
void SetViewportMetrics (const ViewportMetrics &metrics)
 Used by embedders to specify the updated viewport metrics. In response to this call, on the raster thread, the rasterizer may need to be reconfigured to the updated viewport dimensions. On the UI thread, the framework may need to start generating a new frame for the updated viewport metrics as well. More...
 
void NotifyCreated ()
 Used by embedders to notify the shell that a platform view has been created. This notification is used to create a rendering surface and pick the client rendering API to use to render into this surface. No frames will be scheduled or rendered before this call. The surface must remain valid till the corresponding call to NotifyDestroyed. More...
 
virtual PointerDataDispatcherMaker GetDispatcherMaker ()
 Returns a platform-specific PointerDataDispatcherMaker so the Engine can construct the PointerDataPacketDispatcher based on platforms. More...
 
fml::WeakPtr< PlatformViewGetWeakPtr () const
 Returns a weak pointer to the platform view. Since the platform view may only be created, accessed and destroyed on the platform thread, any access to the platform view from a non-platform task runner needs a weak pointer to the platform view along with a reference to the platform task runner. A task must be posted to the platform task runner with the weak pointer captured in the same. The platform view method may only be called in the posted task once the weak pointer validity has been checked. This method is used by callers to obtain that weak pointer. More...
 
void SetNextFrameCallback (const fml::closure &closure)
 Sets a callback that gets executed when the rasterizer renders the next frame. Due to the asynchronous nature of rendering in Flutter, embedders usually add a placeholder over the contents in which Flutter is going to render when Flutter is first initialized. This callback may be used as a signal to remove that placeholder. The callback is executed on the render task runner and not the platform task runner. It is the embedder's responsibility to re-thread as necessary. More...
 
void DispatchPointerDataPacket (std::unique_ptr< PointerDataPacket > packet)
 Dispatches pointer events from the embedder to the framework. Each pointer data packet may contain multiple pointer input events. Each call to this method wakes up the UI thread. More...
 
void RegisterTexture (std::shared_ptr< flutter::Texture > texture)
 Used by the embedder to specify a texture that it wants the rasterizer to composite within the Flutter layer tree. All textures must have a unique identifier. When the rasterizer encounters an external texture within its hierarchy, it gives the embedder a chance to update that texture on the raster thread before it composites the same on-screen. More...
 
void UnregisterTexture (int64_t texture_id)
 Used by the embedder to notify the rasterizer that it will no longer attempt to composite the specified texture within the layer tree. This allows the rasterizer to collect associated resources. More...
 
void MarkTextureFrameAvailable (int64_t texture_id)
 Used by the embedder to notify the rasterizer that the context of the previously registered texture have been updated. Typically, Flutter will only render a frame if there is an updated layer tree. However, in cases where the layer tree is static but one of the externally composited textures has been updated by the embedder, the embedder needs to notify the rasterizer to render a new frame. In such cases, the existing layer tree may be reused with the frame re-composited with all updated external textures. Unlike the calls to register and unregister the texture, this call must be made each time a new texture frame is available. More...
 

Static Public Member Functions

static bool Register (JNIEnv *env)
 

Additional Inherited Members

- Protected Attributes inherited from flutter::PlatformView
PlatformView::Delegatedelegate_
 
const TaskRunners task_runners_
 
PointerDataPacketConverter pointer_data_packet_converter_
 
SkISize size_
 
fml::WeakPtrFactory< PlatformViewweak_factory_
 

Detailed Description

Definition at line 43 of file platform_view_android.h.

Constructor & Destructor Documentation

◆ PlatformViewAndroid() [1/2]

flutter::PlatformViewAndroid::PlatformViewAndroid ( PlatformView::Delegate delegate,
flutter::TaskRunners  task_runners,
std::shared_ptr< PlatformViewAndroidJNI jni_facade 
)

Definition at line 102 of file platform_view_android.cc.

References ~PlatformViewAndroid().

106  : PlatformView(delegate, std::move(task_runners)),
107  jni_facade_(jni_facade),
108  platform_view_android_delegate_(jni_facade) {}
PlatformView(Delegate &delegate, TaskRunners task_runners)
Creates a platform view with the specified delegate and task runner. The base class by itself does no...

◆ PlatformViewAndroid() [2/2]

flutter::PlatformViewAndroid::PlatformViewAndroid ( PlatformView::Delegate delegate,
flutter::TaskRunners  task_runners,
std::shared_ptr< PlatformViewAndroidJNI jni_facade,
bool  use_software_rendering 
)

Definition at line 65 of file platform_view_android.cc.

References FML_CHECK, flutter::kOpenGLES, flutter::kSoftware, and flutter::kVulkan.

70  : PlatformView(delegate, std::move(task_runners)),
71  jni_facade_(jni_facade),
72  platform_view_android_delegate_(jni_facade) {
73  std::shared_ptr<AndroidContext> android_context;
74  if (use_software_rendering) {
75  android_context =
76  std::make_shared<AndroidContext>(AndroidRenderingAPI::kSoftware);
77  } else {
78 #if SHELL_ENABLE_VULKAN
79  android_context =
80  std::make_shared<AndroidContext>(AndroidRenderingAPI::kVulkan);
81 #else // SHELL_ENABLE_VULKAN
82  android_context = std::make_shared<AndroidContextGL>(
84  fml::MakeRefCounted<AndroidEnvironmentGL>());
85 #endif // SHELL_ENABLE_VULKAN
86  }
87  FML_CHECK(android_context && android_context->IsValid())
88  << "Could not create an Android context.";
89 
90  surface_factory_ =
91  std::make_shared<AndroidSurfaceFactoryImpl>(android_context, jni_facade);
92  external_view_embedder_ = std::make_shared<AndroidExternalViewEmbedder>(
93  android_context, jni_facade, surface_factory_);
94  surface_factory_->SetExternalViewEmbedder(external_view_embedder_);
95 
96  android_surface_ = surface_factory_->CreateSurface();
97  FML_CHECK(android_surface_ && android_surface_->IsValid())
98  << "Could not create an OpenGL, Vulkan or Software surface to setup "
99  "rendering.";
100 }
PlatformView(Delegate &delegate, TaskRunners task_runners)
Creates a platform view with the specified delegate and task runner. The base class by itself does no...
#define FML_CHECK(condition)
Definition: logging.h:68

◆ ~PlatformViewAndroid()

flutter::PlatformViewAndroid::~PlatformViewAndroid ( )
overridedefault

Referenced by PlatformViewAndroid().

Member Function Documentation

◆ DispatchEmptyPlatformMessage()

void flutter::PlatformViewAndroid::DispatchEmptyPlatformMessage ( JNIEnv *  env,
std::string  name,
jint  response_id 
)

Definition at line 197 of file platform_view_android.cc.

References flutter::PlatformView::DispatchPlatformMessage(), flutter::TaskRunners::GetPlatformTaskRunner(), and flutter::PlatformView::task_runners_.

199  {
201  if (response_id) {
202  response = fml::MakeRefCounted<PlatformMessageResponseAndroid>(
203  response_id, jni_facade_, task_runners_.GetPlatformTaskRunner());
204  }
205 
207  fml::MakeRefCounted<flutter::PlatformMessage>(std::move(name),
208  std::move(response)));
209 }
void DispatchPlatformMessage(fml::RefPtr< PlatformMessage > message)
Used by embedders to dispatch a platform message to a running root isolate hosted by the engine...
const TaskRunners task_runners_
fml::RefPtr< fml::TaskRunner > GetPlatformTaskRunner() const
Definition: task_runners.cc:30
const char * name
Definition: fuchsia.cc:50

◆ DispatchPlatformMessage()

void flutter::PlatformViewAndroid::DispatchPlatformMessage ( JNIEnv *  env,
std::string  name,
jobject  message_data,
jint  message_position,
jint  response_id 
)

Definition at line 176 of file platform_view_android.cc.

References flutter::PlatformView::DispatchPlatformMessage(), flutter::TaskRunners::GetPlatformTaskRunner(), and flutter::PlatformView::task_runners_.

180  {
181  uint8_t* message_data =
182  static_cast<uint8_t*>(env->GetDirectBufferAddress(java_message_data));
183  std::vector<uint8_t> message =
184  std::vector<uint8_t>(message_data, message_data + java_message_position);
185 
187  if (response_id) {
188  response = fml::MakeRefCounted<PlatformMessageResponseAndroid>(
189  response_id, jni_facade_, task_runners_.GetPlatformTaskRunner());
190  }
191 
193  fml::MakeRefCounted<flutter::PlatformMessage>(
194  std::move(name), std::move(message), std::move(response)));
195 }
void DispatchPlatformMessage(fml::RefPtr< PlatformMessage > message)
Used by embedders to dispatch a platform message to a running root isolate hosted by the engine...
const TaskRunners task_runners_
fml::RefPtr< fml::TaskRunner > GetPlatformTaskRunner() const
Definition: task_runners.cc:30
const char * name
Definition: fuchsia.cc:50

◆ DispatchSemanticsAction()

void flutter::PlatformViewAndroid::DispatchSemanticsAction ( JNIEnv *  env,
jint  id,
jint  action,
jobject  args,
jint  args_position 
)

Definition at line 262 of file platform_view_android.cc.

References flutter::PlatformView::DispatchSemanticsAction(), and flutter::PlatformViewAndroidDelegate::UpdateSemantics().

266  {
267  if (env->IsSameObject(args, NULL)) {
268  std::vector<uint8_t> args_vector;
270  id, static_cast<flutter::SemanticsAction>(action), args_vector);
271  return;
272  }
273 
274  uint8_t* args_data = static_cast<uint8_t*>(env->GetDirectBufferAddress(args));
275  std::vector<uint8_t> args_vector =
276  std::vector<uint8_t>(args_data, args_data + args_position);
277 
279  id, static_cast<flutter::SemanticsAction>(action),
280  std::move(args_vector));
281 }
G_BEGIN_DECLS FlValue * args
SemanticsAction action
void DispatchSemanticsAction(int32_t id, SemanticsAction action, std::vector< uint8_t > args)
Used by embedders to dispatch an accessibility action to a running isolate hosted by the engine...

◆ InvokePlatformMessageEmptyResponseCallback()

void flutter::PlatformViewAndroid::InvokePlatformMessageEmptyResponseCallback ( JNIEnv *  env,
jint  response_id 
)

Definition at line 231 of file platform_view_android.cc.

References flutter::PlatformMessage::response().

233  {
234  if (!response_id)
235  return;
236  auto it = pending_responses_.find(response_id);
237  if (it == pending_responses_.end())
238  return;
239  auto message_response = std::move(it->second);
240  pending_responses_.erase(it);
241  message_response->CompleteEmpty();
242 }

◆ InvokePlatformMessageResponseCallback()

void flutter::PlatformViewAndroid::InvokePlatformMessageResponseCallback ( JNIEnv *  env,
jint  response_id,
jobject  java_response_data,
jint  java_response_position 
)

Definition at line 211 of file platform_view_android.cc.

215  {
216  if (!response_id)
217  return;
218  auto it = pending_responses_.find(response_id);
219  if (it == pending_responses_.end())
220  return;
221  uint8_t* response_data =
222  static_cast<uint8_t*>(env->GetDirectBufferAddress(java_response_data));
223  std::vector<uint8_t> response = std::vector<uint8_t>(
224  response_data, response_data + java_response_position);
225  auto message_response = std::move(it->second);
226  pending_responses_.erase(it);
227  message_response->Complete(
228  std::make_unique<fml::DataMapping>(std::move(response)));
229 }

◆ NotifyChanged()

void flutter::PlatformViewAndroid::NotifyChanged ( const SkISize &  size)

Definition at line 162 of file platform_view_android.cc.

References flutter::TaskRunners::GetRasterTaskRunner(), fml::TaskRunner::RunNowOrPostTask(), fml::AutoResetWaitableEvent::Signal(), fml::size(), flutter::PlatformView::task_runners_, and fml::AutoResetWaitableEvent::Wait().

162  {
163  if (!android_surface_) {
164  return;
165  }
169  [&latch, surface = android_surface_.get(), size]() {
170  surface->OnScreenSurfaceResize(size);
171  latch.Signal();
172  });
173  latch.Wait();
174 }
const TaskRunners task_runners_
static void RunNowOrPostTask(fml::RefPtr< fml::TaskRunner > runner, const fml::closure &task)
Definition: task_runner.cc:55
constexpr std::size_t size(T(&array)[N])
Definition: size.h:13
fml::RefPtr< fml::TaskRunner > GetRasterTaskRunner() const
Definition: task_runners.cc:42

◆ NotifyCreated()

void flutter::PlatformViewAndroid::NotifyCreated ( fml::RefPtr< AndroidNativeWindow native_window)

Definition at line 112 of file platform_view_android.cc.

References flutter::TaskRunners::GetRasterTaskRunner(), flutter::PlatformView::NotifyCreated(), fml::TaskRunner::RunNowOrPostTask(), fml::AutoResetWaitableEvent::Signal(), flutter::PlatformView::task_runners_, and fml::AutoResetWaitableEvent::Wait().

113  {
114  if (android_surface_) {
115  InstallFirstFrameCallback();
116 
120  [&latch, surface = android_surface_.get(),
121  native_window = std::move(native_window)]() {
122  surface->SetNativeWindow(native_window);
123  latch.Signal();
124  });
125  latch.Wait();
126  }
127 
129 }
const TaskRunners task_runners_
static void RunNowOrPostTask(fml::RefPtr< fml::TaskRunner > runner, const fml::closure &task)
Definition: task_runner.cc:55
fml::RefPtr< fml::TaskRunner > GetRasterTaskRunner() const
Definition: task_runners.cc:42
void NotifyCreated()
Used by embedders to notify the shell that a platform view has been created. This notification is use...

◆ NotifyDestroyed()

void flutter::PlatformViewAndroid::NotifyDestroyed ( )
overridevirtual

Used by embedders to notify the shell that the platform view has been destroyed. This notification used to collect the rendering surface and all associated resources. Frame scheduling is also suspended.

Attention
Subclasses may choose to override this method to perform platform specific functions. However, they must call the base class method at some point in their implementation.

Reimplemented from flutter::PlatformView.

Definition at line 147 of file platform_view_android.cc.

References flutter::TaskRunners::GetRasterTaskRunner(), flutter::PlatformView::NotifyDestroyed(), fml::TaskRunner::RunNowOrPostTask(), fml::AutoResetWaitableEvent::Signal(), flutter::PlatformView::task_runners_, and fml::AutoResetWaitableEvent::Wait().

147  {
149 
150  if (android_surface_) {
154  [&latch, surface = android_surface_.get()]() {
155  surface->TeardownOnScreenContext();
156  latch.Signal();
157  });
158  latch.Wait();
159  }
160 }
const TaskRunners task_runners_
static void RunNowOrPostTask(fml::RefPtr< fml::TaskRunner > runner, const fml::closure &task)
Definition: task_runner.cc:55
fml::RefPtr< fml::TaskRunner > GetRasterTaskRunner() const
Definition: task_runners.cc:42
virtual void NotifyDestroyed()
Used by embedders to notify the shell that the platform view has been destroyed. This notification us...

◆ NotifySurfaceWindowChanged()

void flutter::PlatformViewAndroid::NotifySurfaceWindowChanged ( fml::RefPtr< AndroidNativeWindow native_window)

Definition at line 131 of file platform_view_android.cc.

References flutter::TaskRunners::GetRasterTaskRunner(), fml::TaskRunner::RunNowOrPostTask(), fml::AutoResetWaitableEvent::Signal(), flutter::PlatformView::task_runners_, and fml::AutoResetWaitableEvent::Wait().

132  {
133  if (android_surface_) {
137  [&latch, surface = android_surface_.get(),
138  native_window = std::move(native_window)]() {
139  surface->TeardownOnScreenContext();
140  surface->SetNativeWindow(native_window);
141  latch.Signal();
142  });
143  latch.Wait();
144  }
145 }
const TaskRunners task_runners_
static void RunNowOrPostTask(fml::RefPtr< fml::TaskRunner > runner, const fml::closure &task)
Definition: task_runner.cc:55
fml::RefPtr< fml::TaskRunner > GetRasterTaskRunner() const
Definition: task_runners.cc:42

◆ Register()

bool flutter::PlatformViewAndroid::Register ( JNIEnv *  env)
static

Definition at line 767 of file platform_view_android_jni_impl.cc.

References FML_LOG, fml::jni::JavaRef< T >::obj(), and flutter::RegisterApi().

Referenced by JNI_OnLoad().

767  {
768  if (env == nullptr) {
769  FML_LOG(ERROR) << "No JNIEnv provided";
770  return false;
771  }
772 
774  env, env->FindClass("io/flutter/view/FlutterCallbackInformation"));
775  if (g_flutter_callback_info_class->is_null()) {
776  FML_LOG(ERROR) << "Could not locate FlutterCallbackInformation class";
777  return false;
778  }
779 
780  g_flutter_callback_info_constructor = env->GetMethodID(
781  g_flutter_callback_info_class->obj(), "<init>",
782  "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
783  if (g_flutter_callback_info_constructor == nullptr) {
784  FML_LOG(ERROR) << "Could not locate FlutterCallbackInformation constructor";
785  return false;
786  }
787 
789  env, env->FindClass("io/flutter/embedding/engine/FlutterJNI"));
790  if (g_flutter_jni_class->is_null()) {
791  FML_LOG(ERROR) << "Failed to find FlutterJNI Class.";
792  return false;
793  }
794 
796  env,
797  env->FindClass(
798  "io/flutter/embedding/engine/mutatorsstack/FlutterMutatorsStack"));
799  if (g_mutators_stack_class == nullptr) {
800  FML_LOG(ERROR) << "Could not locate FlutterMutatorsStack";
801  return false;
802  }
803 
805  env->GetMethodID(g_mutators_stack_class->obj(), "<init>", "()V");
806  if (g_mutators_stack_init_method == nullptr) {
807  FML_LOG(ERROR) << "Could not locate FlutterMutatorsStack.init method";
808  return false;
809  }
810 
812  env->GetMethodID(g_mutators_stack_class->obj(), "pushTransform", "([F)V");
814  FML_LOG(ERROR)
815  << "Could not locate FlutterMutatorsStack.pushTransform method";
816  return false;
817  }
818 
819  g_mutators_stack_push_cliprect_method = env->GetMethodID(
820  g_mutators_stack_class->obj(), "pushClipRect", "(IIII)V");
821  if (g_mutators_stack_push_cliprect_method == nullptr) {
822  FML_LOG(ERROR)
823  << "Could not locate FlutterMutatorsStack.pushCilpRect method";
824  return false;
825  }
826 
828  env->GetMethodID(g_flutter_jni_class->obj(), "onDisplayPlatformView",
829  "(IIIIIIILio/flutter/embedding/engine/mutatorsstack/"
830  "FlutterMutatorsStack;)V");
831 
832  if (g_on_display_platform_view_method == nullptr) {
833  FML_LOG(ERROR) << "Could not locate onDisplayPlatformView method";
834  return false;
835  }
836 
838  env->GetMethodID(g_flutter_jni_class->obj(), "onBeginFrame", "()V");
839 
840  if (g_on_begin_frame_method == nullptr) {
841  FML_LOG(ERROR) << "Could not locate onBeginFrame method";
842  return false;
843  }
844 
846  env->GetMethodID(g_flutter_jni_class->obj(), "onEndFrame", "()V");
847 
848  if (g_on_end_frame_method == nullptr) {
849  FML_LOG(ERROR) << "Could not locate onEndFrame method";
850  return false;
851  }
852 
853  g_on_display_overlay_surface_method = env->GetMethodID(
854  g_flutter_jni_class->obj(), "onDisplayOverlaySurface", "(IIIII)V");
855 
856  if (g_on_display_overlay_surface_method == nullptr) {
857  FML_LOG(ERROR) << "Could not locate onDisplayOverlaySurface method";
858  return false;
859  }
860 
862  env, env->FindClass(
863  "io/flutter/embedding/engine/renderer/SurfaceTextureWrapper"));
864  if (g_texture_wrapper_class->is_null()) {
865  FML_LOG(ERROR) << "Could not locate SurfaceTextureWrapper class";
866  return false;
867  }
868 
869  g_attach_to_gl_context_method = env->GetMethodID(
870  g_texture_wrapper_class->obj(), "attachToGLContext", "(I)V");
871 
872  if (g_attach_to_gl_context_method == nullptr) {
873  FML_LOG(ERROR) << "Could not locate attachToGlContext method";
874  return false;
875  }
876 
878  env->GetMethodID(g_texture_wrapper_class->obj(), "updateTexImage", "()V");
879 
880  if (g_update_tex_image_method == nullptr) {
881  FML_LOG(ERROR) << "Could not locate updateTexImage method";
882  return false;
883  }
884 
885  g_get_transform_matrix_method = env->GetMethodID(
886  g_texture_wrapper_class->obj(), "getTransformMatrix", "([F)V");
887 
888  if (g_get_transform_matrix_method == nullptr) {
889  FML_LOG(ERROR) << "Could not locate getTransformMatrix method";
890  return false;
891  }
892 
893  g_detach_from_gl_context_method = env->GetMethodID(
894  g_texture_wrapper_class->obj(), "detachFromGLContext", "()V");
895 
896  if (g_detach_from_gl_context_method == nullptr) {
897  FML_LOG(ERROR) << "Could not locate detachFromGlContext method";
898  return false;
899  }
900 
902  g_flutter_jni_class->obj(), "computePlatformResolvedLocale",
903  "([Ljava/lang/String;)[Ljava/lang/String;");
904 
906  FML_LOG(ERROR) << "Could not locate computePlatformResolvedLocale method";
907  return false;
908  }
909 
910  return RegisterApi(env);
911 }
static fml::jni::ScopedJavaGlobalRef< jclass > * g_mutators_stack_class
static jmethodID g_on_begin_frame_method
static jmethodID g_get_transform_matrix_method
static fml::jni::ScopedJavaGlobalRef< jclass > * g_texture_wrapper_class
static jmethodID g_attach_to_gl_context_method
#define FML_LOG(severity)
Definition: logging.h:65
static fml::jni::ScopedJavaGlobalRef< jclass > * g_flutter_jni_class
static jmethodID g_mutators_stack_push_cliprect_method
static jmethodID g_flutter_callback_info_constructor
static jmethodID g_mutators_stack_init_method
static jmethodID g_mutators_stack_push_transform_method
static jmethodID g_on_display_platform_view_method
static jmethodID g_on_end_frame_method
static jmethodID g_detach_from_gl_context_method
static jmethodID g_update_tex_image_method
static jmethodID g_compute_platform_resolved_locale_method
bool RegisterApi(JNIEnv *env)
static fml::jni::ScopedJavaGlobalRef< jclass > * g_flutter_callback_info_class
static jmethodID g_on_display_overlay_surface_method

◆ RegisterExternalTexture()

void flutter::PlatformViewAndroid::RegisterExternalTexture ( int64_t  texture_id,
const fml::jni::JavaObjectWeakGlobalRef surface_texture 
)

Definition at line 290 of file platform_view_android.cc.

References flutter::ShellIOManager::CreateCompatibleResourceLoadingContext(), FML_DLOG, flutter::GPUSurfaceGLDelegate::GetDefaultPlatformGLInterface(), flutter::TaskRunners::GetPlatformTaskRunner(), flutter::PlatformView::GetWeakPtr(), flutter::PlatformView::RegisterTexture(), flutter::PlatformView::SetNextFrameCallback(), and flutter::PlatformView::task_runners_.

292  {
293  RegisterTexture(std::make_shared<AndroidExternalTextureGL>(
294  texture_id, surface_texture, std::move(jni_facade_)));
295 }
void RegisterTexture(std::shared_ptr< flutter::Texture > texture)
Used by the embedder to specify a texture that it wants the rasterizer to composite within the Flutte...

The documentation for this class was generated from the following files: