Interface RenderSurface
-
- All Known Implementing Classes:
FlutterImageView
,FlutterSurfaceView
,FlutterTextureView
public interface RenderSurface
Owns aSurface
thatFlutterRenderer
would like to paint.RenderSurface
is responsible for providing aSurface
to a givenFlutterRenderer
when requested, and then notify thatFlutterRenderer
when theSurface
changes, or is destroyed.The behavior of providing a
Surface
is delegated to this interface because the timing of aSurface
's availability is determined by Android. Therefore, an accessor method would not fulfill the requirements. Therefore, aRenderSurface
is given aFlutterRenderer
, which theRenderSurface
is expected to notify as aSurface
becomes available, changes, or is destroyed.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
attachToRenderer(FlutterRenderer renderer)
Instructs thisRenderSurface
to give itsSurface
to the givenFlutterRenderer
so that Flutter can paint pixels on it.void
detachFromRenderer()
Instructs thisRenderSurface
to stop forwardingSurface
notifications to theFlutterRenderer
that was previously connected withattachToRenderer(FlutterRenderer)
.FlutterRenderer
getAttachedRenderer()
Returns theFlutterRenderer
that is attached to thisRenderSurface
, or null if noFlutterRenderer
is currently attached.void
pause()
Instructs thisRenderSurface
to stop forwardingSurface
notifications to theFlutterRenderer
that was previously connected withattachToRenderer(FlutterRenderer)
.
-
-
-
Method Detail
-
getAttachedRenderer
@Nullable FlutterRenderer getAttachedRenderer()
Returns theFlutterRenderer
that is attached to thisRenderSurface
, or null if noFlutterRenderer
is currently attached.
-
attachToRenderer
void attachToRenderer(@NonNull FlutterRenderer renderer)
Instructs thisRenderSurface
to give itsSurface
to the givenFlutterRenderer
so that Flutter can paint pixels on it.After this call,
RenderSurface
is expected to invoke the following methods onFlutterRenderer
at the appropriate times:
-
detachFromRenderer
void detachFromRenderer()
Instructs thisRenderSurface
to stop forwardingSurface
notifications to theFlutterRenderer
that was previously connected withattachToRenderer(FlutterRenderer)
.This
RenderSurface
should also clean up any references related to the previously connectedFlutterRenderer
.
-
pause
void pause()
Instructs thisRenderSurface
to stop forwardingSurface
notifications to theFlutterRenderer
that was previously connected withattachToRenderer(FlutterRenderer)
.
-
-