Flutter Engine
platform_view_android_jni_impl.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef FLUTTER_SHELL_PLATFORM_ANDROID_PLATFORM_VIEW_ANDROID_JNI_IMPL_H_
6 #define FLUTTER_SHELL_PLATFORM_ANDROID_PLATFORM_VIEW_ANDROID_JNI_IMPL_H_
7 
8 #include "flutter/fml/platform/android/jni_weak_ref.h"
9 #include "flutter/shell/platform/android/jni/platform_view_android_jni.h"
10 
11 namespace flutter {
12 
13 //------------------------------------------------------------------------------
14 /// @brief Concrete implementation of `PlatformViewAndroidJNI` that is
15 /// compiled with the Android toolchain.
16 ///
18  public:
20 
21  ~PlatformViewAndroidJNIImpl() override;
22 
25  int responseId) override;
26 
28  int responseId,
29  std::unique_ptr<fml::Mapping> data) override;
30 
31  void FlutterViewUpdateSemantics(std::vector<uint8_t> buffer,
32  std::vector<std::string> strings) override;
33 
35  std::vector<uint8_t> actions_buffer,
36  std::vector<std::string> strings) override;
37 
38  void FlutterViewOnFirstFrame() override;
39 
40  void FlutterViewOnPreEngineRestart() override;
41 
43  int textureId) override;
44 
45  void SurfaceTextureUpdateTexImage(JavaWeakGlobalRef surface_texture) override;
46 
48  SkMatrix& transform) override;
49 
51  JavaWeakGlobalRef surface_texture) override;
52 
53  void FlutterViewOnDisplayPlatformView(int view_id,
54  int x,
55  int y,
56  int width,
57  int height,
58  int viewWidth,
59  int viewHeight,
60  MutatorsStack mutators_stack) override;
61 
62  void FlutterViewDisplayOverlaySurface(int surface_id,
63  int x,
64  int y,
65  int width,
66  int height) override;
67 
68  void FlutterViewBeginFrame() override;
69 
70  void FlutterViewEndFrame() override;
71 
72  std::unique_ptr<PlatformViewAndroidJNI::OverlayMetadata>
74 
75  void FlutterViewDestroyOverlaySurfaces() override;
76 
77  std::unique_ptr<std::vector<std::string>>
79  std::vector<std::string> supported_locales_data) override;
80 
81  double GetDisplayRefreshRate() override;
82 
83  private:
84  // Reference to FlutterJNI object.
85  const fml::jni::JavaObjectWeakGlobalRef java_object_;
86 
87  FML_DISALLOW_COPY_AND_ASSIGN(PlatformViewAndroidJNIImpl);
88 };
89 
90 } // namespace flutter
91 
92 #endif // FLUTTER_SHELL_PLATFORM_ANDROID_PLATFORM_VIEW_ANDROID_JNI_IMPL_H_
void FlutterViewBeginFrame() override
Initiates a frame if using hybrid composition.
Concrete implementation of PlatformViewAndroidJNI that is compiled with the Android toolchain...
void FlutterViewHandlePlatformMessage(fml::RefPtr< flutter::PlatformMessage > message, int responseId) override
Sends a platform message. The message may be empty.
std::unique_ptr< PlatformViewAndroidJNI::OverlayMetadata > FlutterViewCreateOverlaySurface() override
Instantiates an overlay surface in hybrid composition and provides the necessary metadata to operate ...
std::nullptr_t JavaWeakGlobalRef
void FlutterViewUpdateCustomAccessibilityActions(std::vector< uint8_t > actions_buffer, std::vector< std::string > strings) override
Sends new custom accessibility events.
void FlutterViewEndFrame() override
Indicates that the current frame ended. It&#39;s used to clean up state.
void FlutterViewOnPreEngineRestart() override
Indicates that a hot restart is about to happen.
PlatformViewAndroidJNIImpl(fml::jni::JavaObjectWeakGlobalRef java_object)
void SurfaceTextureAttachToGLContext(JavaWeakGlobalRef surface_texture, int textureId) override
Attach the SurfaceTexture to the OpenGL ES context that is current on the calling thread...
int32_t height
void FlutterViewDisplayOverlaySurface(int surface_id, int x, int y, int width, int height) override
Positions and sizes an overlay surface in hybrid composition.
int32_t width
std::unique_ptr< std::vector< std::string > > FlutterViewComputePlatformResolvedLocale(std::vector< std::string > supported_locales_data) override
Computes the locale Android would select.
void SurfaceTextureUpdateTexImage(JavaWeakGlobalRef surface_texture) override
Updates the texture image to the most recent frame from the image stream.
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 FlutterViewUpdateSemantics(std::vector< uint8_t > buffer, std::vector< std::string > strings) override
Sends semantics tree updates.
void FlutterViewOnFirstFrame() override
Indicates that FlutterView should start painting pixels.
void SurfaceTextureDetachFromGLContext(JavaWeakGlobalRef surface_texture) override
Detaches a SurfaceTexture from the OpenGL ES context.
void FlutterViewDestroyOverlaySurfaces() override
Destroys the overlay surfaces.
void SurfaceTextureGetTransformMatrix(JavaWeakGlobalRef surface_texture, SkMatrix &transform) override
Gets the transform matrix from the SurfaceTexture. Then, it updates the transform matrix...
void FlutterViewHandlePlatformMessageResponse(int responseId, std::unique_ptr< fml::Mapping > data) override
Responds to a platform message. The data may be a nullptr.