Flutter Engine
The Flutter Engine
Public Member Functions | Protected Member Functions | Package Functions | List of all members
io.flutter.embedding.engine.renderer.SurfaceTextureSurfaceProducer Class Reference
Inheritance diagram for io.flutter.embedding.engine.renderer.SurfaceTextureSurfaceProducer:
io.flutter.view.TextureRegistry.SurfaceProducer io.flutter.view.TextureRegistry.GLTextureConsumer io.flutter.view.TextureRegistry.TextureEntry

Public Member Functions

long id ()
 
void release ()
 
SurfaceTexture getSurfaceTexture ()
 
void setSize (int width, int height)
 
int getWidth ()
 
int getHeight ()
 
Surface getSurface ()
 
void scheduleFrame ()
 
void setSize (int width, int height)
 
int getWidth ()
 
int getHeight ()
 
Surface getSurface ()
 
void scheduleFrame ()
 
long id ()
 
void release ()
 
SurfaceTexture getSurfaceTexture ()
 

Protected Member Functions

void finalize () throws Throwable
 

Package Functions

 SurfaceTextureSurfaceProducer (long id, @NonNull Handler handler, @NonNull FlutterJNI flutterJNI, @NonNull TextureRegistry.SurfaceTextureEntry texture)
 

Detailed Description

Uses a android.graphics.SurfaceTexture to populate the texture registry.

Definition at line 12 of file SurfaceTextureSurfaceProducer.java.

Constructor & Destructor Documentation

◆ SurfaceTextureSurfaceProducer()

io.flutter.embedding.engine.renderer.SurfaceTextureSurfaceProducer.SurfaceTextureSurfaceProducer ( long  id,
@NonNull Handler  handler,
@NonNull FlutterJNI  flutterJNI,
@NonNull TextureRegistry.SurfaceTextureEntry  texture 
)
inlinepackage

Definition at line 23 of file SurfaceTextureSurfaceProducer.java.

27 {
28 this.id = id;
29 this.handler = handler;
30 this.flutterJNI = flutterJNI;
31 this.texture = texture;
32 }

Member Function Documentation

◆ finalize()

void io.flutter.embedding.engine.renderer.SurfaceTextureSurfaceProducer.finalize ( ) throws Throwable
inlineprotected

Definition at line 35 of file SurfaceTextureSurfaceProducer.java.

35 {
36 try {
37 if (released) {
38 return;
39 }
40 release();
41 handler.post(new FlutterRenderer.TextureFinalizerRunnable(id, flutterJNI));
42 } finally {
43 super.finalize();
44 }
45 }

◆ getHeight()

int io.flutter.embedding.engine.renderer.SurfaceTextureSurfaceProducer.getHeight ( )
inline
Returns
The currently specified height (physical pixels)

Implements io.flutter.view.TextureRegistry.SurfaceProducer.

Definition at line 77 of file SurfaceTextureSurfaceProducer.java.

77 {
78 return requestedBufferHeight;
79 }

◆ getSurface()

Surface io.flutter.embedding.engine.renderer.SurfaceTextureSurfaceProducer.getSurface ( )
inline

Get a Surface that can be used to update the texture contents.

NOTE: You should not cache the returned surface but instead invoke getSurface each time you need to draw. The surface may change when the texture is resized or has its format changed.

Returns
a Surface to use for a drawing target for various APIs.

Implements io.flutter.view.TextureRegistry.SurfaceProducer.

Definition at line 82 of file SurfaceTextureSurfaceProducer.java.

82 {
83 if (surface == null) {
84 surface = new Surface(texture.surfaceTexture());
85 }
86 return surface;
87 }

◆ getSurfaceTexture()

SurfaceTexture io.flutter.embedding.engine.renderer.SurfaceTextureSurfaceProducer.getSurfaceTexture ( )
inline

Retrieve the last GL texture produced.

Returns
SurfaceTexture.

Implements io.flutter.view.TextureRegistry.GLTextureConsumer.

Definition at line 60 of file SurfaceTextureSurfaceProducer.java.

60 {
61 return texture.surfaceTexture();
62 }

◆ getWidth()

int io.flutter.embedding.engine.renderer.SurfaceTextureSurfaceProducer.getWidth ( )
inline
Returns
The currently specified width (physical pixels)

Implements io.flutter.view.TextureRegistry.SurfaceProducer.

Definition at line 72 of file SurfaceTextureSurfaceProducer.java.

72 {
73 return requestBufferWidth;
74 }

◆ id()

long io.flutter.embedding.engine.renderer.SurfaceTextureSurfaceProducer.id ( )
inline
Returns
The identity of this texture.

Implements io.flutter.view.TextureRegistry.TextureEntry.

Definition at line 48 of file SurfaceTextureSurfaceProducer.java.

48 {
49 return id;
50 }

◆ release()

void io.flutter.embedding.engine.renderer.SurfaceTextureSurfaceProducer.release ( )
inline

Deregisters and releases all resources .

Implements io.flutter.view.TextureRegistry.TextureEntry.

Definition at line 53 of file SurfaceTextureSurfaceProducer.java.

53 {
54 texture.release();
55 released = true;
56 }

◆ scheduleFrame()

void io.flutter.embedding.engine.renderer.SurfaceTextureSurfaceProducer.scheduleFrame ( )
inline

Implements io.flutter.view.TextureRegistry.SurfaceProducer.

Definition at line 90 of file SurfaceTextureSurfaceProducer.java.

90 {
91 flutterJNI.markTextureFrameAvailable(id);
92 }
void markTextureFrameAvailable(long textureId)

◆ setSize()

void io.flutter.embedding.engine.renderer.SurfaceTextureSurfaceProducer.setSize ( int  width,
int  height 
)
inline

Specify the size of this texture in physical pixels

Implements io.flutter.view.TextureRegistry.SurfaceProducer.

Definition at line 65 of file SurfaceTextureSurfaceProducer.java.

65 {
66 requestBufferWidth = width;
67 requestedBufferHeight = height;
68 getSurfaceTexture().setDefaultBufferSize(width, height);
69 }
int32_t height
int32_t width

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