FakeSurfaceEntity


public final class FakeSurfaceEntity extends FakeEntity


Test-only implementation of SurfaceEntity

Summary

Public constructors

Public methods

@NonNull SurfaceEntity.CanvasShape

Specifies the shape of the spatial canvas which the surface is texture mapped to.

@NonNull Dimensions

Retrieves the dimensions of the "spatial canvas" which the surface is mapped to.

float

The width of the left/right feathered edges of the canvas.

float

The width of the top/bottom feathered edges of the canvas.

int

Specifies how the surface content will be routed for stereo viewing.

@NonNull Surface

Retrieves the surface that the Entity will display.

void

The texture to be composited into the alpha channel of the auxiliary view of the surface.

void

Specifies the shape of the spatial canvas which the surface is texture mapped to.

void
setFeatherRadiusX(float featherRadiusX)

The width of the left/right feathered edges of the canvas.

void
setFeatherRadiusY(float featherRadiusY)

The width of the top/bottom feathered edges of the canvas.

void

The texture to be composited into the alpha channel of the surface.

void
setStereoMode(int stereoMode)

Specifies how the surface content will be routed for stereo viewing.

Public constructors

FakeSurfaceEntity

Added in 1.0.0-alpha04
public FakeSurfaceEntity()

Public methods

getCanvasShape

Added in 1.0.0-alpha04
public @NonNull SurfaceEntity.CanvasShape getCanvasShape()

Specifies the shape of the spatial canvas which the surface is texture mapped to.

getDimensions

Added in 1.0.0-alpha04
public @NonNull Dimensions getDimensions()

Retrieves the dimensions of the "spatial canvas" which the surface is mapped to. These values are not impacted by scale.

Returns
@NonNull Dimensions

The canvas Dimensions.

getFeatherRadiusX

Added in 1.0.0-alpha04
public float getFeatherRadiusX()

The width of the left/right feathered edges of the canvas.

getFeatherRadiusY

Added in 1.0.0-alpha04
public float getFeatherRadiusY()

The width of the top/bottom feathered edges of the canvas.

getStereoMode

Added in 1.0.0-alpha04
public int getStereoMode()

Specifies how the surface content will be routed for stereo viewing. Applications must render into the surface in accordance with what is specified here in order for the compositor to correctly produce a stereoscopic view to the user.

getSurface

Added in 1.0.0-alpha04
public @NonNull Surface getSurface()

Retrieves the surface that the Entity will display. The app can write into this surface however it wants, i.e. MediaPlayer, ExoPlayer, or custom rendering.

Returns
@NonNull Surface

an Android Surface

setAuxiliaryAlphaMaskTexture

Added in 1.0.0-alpha04
public void setAuxiliaryAlphaMaskTexture(TextureResource alphaMask)

The texture to be composited into the alpha channel of the auxiliary view of the surface. This is only used for interleaved stereo content. If null, the alpha mask will be disabled.

Parameters
TextureResource alphaMask

The auxiliary alpha mask texture.

setCanvasShape

Added in 1.0.0-alpha04
public void setCanvasShape(@NonNull SurfaceEntity.CanvasShape canvasShape)

Specifies the shape of the spatial canvas which the surface is texture mapped to.

setFeatherRadiusX

Added in 1.0.0-alpha04
public void setFeatherRadiusX(float featherRadiusX)

The width of the left/right feathered edges of the canvas.

setFeatherRadiusY

Added in 1.0.0-alpha04
public void setFeatherRadiusY(float featherRadiusY)

The width of the top/bottom feathered edges of the canvas.

setPrimaryAlphaMaskTexture

Added in 1.0.0-alpha04
public void setPrimaryAlphaMaskTexture(TextureResource alphaMask)

The texture to be composited into the alpha channel of the surface. If null, the alpha mask will be disabled.

Parameters
TextureResource alphaMask

The primary alpha mask texture.

setStereoMode

Added in 1.0.0-alpha04
public void setStereoMode(int stereoMode)

Specifies how the surface content will be routed for stereo viewing. Applications must render into the surface in accordance with what is specified here in order for the compositor to correctly produce a stereoscopic view to the user.