Optimizing the usage of APIs

Device (other than display) drivers are started when they are first needed by an API call.

If a driver isn't yet loaded at the time that it's needed by an API call, Screen loads and starts the required driver. Therefore, you might experience pausing or stutter during the time that it takes for the driver to start. To improve the time it takes for your application to start, avoid using API calls in your splash screen application that triggers Screen to start device drivers. For example, avoid making hardware rendering calls because they cause OpenGL ES drivers to start, which are typically slow.

Screen starts only the drivers that are required by an API call. For example, if you make a call that requires only 2D hardware (blitter), then only that device driver is started. However, if you make a call that requires both 2D and 3D hardware rendering, then both the 2D and 3D hardware drivers are started, which can significantly increase the time it takes for your content to show on the display.

See the table below for the drivers that Screen starts, based on the APIs that are called:

Device Driver APIs that Triggers Screen to start driver
2D hardware (blitter) Screen Blit. See note below.

OpenGL ES

OpenGL ES 1.X

OpenGL ES 2.X

OpenGL ES 3.X

OpenVG

OpenCL

EGL

Vulkan

2D hardware (blitter) Screen Blit. See note below.
Display Not applicable

(Screen loads display drivers always when it starts)

Note: Calling screen_flush_blits() or screen_post_window() triggers Screen to start the Blit driver only if screen_blit() or screen_fill() was previously called.