Surface class Rendering
Manages the swapchain color textures a Scene composites onto the Flutter canvas, plus the pools of transient render-graph attachments.
Each Scene owns one Surface. A scene may render several views per
frame (split-screen, picture-in-picture); each view gets its own
swapchain ring and its own transient texture pool, so simultaneous views
never share a render target within a frame. View 0 is the single-view
default.
Every view, every frame, the renderer asks the surface for that view's
next swapchain color texture via getNextSwapchainColorTexture; the
surface rotates through a small ring per view so the GPU isn't asked to
overwrite one the compositor is still reading. The tone-mapping pass
renders the final image into this texture, which is then drawn to the
canvas via Texture.asImage. Each ring (and the view's transient pool)
is dropped and rebuilt whenever that view's requested size changes.
Applications typically don't interact with Surface directly; it is
driven internally by Scene.render / Scene.renderViews.
Constructors
- Surface()
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
getNextSwapchainColorTexture(
Size size, [int viewIndex = 0]) → Texture -
Returns the next 8-bit swapchain color texture for view
viewIndexatsize, advancing that view's frame. The ring (and the view's transient pool) are dropped and rebuilt wheneversizechanges from the view's previous call. -
lastSwapchainColorTexture(
[int viewIndex = 0]) → Texture? -
The color texture most recently issued for
viewIndex(the previous frame's output once the next frame begins), or null before the first frame or after a resize. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited