Interface RenderSurface
- All Known Implementing Classes:
FlutterImageView,FlutterSurfaceView,FlutterTextureView,PlatformOverlayView
Surface that FlutterRenderer would like to paint.
RenderSurface is responsible for providing a Surface to a given
FlutterRenderer when requested, and then notify that FlutterRenderer when the
Surface changes, or is destroyed.
The behavior of providing a Surface is delegated to this interface because the timing
of a Surface's availability is determined by Android. Therefore, an accessor method would
not fulfill the requirements. Therefore, a RenderSurface is given a
FlutterRenderer, which the RenderSurface is expected to notify as a Surface
becomes available, changes, or is destroyed.
-
Method Summary
Modifier and TypeMethodDescriptionvoidattachToRenderer(FlutterRenderer renderer) Instructs thisRenderSurfaceto give itsSurfaceto the givenFlutterRendererso that Flutter can paint pixels on it.voidInstructs thisRenderSurfaceto stop forwardingSurfacenotifications to theFlutterRendererthat was previously connected withattachToRenderer(FlutterRenderer).Returns theFlutterRendererthat is attached to thisRenderSurface, or null if noFlutterRendereris currently attached.voidpause()Instructs thisRenderSurfaceto stop forwardingSurfacenotifications to theFlutterRendererthat was previously connected withattachToRenderer(FlutterRenderer).voidresume()Instructs thisRenderSurfaceto resume forwardingSurfacenotifications to theFlutterRendererthat was previously connected withattachToRenderer(FlutterRenderer).
-
Method Details
-
getAttachedRenderer
Returns theFlutterRendererthat is attached to thisRenderSurface, or null if noFlutterRendereris currently attached. -
attachToRenderer
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). -
resume
void resume()Instructs thisRenderSurfaceto resume forwardingSurfacenotifications to theFlutterRendererthat was previously connected withattachToRenderer(FlutterRenderer).
-