Optimizing the usage of APIs

The use of the SCREEN_PROPERTY_USAGE property indicates how the application intends to use buffers for Screen.

Screen doesn’t immediately load all the device drivers based on the value of the SCREEN_PROPERTY_USAGE flag. Instead, the device drivers are started when they are first needed by an API call. Therefore, you might experience pausing or stutter because Screen may need time to start a driver if it isn’t yet loaded. 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 devices 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:

Usage flag types Screen starts Device Driver? Associated Device Driver APIs that Triggers Screen to start driver
SCREEN_USAGE_NATIVE Yes 2D hardware (blitter) Screen Blit. See Note below.

SCREEN_USAGE_OPENGL_ES1

SCREEN_USAGE_OPENGL_ES2

SCREEN_USAGE_OPENGL_ES3

Yes OpenGL ES OpenGL ES 1.X

OpenGL ES 2.X

OpenGL ES 3.X

SCREEN_USAGE_OPENVG Yes 2D hardware (blitter), OpenVG Screen Blit. See Note below.

OpenVG

SCREEN_USAGE_VIDEO

SCREEN_USAGE_CAPTURE

SCREEN_USAGE_WRITE

No Video

Capture/Camera

Not applicable
SCREEN_USAGE_OVERLAY Yes Display Not applicable
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.

Let's say that you need to perform a video capture, but also want to render using OpenGL ES. You can still set the SCREEN_PROPERTY_USAGE property to include the SCREEN_USAGE_CAPTURE and SCREEN_USAGE_OPENGL_ES2 usage flags. The device drivers required for OpenGL ES2 won't load until you make an OpenGL ES 2.X API call.