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 TypeMethodDescriptionvoid
attachToRenderer
(FlutterRenderer renderer) Instructs thisRenderSurface
to give itsSurface
to the givenFlutterRenderer
so that Flutter can paint pixels on it.void
Instructs thisRenderSurface
to stop forwardingSurface
notifications to theFlutterRenderer
that was previously connected withattachToRenderer(FlutterRenderer)
.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)
.void
resume()
Instructs thisRenderSurface
to resume forwardingSurface
notifications to theFlutterRenderer
that was previously connected withattachToRenderer(FlutterRenderer)
.
-
Method Details
-
getAttachedRenderer
Returns theFlutterRenderer
that is attached to thisRenderSurface
, or null if noFlutterRenderer
is currently attached. -
attachToRenderer
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)
. -
resume
void resume()Instructs thisRenderSurface
to resume forwardingSurface
notifications to theFlutterRenderer
that was previously connected withattachToRenderer(FlutterRenderer)
.
-