Taal

HardwareRenderer.FrameRenderRequest.SetFrameCommitCallback Method

Definition

Adds a frame commit callback.

[Android.Runtime.Register("setFrameCommitCallback", "(Ljava/util/concurrent/Executor;Ljava/lang/Runnable;)Landroid/graphics/HardwareRenderer$FrameRenderRequest;", "", ApiSince=29)]
public Android.Graphics.HardwareRenderer.FrameRenderRequest SetFrameCommitCallback(Java.Util.Concurrent.IExecutor executor, Java.Lang.IRunnable frameCommitCallback);
[<Android.Runtime.Register("setFrameCommitCallback", "(Ljava/util/concurrent/Executor;Ljava/lang/Runnable;)Landroid/graphics/HardwareRenderer$FrameRenderRequest;", "", ApiSince=29)>]
member this.SetFrameCommitCallback : Java.Util.Concurrent.IExecutor * Java.Lang.IRunnable -> Android.Graphics.HardwareRenderer.FrameRenderRequest

Parameters

executor
IExecutor

The executor to run the callback on. It is strongly recommended that this executor post to a different thread, as the calling thread is highly sensitive to being blocked. This value cannot be null.

frameCommitCallback
IRunnable

The callback to invoke on the given executor for the rendering request. This value cannot be null.

Returns

this instance. This value cannot be null.

Attributes

Remarks

When a frame is submitted to the swap chain, the callback runs before the frame is necessarily visible on the display. The callback can be used with PixelCopy to capture rendered UI content. On Android 11 and later, it can also run when there is nothing to draw, so it does not by itself prove that a new frame was submitted.

Android reference for android.graphics.HardwareRenderer.FrameRenderRequest.setFrameCommitCallback.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to