FrontBufferSyncStrategy


class FrontBufferSyncStrategy : SyncStrategy


SyncStrategy implementation that optimizes for front buffered rendering use cases. More specifically this attempts to avoid unnecessary synchronization overhead wherever possible.

This will always provide a fence if the corresponding layer transitions from an invisible to a visible state. If the layer is already visible and front buffer usage flags are support on the device, then no fence is provided. If this flag is not supported, then a fence is created to ensure contents are flushed to the single buffer.

Summary

Public constructors

Public functions

open SyncFenceCompat?

Creates a SyncFenceCompat based on various conditions.

Public properties

Boolean

Tells whether the corresponding front buffer layer is visible in its current state or not.

Public constructors

FrontBufferSyncStrategy

Added in 1.0.2
FrontBufferSyncStrategy(usageFlags: Long)
Parameters
usageFlags: Long

usage flags that describe the HardwareBuffer that is used as the destination for rendering content within FrameBufferRenderer. The usage flags can be obtained via HardwareBuffer.getUsage or by passing in the same flags from HardwareBuffer.create

Public functions

createSyncFence

Added in 1.0.2
open fun createSyncFence(eglSpec: EGLSpec): SyncFenceCompat?

Creates a SyncFenceCompat based on various conditions. If the layer is changing from invisible to visible, a fence is provided. If the layer is already visible and front buffer usage flag is supported on the device, then no fence is provided. If front buffer usage is not supported, then a fence is created and destroyed to flush contents to screen.

Public properties

isVisible

Added in 1.0.2
var isVisibleBoolean

Tells whether the corresponding front buffer layer is visible in its current state or not. Utilize this to dictate when a SyncFenceCompat will be created when using createSyncFence.