Interface RenderSurface
-
- All Known Implementing Classes:
FlutterImageView,FlutterSurfaceView,FlutterTextureView
public interface RenderSurfaceOwns aSurfacethatFlutterRendererwould like to paint.RenderSurfaceis responsible for providing aSurfaceto a givenFlutterRendererwhen requested, and then notify thatFlutterRendererwhen theSurfacechanges, or is destroyed.The behavior of providing a
Surfaceis 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, aRenderSurfaceis given aFlutterRenderer, which theRenderSurfaceis expected to notify as aSurfacebecomes available, changes, or is destroyed.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidattachToRenderer(FlutterRenderer renderer)Instructs thisRenderSurfaceto give itsSurfaceto the givenFlutterRendererso that Flutter can paint pixels on it.voiddetachFromRenderer()Instructs thisRenderSurfaceto stop forwardingSurfacenotifications to theFlutterRendererthat was previously connected withattachToRenderer(FlutterRenderer).FlutterRenderergetAttachedRenderer()Returns theFlutterRendererthat is attached to thisRenderSurface, or null if noFlutterRendereris currently attached.voidpause()Instructs thisRenderSurfaceto stop forwardingSurfacenotifications to theFlutterRendererthat was previously connected withattachToRenderer(FlutterRenderer).
-
-
-
Method Detail
-
getAttachedRenderer
@Nullable FlutterRenderer getAttachedRenderer()
Returns theFlutterRendererthat is attached to thisRenderSurface, or null if noFlutterRendereris currently attached.
-
attachToRenderer
void attachToRenderer(@NonNull FlutterRenderer renderer)Instructs thisRenderSurfaceto give itsSurfaceto the givenFlutterRendererso that Flutter can paint pixels on it.After this call,
RenderSurfaceis expected to invoke the following methods onFlutterRendererat the appropriate times:
-
detachFromRenderer
void detachFromRenderer()
Instructs thisRenderSurfaceto stop forwardingSurfacenotifications to theFlutterRendererthat was previously connected withattachToRenderer(FlutterRenderer).This
RenderSurfaceshould also clean up any references related to the previously connectedFlutterRenderer.
-
pause
void pause()
Instructs thisRenderSurfaceto stop forwardingSurfacenotifications to theFlutterRendererthat was previously connected withattachToRenderer(FlutterRenderer).
-
-