Interface IContext
interface IContext
Extends com.amazon.apmf.IStandard
Defines a rendering context.
Methods
getFence()
Inserts a fence command into a client API command stream and returns a native synchronization fence object referenced using a file descriptor. Caller can wait on the FD or insert it into other surfaces to track appropriate dependencies.IFence*getFence()
Returns
IFence*
A fence for current render state.
Throws
DeviceError— if the IContext is not in valid state
insertFence()
Insert a native synchronization fence object into client API command stream. The fence can be duplicated and passed to driver. Client is free to close IFence. ‘insertFence’ will make sure the dependencies tracked by this Fence are inserted appropriately. To achieve this, the implementation is free to use appropriate Wait API or make sure all the previous called client commands are executed in case the underlying platform doesn’t have support to insert dependencies using Fence.voidinsertFence(IFence*fence)
Parameters
fence
IFence* — Required
The fence object to inject.
Throws
DeviceError— if IContext is not in valid stateNullPointerError— if any input argument is null pointer while a non-null one is expectedInvalidArgumentError— if any input argument is invalid
makeCurrent()
Binds current IContext and surface to the current rendering thread. This operation might fail if IGraphicsSurface and IContext have been created with incompatible or different IContextConfig objects.voidmakeCurrent(IGraphicsSurface*surface)
Parameters
surface
IGraphicsSurface* — Required
the surface make current for rendering.
Throws
DeviceError— if IContext is not in valid stateNullPointerError— if any input argument is null pointer while a non-null one is expectedInvalidArgumentError— if any input argument is invalid
resetCurrent()
bool resetCurrent()
Reset current surface, after this no surface/context is current
Returns
bool
True if reset successfully.
Throws
DeviceError— if IContext is not in valid state
isCurrentContext()
bool isCurrentContext()
Returns
bool
Whether this context is current.
Throws
DeviceError— if IContext is not in valid state
getNativeHandle()
com.amazon.apmf.NativePointer getNativeHandle()
Query the native handle based on platforms.
Returns
com.amazon.apmf.NativePointer
Native handle as NativePointer
Throws
DeviceError— if IContext is not in valid state

