LowLatencyCanvasView.Callback
public interface LowLatencyCanvasView.Callback
Provides callbacks for consumers to draw into the front buffered overlay as well as provide opportunities to synchronize SurfaceControlCompat.Transactions to submit the layers to the hardware compositor
Summary
Public methods |
|
|---|---|
abstract void |
@WorkerThreadCallback invoked to render content into the front buffered layer with the specified parameters. |
default void |
@WorkerThreadOptional callback invoked when rendering to the front buffered layer is complete but before the buffers are submitted to the hardware compositor. |
abstract void |
@WorkerThreadCallback invoked when the entire scene should be re-rendered. |
Public methods
onDrawFrontBufferedLayer
@WorkerThread
abstract void onDrawFrontBufferedLayer(@NonNull Canvas canvas, int width, int height)
Callback invoked to render content into the front buffered layer with the specified parameters.
onFrontBufferedLayerRenderComplete
@WorkerThread
default void onFrontBufferedLayerRenderComplete(
@NonNull SurfaceControlCompat frontBufferedLayerSurfaceControl,
@NonNull SurfaceControlCompat.Transaction transaction
)
Optional callback invoked when rendering to the front buffered layer is complete but before the buffers are submitted to the hardware compositor. This provides consumers a mechanism for synchronizing the transaction with other SurfaceControlCompat objects that maybe rendered within the scene.
| Parameters | |
|---|---|
@NonNull SurfaceControlCompat frontBufferedLayerSurfaceControl |
Handle to the |
@NonNull SurfaceControlCompat.Transaction transaction |
Current |
onRedrawRequested
@WorkerThread
abstract void onRedrawRequested(@NonNull Canvas canvas, int width, int height)
Callback invoked when the entire scene should be re-rendered. This is invoked during initialization and when the corresponding Activity is resumed from a background state.