FrontBufferSyncStrategy
public final class FrontBufferSyncStrategy implements 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 |
|---|
FrontBufferSyncStrategy(long usageFlags) |
Public methods |
|
|---|---|
SyncFenceCompat |
createSyncFence(@NonNull EGLSpec eglSpec)Creates a |
final boolean |
Tells whether the corresponding front buffer layer is visible in its current state or not. |
final void |
setVisible(boolean isVisible)Tells whether the corresponding front buffer layer is visible in its current state or not. |
Public constructors
FrontBufferSyncStrategy
public FrontBufferSyncStrategy(long usageFlags)
| Parameters | |
|---|---|
long usageFlags |
usage flags that describe the |
Public methods
createSyncFence
public SyncFenceCompat createSyncFence(@NonNull EGLSpec eglSpec)
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.
isVisible
public final boolean isVisible()
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.
setVisible
public final void setVisible(boolean isVisible)
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.