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 IGraphicsModule

interface IGraphicsModule
Extends com.amazon.apmf.IStandard Top-level graphics module and factory for all graphics components. IGraphicsModule is the canonical entry point into the graphics API domain. It provides the factory methods for creating display controllers, GPU devices, windows, media and streaming surfaces, graphics buffers, color converters, and related graphics objects. Default Component: /com.amazon.kepler.graphics Example usage:

Methods

createDisplayControllerForApp()

IDisplayController* createDisplayControllerForApp(com.amazon.kepler.runtime.IComponentInstance* componentInstance, IDisplayControllerListener? listener)
Creates a display controller to access various display and other display related resources. This API is targeted for App component clients.

Parameters

componentInstance
com.amazon.kepler.runtime.IComponentInstance* — Required the app component that owns this display controller.
listener
IDisplayControllerListener? — Optional optional IDisplayControllerListener; pass null to create a controller without display controller event callbacks.

Returns

IDisplayController* IDisplayController device which can query mode and other display information

Throws


createDisplayControllerForSystemClients()

IDisplayController* createDisplayControllerForSystemClients(IDisplayControllerListener? listener)
Creates a display controller to access various display and other display related resources. This API is targeted for system services.

Parameters

listener
IDisplayControllerListener? — Optional optional IDisplayControllerListener; pass null to create a controller without display controller event callbacks.

Returns

IDisplayController* IDisplayController device which can query mode and other display information

Throws


createGpuDeviceUsingOpenGlesApi()

IGpuDevice* createGpuDeviceUsingOpenGlesApi(IDisplayController* device)
Creates a GPU device for rendering, returning the latest version of OpenGL ES supported by the system. See [IGpuDevice#getRenderingCapabilities].

Parameters

device
IDisplayController* — Required display device

Returns

IGpuDevice* IGpuDevice that renders using the OpenGL ES API

Throws


createGpuDeviceUsingVulkanApi()

IGpuDevice* createGpuDeviceUsingVulkanApi(IDisplayController* device)
Creates a GPU device for rendering using the Vulkan API, returning the latest version of Vulkan supported by the system. See [IGpuDevice#getRenderingCapabilities]. The Vulkan API is not supported on current platforms; on such platforms this method always throws DeviceError. Use createGpuDeviceUsingOpenGlesApi for GPU rendering until Vulkan support is added.

Parameters

device
IDisplayController* — Required display device

Returns

IGpuDevice* IGpuDevice that renders using the Vulkan API

Throws

  • DeviceError — if the Vulkan API is not supported on the current platform, or if the display subsystem is not in a valid state
  • OutOfMemoryError — if device is out of memory

createWindow()

IWindow* createWindow(IDisplayController* device, string title, WindowRole windowRole, i32 requestedWidth, i32 requestedHeight, i32 requestedPosX, i32 requestedPosY)
Creates a Window and attaches it to a GPU device for rendering. Window is created by default as opaque. If requested width and height are both zero, then a full-screen window based on ICanvasConfig size is created. If both are non-zero, then display-subsystem would try to respect the size but it may be overridden by the Window Manager. Register an [IResizeListener] via [IWindow#addResizeListener] to observe the actual size of the window. The same is true for position as well. Default position is (0,0) and requested position(non zero x and y) may be overridden by the Window Manager. Register an [IPositionListener] via [IWindow#addPositionListener] to observe the actual position. Position and size are expected in logical pixels as per ICanvasConfig.

Parameters

device
IDisplayController* — Required display device
title
string — Required Window title
windowRole
WindowRole — Required Window role
requestedWidth
i32 — Required Requested width
requestedHeight
i32 — Required Requested height
requestedPosX
i32 — Required Requested position ‘x’ (top left)
requestedPosY
i32 — Required Requested position ‘y’ (top left)

Returns

IWindow* IWindow with title and appId set

Throws


createMediaSurface()

IMediaSurface* createMediaSurface(IDisplayController* device, i64 windowHandle)
Creates a media surface which can be used to show media buffers for a window.

Parameters

device
IDisplayController* — Required display subsystem instance
windowHandle
i64 — Required handle of the window where the source of buffers will be presented.

Returns

IMediaSurface* IMediaSurface

Throws


createTargetProperties()

ITargetProperties* createTargetProperties()
Creates a TargetProperties for use with [IMediaSurface#presentBuffer].

Returns

ITargetProperties* ITargetProperties

Throws


createGraphicsBuffer()

com.amazon.kepler.buffer.IBufferGroup* createGraphicsBuffer(i32 width, i32 height, BufferPixelFormat* format, BufferMime* mimeType, BufferUsage* usage)
Creates a graphics buffer.

Parameters

width
i32 — Required Buffer width
height
i32 — Required Buffer height
format
BufferPixelFormat* — Required Buffer format
mimeType
BufferMime* — Required Buffer MIME type
usage
BufferUsage* — Required Buffer usage

Returns

com.amazon.kepler.buffer.IBufferGroup* IBufferGroup representing a graphics buffer

Throws


createGraphicsBufferFromFdMetadata()

com.amazon.kepler.buffer.IBufferGroup* createGraphicsBufferFromFdMetadata(com.amazon.apmf.IFileDescriptor*[] fdList, GraphicsBufferGroupData* graphicsBufferGroupData)
Creates a graphics buffer from a list of file descriptors and associated metadata.

Parameters

fdList
com.amazon.apmf.IFileDescriptor*[] — Required list of FD
graphicsBufferGroupData
GraphicsBufferGroupData* — Required graphics buffer group data containing meta data about the buffer

Returns

com.amazon.kepler.buffer.IBufferGroup* IBufferGroup representing a graphics buffer

Throws


createColorConverter()

IColorConverter* createColorConverter(IDisplayController* device, IColorConversionListener* listener)
Creates a color converter interface which can be used to convert a buffer of a specific source format to another destination buffer of a different format

Parameters

device
IDisplayController* — Required display device
listener
IColorConversionListener* — Required color converter listener. Result of asynchronous operations are notified via IColorConversionListener.

Returns

IColorConverter* IColorConverter converter object

Throws


createStreamingSurface()

IStreamingSurface* createStreamingSurface(IDisplayController* displayController, i64 windowHandle)
Creates a streaming surface which represents a special kind of surface for presenting 3D content coming as media frames. This surface is typically associated with applications which present 3D content which has been rendered somewhere else outside the application process.

Parameters

displayController
IDisplayController* — Required display controller object. [IGraphicsModule#createDisplayControllerForApp]
windowHandle
i64 — Required handle of the window where the source of buffers will be presented. [IWindow#getHandle].

Returns

IStreamingSurface* IStreamingSurface The surface to present media buffers

Throws


createMemoryStats()

IMemoryStats* createMemoryStats()
Creates a MemoryStats interface which can be used to get memory related stats of the client invoking this API.

Returns

IMemoryStats* IMemoryStats object

Throws


Last modified on October 29, 2026