Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Native
Skip to main content

Interface IContext

interface IContext
Extends com.amazon.apmf.IStandard Defines a rendering context.

Methods

getFence()

IFence* 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.

Returns

IFence* A fence for current render state.

Throws

  • DeviceError — if the IContext is not in valid state

insertFence()

void insertFence(IFence* fence)
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.

Parameters

fence
IFence* — Required The fence object to inject.

Throws


makeCurrent()

void makeCurrent(IGraphicsSurface* surface)
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.

Parameters

surface
IGraphicsSurface* — Required the surface make current for rendering.

Throws


resetCurrent()

bool resetCurrent()
Reset current surface, after this no surface/context is current

Returns

bool True if reset successfully.

Throws


isCurrentContext()

bool isCurrentContext()

Returns

bool Whether this context is current.

Throws


getNativeHandle()

com.amazon.apmf.NativePointer getNativeHandle()
Query the native handle based on platforms.

Returns

com.amazon.apmf.NativePointer Native handle as NativePointer

Throws


Last modified on October 29, 2026