GpuImageSurface class final

A pool of presentable Flutter GPU render targets drawn by Flutter as a ui.Image.

An image surface is useful when GPU content is rendered repeatedly and then drawn by Flutter as a ui.Image. It owns the final color textures that may be sampled by Flutter after a frame is presented. The renderer is still responsible for ordinary intermediate render targets such as depth, stencil, multisample, shadow, or post-processing textures.

The surface chooses how many backing textures to retain. Applications should acquire a frame when they are ready to render and let the surface decide whether an existing texture can be reused or a new texture is needed.

To render a frame, call acquireNextFrame, render into the returned GpuSurfaceFrame.colorTexture, call GpuSurfaceFrame.present with the command buffer that contains the final writes, submit that command buffer, and then draw currentImage.

Implemented types

Properties

currentImage Image?
The most recently presented image, or null if no frame has been presented.
no setter
debugBackingTextureCount int
The number of backing textures currently retained by this surface.
no setter
format PixelFormat
The color format of frames acquired from this surface.
no setter
hashCode int
The hash code for this object.
no setterinherited
height int
The height, in pixels, of frames acquired from this surface.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
width int
The width, in pixels, of frames acquired from this surface.
no setter

Methods

acquireNextFrame() GpuImageSurfaceFrame
Acquires a color texture that can be used as the final render target.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resize(int width, int height) → void
Changes the size of future frames acquired from this surface.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited