Flutter Engine
The Flutter Engine
Public Member Functions | Protected Member Functions | List of all members
io.flutter.plugin.platform.SurfaceTexturePlatformViewRenderTarget Class Reference
Inheritance diagram for io.flutter.plugin.platform.SurfaceTexturePlatformViewRenderTarget:
io.flutter.plugin.platform.PlatformViewRenderTarget

Public Member Functions

 SurfaceTexturePlatformViewRenderTarget (SurfaceTextureEntry surfaceTextureEntry)
 
void resize (int width, int height)
 
int getWidth ()
 
int getHeight ()
 
long getId ()
 
boolean isReleased ()
 
void release ()
 
Surface getSurface ()
 
- Public Member Functions inherited from io.flutter.plugin.platform.PlatformViewRenderTarget
void resize (int width, int height)
 
int getWidth ()
 
int getHeight ()
 
long getId ()
 
void release ()
 
boolean isReleased ()
 
Surface getSurface ()
 
default void scheduleFrame ()
 

Protected Member Functions

Surface createSurface ()
 

Detailed Description

Definition at line 14 of file SurfaceTexturePlatformViewRenderTarget.java.

Constructor & Destructor Documentation

◆ SurfaceTexturePlatformViewRenderTarget()

io.flutter.plugin.platform.SurfaceTexturePlatformViewRenderTarget.SurfaceTexturePlatformViewRenderTarget ( SurfaceTextureEntry  surfaceTextureEntry)
inline

Implementation of PlatformViewRenderTarget

Definition at line 60 of file SurfaceTexturePlatformViewRenderTarget.java.

60 {
61 if (Build.VERSION.SDK_INT < API_LEVELS.API_23) {
62 throw new UnsupportedOperationException(
63 "Platform views cannot be displayed below API level 23"
64 + "You can prevent this issue by setting `minSdkVersion: 23` in build.gradle.");
65 }
66 this.surfaceTextureEntry = surfaceTextureEntry;
67 this.surfaceTexture = surfaceTextureEntry.surfaceTexture();
68 surfaceTextureEntry.setOnTrimMemoryListener(trimMemoryListener);
69 }
default void setOnTrimMemoryListener(@Nullable OnTrimMemoryListener listener)
def Build(configs, env, options)
Definition: build.py:232

Member Function Documentation

◆ createSurface()

Surface io.flutter.plugin.platform.SurfaceTexturePlatformViewRenderTarget.createSurface ( )
inlineprotected

Definition at line 55 of file SurfaceTexturePlatformViewRenderTarget.java.

55 {
56 return new Surface(surfaceTexture);
57 }

◆ getHeight()

int io.flutter.plugin.platform.SurfaceTexturePlatformViewRenderTarget.getHeight ( )
inline

Implements io.flutter.plugin.platform.PlatformViewRenderTarget.

Definition at line 83 of file SurfaceTexturePlatformViewRenderTarget.java.

83 {
84 return bufferHeight;
85 }

◆ getId()

long io.flutter.plugin.platform.SurfaceTexturePlatformViewRenderTarget.getId ( )
inline

Implements io.flutter.plugin.platform.PlatformViewRenderTarget.

Definition at line 87 of file SurfaceTexturePlatformViewRenderTarget.java.

87 {
88 return this.surfaceTextureEntry.id();
89 }

◆ getSurface()

Surface io.flutter.plugin.platform.SurfaceTexturePlatformViewRenderTarget.getSurface ( )
inline

Implements io.flutter.plugin.platform.PlatformViewRenderTarget.

Definition at line 104 of file SurfaceTexturePlatformViewRenderTarget.java.

104 {
105 recreateSurfaceIfNeeded();
106 if (surfaceTexture == null || surfaceTexture.isReleased()) {
107 return null;
108 }
109 return surface;
110 }

◆ getWidth()

int io.flutter.plugin.platform.SurfaceTexturePlatformViewRenderTarget.getWidth ( )
inline

Implements io.flutter.plugin.platform.PlatformViewRenderTarget.

Definition at line 79 of file SurfaceTexturePlatformViewRenderTarget.java.

79 {
80 return bufferWidth;
81 }

◆ isReleased()

boolean io.flutter.plugin.platform.SurfaceTexturePlatformViewRenderTarget.isReleased ( )
inline

Implements io.flutter.plugin.platform.PlatformViewRenderTarget.

Definition at line 91 of file SurfaceTexturePlatformViewRenderTarget.java.

91 {
92 return surfaceTexture == null;
93 }

◆ release()

void io.flutter.plugin.platform.SurfaceTexturePlatformViewRenderTarget.release ( )
inline

Implements io.flutter.plugin.platform.PlatformViewRenderTarget.

Definition at line 95 of file SurfaceTexturePlatformViewRenderTarget.java.

95 {
96 // Don't release the texture, let the GC finalize it.
97 surfaceTexture = null;
98 if (surface != null) {
99 surface.release();
100 surface = null;
101 }
102 }

◆ resize()

void io.flutter.plugin.platform.SurfaceTexturePlatformViewRenderTarget.resize ( int  width,
int  height 
)
inline

Implements io.flutter.plugin.platform.PlatformViewRenderTarget.

Definition at line 71 of file SurfaceTexturePlatformViewRenderTarget.java.

71 {
72 bufferWidth = width;
73 bufferHeight = height;
74 if (surfaceTexture != null) {
75 surfaceTexture.setDefaultBufferSize(bufferWidth, bufferHeight);
76 }
77 }
int32_t height
int32_t width

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