Monado OpenXR Runtime
org.freedesktop.monado.auxiliary.MonadoView Class Reference
Inheritance diagram for org.freedesktop.monado.auxiliary.MonadoView:
Collaboration diagram for org.freedesktop.monado.auxiliary.MonadoView:

Public Member Functions

 MonadoView (Context context)
 
long getNativePointer ()
 
SurfaceHolder waitGetSurfaceHolder (int wait_ms)
 Block up to a specified amount of time, waiting for the surfaceCreated callback to be fired and populate the currentSurfaceHolder. More...
 
void markAsDiscardedByNative ()
 Change the flag and notify those waiting on it, to indicate that native code is done with this object. More...
 
void surfaceCreated (@NonNull SurfaceHolder surfaceHolder)
 
void surfaceChanged ( @NonNull SurfaceHolder surfaceHolder, int format, int width, int height)
 
void surfaceDestroyed (@NonNull SurfaceHolder surfaceHolder)
 
void surfaceRedrawNeeded (@NonNull SurfaceHolder surfaceHolder)
 

Static Public Member Functions

static MonadoView attachToActivity (@NonNull final Activity activity)
 Construct and start attaching a MonadoView to a client application. More...
 
static MonadoView attachToWindow ( @NonNull final Context displayContext, long nativePointer, WindowManager.LayoutParams lp) throws IllegalArgumentException
 Construct and start attaching a MonadoView to window. More...
 
static void removeFromWindow (@NonNull MonadoView view)
 Remove given MonadoView from window. More...
 
static DisplayMetrics getDisplayMetrics (@NonNull Context context)
 
static float getDisplayRefreshRate (@NonNull Context context)
 
static int getDisplayModeIdWidth ( @NonNull final Context context, int display, int displayModeId)
 Get the width of the specified display mode on the specified display ID. More...
 
static int getDisplayModeIdHeight ( @NonNull final Context context, int display, int displayModeId)
 Get the height of the specified display mode on the specified display ID. More...
 
static float[] getSupportedRefreshRates (@NonNull Context context)
 

Data Fields

int width = -1
 
int height = -1
 
int format = -1
 

Member Function Documentation

◆ attachToActivity()

static MonadoView org.freedesktop.monado.auxiliary.MonadoView.attachToActivity ( @NonNull final Activity  activity)
inlinestatic

Construct and start attaching a MonadoView to a client application.

Parameters
activityThe activity to attach to.
Returns
The MonadoView instance created and asynchronously attached.

◆ attachToWindow()

static MonadoView org.freedesktop.monado.auxiliary.MonadoView.attachToWindow ( @NonNull final Context  displayContext,
long  nativePointer,
WindowManager.LayoutParams  lp 
) throws IllegalArgumentException
inlinestatic

Construct and start attaching a MonadoView to window.

Parameters
displayContextDisplay context used for looking for target window.
nativePointerThe native android_custom_surface pointer, cast to a long.
lpLayout parameters associated with view.
Returns
The MonadoView instance created and asynchronously attached.

◆ getDisplayModeIdHeight()

static int org.freedesktop.monado.auxiliary.MonadoView.getDisplayModeIdHeight ( @NonNull final Context  context,
int  display,
int  displayModeId 
)
inlinestatic

Get the height of the specified display mode on the specified display ID.

If the specified mode ID is not in the list of supported mode IDs for the specified display ID, then a value of 0 is returned.

Parameters
contextDisplay context used for looking for target window.
displayThe display ID for which the mode is to be queried.
displayModeIdThe display mode ID for which the height is returned. This is a zero-indexed mode ID.
Returns
The height in pixels for the specified mode ID on the specified display.

◆ getDisplayModeIdWidth()

static int org.freedesktop.monado.auxiliary.MonadoView.getDisplayModeIdWidth ( @NonNull final Context  context,
int  display,
int  displayModeId 
)
inlinestatic

Get the width of the specified display mode on the specified display ID.

If the specified mode ID is not in the list of supported mode IDs for the specified display ID, then a value of 0 is returned.

Parameters
contextDisplay context used for looking for target window.
displayThe display ID for which the mode is to be queried.
displayModeIdThe display mode ID for which the width is returned. This is a zero-indexed mode ID.
Returns
The width in pixels for the specified mode ID on the specified display.

◆ markAsDiscardedByNative()

void org.freedesktop.monado.auxiliary.MonadoView.markAsDiscardedByNative ( )
inline

Change the flag and notify those waiting on it, to indicate that native code is done with this object.

Called by native code!

References org.freedesktop.monado.auxiliary.NativeCounterpart.markAsDiscardedByNative().

◆ removeFromWindow()

static void org.freedesktop.monado.auxiliary.MonadoView.removeFromWindow ( @NonNull MonadoView  view)
inlinestatic

Remove given MonadoView from window.

Parameters
viewThe view to remove.

◆ waitGetSurfaceHolder()

SurfaceHolder org.freedesktop.monado.auxiliary.MonadoView.waitGetSurfaceHolder ( int  wait_ms)
inline

Block up to a specified amount of time, waiting for the surfaceCreated callback to be fired and populate the currentSurfaceHolder.

If it returns a SurfaceHolder, the usedByNativeCode flag will be set.

Called by native code!

Parameters
wait_msMax duration you prefer to wait, in milliseconds. Spurious wakeups mean this not be totally precise.
Returns
A SurfaceHolder or null.

References org.freedesktop.monado.auxiliary.NativeCounterpart.markAsUsedByNativeCode().


The documentation for this class was generated from the following file: