FakeHardwareBufferNativeHelpers


@RequiresApi(value = 26)
@ExperimentalApi
class FakeHardwareBufferNativeHelpers : HardwareBufferNativeHelpers


Fake class to simulate HardwareBufferNativeHelpers.

Summary

Public constructors

Public functions

Boolean

Copies a Bitmap to a HardwareBuffer.

Boolean

Copies the contents of a source HardwareBuffer to a destination HardwareBuffer.

Public properties

Boolean

Whether the operations should succeed.

Public constructors

FakeHardwareBufferNativeHelpers

FakeHardwareBufferNativeHelpers()

Public functions

nativeCopyBitmapToHardwareBuffer

fun nativeCopyBitmapToHardwareBuffer(bitmap: Bitmap!, hb: HardwareBuffer!): Boolean

Copies a Bitmap to a HardwareBuffer.

The destination HardwareBuffer must have USAGE_CPU_WRITE_OFTEN usage.

The source Bitmap.Config must match the destination getFormat, and be either ARGB_8888 and RGBA_8888 or RGBA_1010102 and RGBA_1010102.

Parameters
bitmap: Bitmap!

The source bitmap.

hb: HardwareBuffer!

The destination hardware buffer.

Returns
Boolean

Whether the copy is successful.

nativeCopyHardwareBufferToHardwareBuffer

fun nativeCopyHardwareBufferToHardwareBuffer(
    srcHb: HardwareBuffer!,
    dstHb: HardwareBuffer!
): Boolean

Copies the contents of a source HardwareBuffer to a destination HardwareBuffer.

The source HardwareBuffer must have USAGE_CPU_READ_OFTEN usage, and the destination HardwareBuffer must have USAGE_CPU_WRITE_OFTEN usage.

The formats of the source and destination buffers must match, and be either RGBA_8888 or RGBA_1010102.

Parameters
srcHb: HardwareBuffer!

The source hardware buffer.

dstHb: HardwareBuffer!

The destination hardware buffer.

Returns
Boolean

Whether the copy is successful.

Public properties

shouldSucceed

val shouldSucceedBoolean

Whether the operations should succeed.