Flutter Engine
The Flutter Engine
|
Classes | |
class | DisplayFeature |
enum | DisplayFeatureState |
enum | DisplayFeatureType |
class | ImageReaderSurfaceProducer |
class | ImageTextureRegistryEntry |
class | SurfaceTextureRegistryEntry |
class | TextureFinalizerRunnable |
class | ViewportMetrics |
Public Member Functions | |
FlutterRenderer (@NonNull FlutterJNI flutterJNI) | |
boolean | isDisplayingFlutterUi () |
void | addIsDisplayingFlutterUiListener (@NonNull FlutterUiDisplayListener listener) |
void | removeIsDisplayingFlutterUiListener (@NonNull FlutterUiDisplayListener listener) |
SurfaceProducer | createSurfaceProducer () |
SurfaceTextureEntry | createSurfaceTexture () |
SurfaceTextureEntry | registerSurfaceTexture (@NonNull SurfaceTexture surfaceTexture) |
SurfaceProducer | createSurfaceProducer () |
SurfaceTextureEntry | createSurfaceTexture () |
SurfaceTextureEntry | registerSurfaceTexture (@NonNull SurfaceTexture surfaceTexture) |
ImageTextureEntry | createImageTexture () |
default void | onTrimMemory (int level) |
Static Public Attributes | |
static boolean | debugForceSurfaceProducerGlTextures = false |
static boolean | debugDisableSurfaceClear = false |
Package Functions | |
void | addOnTrimMemoryListener (@NonNull OnTrimMemoryListener listener) |
void | removeOnTrimMemoryListener (@NonNull OnTrimMemoryListener listener) |
ImageTextureEntry | createImageTexture () |
void | onTrimMemory (int level) |
void | startRenderingToSurface (@NonNull Surface surface, boolean onlySwap) |
void | swapSurface (@NonNull Surface surface) |
void | surfaceChanged (int width, int height) |
void | stopRenderingToSurface () |
void | setViewportMetrics (@NonNull ViewportMetrics viewportMetrics) |
Bitmap | getBitmap () |
void | dispatchPointerDataPacket (@NonNull ByteBuffer buffer, int position) |
boolean | isSoftwareRenderingEnabled () |
void | setAccessibilityFeatures (int flags) |
void | setSemanticsEnabled (boolean enabled) |
void | dispatchSemanticsAction (int nodeId, int action, @Nullable ByteBuffer args, int argsPosition) |
Represents the rendering responsibilities of a FlutterEngine
.
FlutterRenderer
works in tandem with a provided RenderSurface
to paint Flutter pixels to an Android View
hierarchy.
FlutterRenderer
manages textures for rendering, and forwards some Java calls to native Flutter code via JNI. The corresponding RenderSurface
provides the Android Surface
that this renderer paints.
io.flutter.embedding.android.FlutterSurfaceView
and io.flutter.embedding.android.FlutterTextureView
are implementations of RenderSurface
.
Definition at line 55 of file FlutterRenderer.java.
|
inline |
Definition at line 95 of file FlutterRenderer.java.
|
inline |
Adds a listener that is invoked whenever this FlutterRenderer
starts and stops painting pixels to an Android View
hierarchy.
Definition at line 112 of file FlutterRenderer.java.
|
inlinepackage |
Adds a listener that is invoked when a memory pressure warning was forward.
Definition at line 141 of file FlutterRenderer.java.
|
inline |
Creates and registers a texture managed by the Flutter engine.
Implements io.flutter.view.TextureRegistry.
Definition at line 260 of file FlutterRenderer.java.
|
inline |
Creates and returns a new external texture SurfaceProducer
managed by the Flutter engine that is also made available to Flutter code.
Implements io.flutter.view.TextureRegistry.
Definition at line 169 of file FlutterRenderer.java.
|
inline |
Creates and returns a new SurfaceTexture
managed by the Flutter engine that is also made available to Flutter code.
Implements io.flutter.view.TextureRegistry.
Definition at line 223 of file FlutterRenderer.java.
|
inline |
Definition at line 1199 of file FlutterRenderer.java.
|
inline |
Definition at line 1243 of file FlutterRenderer.java.
|
inline |
Definition at line 1194 of file FlutterRenderer.java.
|
inline |
Returns true if this FlutterRenderer
is painting pixels to an Android View
hierarchy, false otherwise.
Definition at line 104 of file FlutterRenderer.java.
|
inline |
Definition at line 1228 of file FlutterRenderer.java.
|
inline |
Callback invoked when memory is low.
Invoke this from android.app.Activity#onTrimMemory(int)
.
Implements io.flutter.view.TextureRegistry.
Definition at line 269 of file FlutterRenderer.java.
|
inline |
Registers and returns a SurfaceTexture
managed by the Flutter engine that is also made available to Flutter code.
Implements io.flutter.view.TextureRegistry.
Definition at line 235 of file FlutterRenderer.java.
|
inline |
Removes a listener added via addIsDisplayingFlutterUiListener(FlutterUiDisplayListener)
.
Definition at line 124 of file FlutterRenderer.java.
|
inlinepackage |
Removes a OnTrimMemoryListener
that was added with addOnTrimMemoryListener(OnTrimMemoryListener)
.
Definition at line 152 of file FlutterRenderer.java.
|
inline |
Definition at line 1233 of file FlutterRenderer.java.
|
inline |
Definition at line 1238 of file FlutterRenderer.java.
|
inline |
Notifies Flutter that the viewport metrics, e.g. window height and width, have changed.
If the width, height, or devicePixelRatio are less than or equal to 0, this update is ignored.
viewportMetrics | The metrics to send to the Dart application. |
Definition at line 1113 of file FlutterRenderer.java.
|
inline |
Notifies Flutter that the given surface
was created and is available for Flutter rendering.
If called more than once, the current native resources are released. This can be undesired if the Engine expects to reuse this surface later. For example, this is true when platform views are displayed in a frame, and then removed in the next frame.
To avoid releasing the current surface resources, set keepCurrentSurface
to true.
See android.view.SurfaceHolder.Callback
and android.view.TextureView.SurfaceTextureListener
surface | The render surface. |
onlySwap | True if the current active surface should not be detached. |
Definition at line 1036 of file FlutterRenderer.java.
|
inline |
Notifies Flutter that a surface
previously registered with startRenderingToSurface(Surface, boolean)
has been destroyed and needs to be released and cleaned up on the Flutter side.
See android.view.SurfaceHolder.Callback
and android.view.TextureView.SurfaceTextureListener
Definition at line 1088 of file FlutterRenderer.java.
|
inline |
Notifies Flutter that a surface
previously registered with startRenderingToSurface(Surface, boolean)
has changed size to the given width
and height
.
See android.view.SurfaceHolder.Callback
and android.view.TextureView.SurfaceTextureListener
Definition at line 1076 of file FlutterRenderer.java.
|
inline |
Swaps the Surface
used to render the current frame.
In hybrid composition, the root surfaces changes from android.view.SurfaceHolder#getSurface()
to android.media.ImageReader#getSurface()
when a platform view is in the current frame.
Definition at line 1063 of file FlutterRenderer.java.
|
static |
Whether to disable clearing of the Surface used to render platform views.
Definition at line 67 of file FlutterRenderer.java.
|
static |
Whether to always use GL textures for FlutterRenderer#createSurfaceProducer()
.
This is a debug-only API intended for local development. For example, when using a newer Android device (that normally would use ImageReaderSurfaceProducer
, but wanting to test the OpenGLES/SurfaceTextureSurfaceProducer
code branch. This flag has undefined behavior if set to true while running in a Vulkan (Impeller) context.
Definition at line 64 of file FlutterRenderer.java.